public function createItem() { $apps = app_param('app'); switch ($apps) { case 'article': if (app_param('view') == 'archive' || app_param('view') == 'featured') { $result = Page_ID; return $this->creatLink($result); } else { if (app_param('view') == 'category') { $result = $this->catLink('id'); return $this->creatLink($result); } else { if (app_param('view') == 'item') { $result = $this->artLink('id'); if (empty($result)) { $result = $this->catLink('id'); } return $this->creatLink($result, 1); } else { $result = Page_ID; return $this->creatLink($result); } } } break; default: if (!checkHomePage()) { return $this->creatLink(Page_ID); } break; } }
function loadApps() { $db = new FQuery(); $db->connect(); $qr = null; //set $qr to null value $view = app_param('app'); if (isset($_GET['theme']) and $_GET['theme'] == 'module' and $_SESSION['USER_LEVEL'] > 3) { $view = ''; } $sql = $db->select(FDBPrefix . 'apps', '*', "folder='app_{$view}'"); mysql_fetch_array($sql); if (mysql_affected_rows() != 0) { $sql2 = $db->select(FDBPrefix . 'menu', '*', "id=" . Page_ID); $qrs = @mysql_fetch_array($sql2); $theme = siteConfig('site_theme'); $tfile = "themes/{$theme}/apps/app_{$view}/index.php"; $file = "apps/app_{$view}/index.php"; if (file_exists($file)) { if (_FEED_ != 'rss') { echo '<div class="apps' . $qrs["class"] . $qrs["class"] . '">'; } if (!empty($qrs['title']) and $qrs['show_title']) { define("Apps_Title", "{$qrs['title']}"); } if ($qrs['show_title']) { if (!defined('Apps_Title')) { define("Apps_Title", "{$qrs['name']}"); } } if (_FEED_ != 'rss') { echo '<div class="main_apps">'; } if (file_exists($tfile)) { include $tfile; } else { if (file_exists($file)) { include $file; } } if (_FEED_ != 'rss') { echo ' </div></div>'; } } } else { if (isset($_GET['theme']) and $_GET['theme'] == 'module' and $_SESSION['USER_LEVEL'] < 3) { echo "<div style='border: 2px solid #e3e3e3; background: rgba(250,250,250,0.8);\tcolor :#aaa; \n\t\tpadding: 30px; text-align: center; margin: 5px 3px; font-weight: bold;'>Main Content</div>"; } else { $lang = siteConfig('lang'); echo '<div class="apps' . $qr["class"] . '">' . _404_ . '</div><p>'; $file = "modules/mod_search/mod_search.php"; if (file_exists($file)) { include $file; } echo '</p>'; loadModule('404'); } } }
$s = FQuery('article', "category = {$archveRow['category']} AND status = 1"); if (isset($m) and $m != $archveRow['category']) { echo "</ul></li></ul>"; } if (@$m != $archveRow['category']) { $open = ''; if (app_param('app') == 'article' and (app_param('view') == 'category' or app_param('view') == 'item')) { if (articleInfo('category') == "{$archveRow['category']}") { $open = " open"; } } echo "\n\t\t\t\t<ul class='mod-article-archive'>\n\t\t\t\t\t<li class='archive-head'><a class='archive-head-a'>{$catname} ({$s})</a>\n\t\t\t\t<ul class='archive-list{$open}'>"; } if ($archveRow['status'] == 1) { $active = ''; if (app_param('app') == 'article' and app_param('view') == 'item') { if (articleInfo('id') == "{$archveRow['id']}") { $active = "active"; } } $article = "<a title='Read \"{$archveRow['title']}\"' href='{$link}' class='{$active}'>{$archveRow['title']}</a>"; echo "<li>{$article}</li>"; $x++; } $m = $archveRow['category']; } } //set m to null $m = 0; if ($x == 0) { echo "Article not found";
<?php /** * @version 1.5.0 * @package Fi pdf * @copyright Copyright (C) 2012 Fiyo Developers. * @license GNU/GPL, see LICENSE.txt **/ defined('_FINDEX_') or die('Access Denied'); $id = app_param('id'); $view = app_param('view'); addCss(FUrl . '/apps/app_pdf/style/default.css'); switch ($view) { case 'category': require "apps/app_pdf/view/category.php"; break; case 'item': require "apps/app_pdf/view/item.php"; break; case 'pdf': require "apps/app_pdf/view/category.php"; break; default: require "apps/app_pdf/view/default.php"; break; }
function category($id, $menuId, $fp = null) { //validation page type $categoryName = $categoryDesc = null; $label = app_param('label'); if ($id > 0) { $flag = FQuery("pustaka_category", "id={$id}", '', 1); } else { if (!empty($label)) { $label = app_param('label'); $label = str_replace("-", " ", $label); $label = "AND tags LIKE '%" . $label . "%' "; } $flag = true; } //if page type is valid if ($flag) { $db = new FQuery(); $db->connect(); /************** Parameter Page ***************/ $per_page = 10; $categoryId = $id; if (empty($param)) { $show_panel = 1; $per_page = 10; } if (url_param('feed') == 'rss') { $per_page = 10; $pages = url_param('page'); if ($pages != null) { $link = str_replace("?page={$pages}", "", getUrl()); redirect("{$link}?feed=rss"); } } if (isset($label)) { $per_page = 10; } if (empty($per_page)) { $per_page = 10; } //$fp is default page if (!isset($fp) and !isset($label)) { $categoryName = oneQuery('pustaka_category', 'id', $categoryId, 'name'); $categoryDesc = oneQuery('pustaka_category', 'id', $categoryId, 'description'); } $level_access = Level_Access; //$if category id is not found if (!$categoryId and !isset($fp) and !isset($label)) { echo pustaka_Page_Notfound; } else { if (isset($categoryName)) { $whereCat = "AND category = {$categoryId}"; } else { $whereCat = null; } //call paging class loadPaging(); $paging = new paging(); $rowsPerPage = $per_page; //paging results $result = $paging->pagerQuery(FDBPrefix . 'pustaka_file', "*", "status=1 {$whereCat} {$label}", 'id DESC', $rowsPerPage); $no = 0; //count rows $jml = mysql_affected_rows(); while ($qr = mysql_fetch_array($result)) { /********** File Author ***********/ $author = $qr['author']; /********** File Category ***********/ $catlink = categoryLink($qr['category']); $category = oneQuery('pustaka_category', 'id', $qr['category'], 'name'); $category = "<a href='{$catlink}' title='See more {$category}'>{$category}</a>"; /********** pdf Link ***********/ $flink = "?app=pdf&view=item&id={$qr['id']}"; $link = make_permalink($flink, Page_ID); $title = "<a href='{$link}'>{$qr['title']}</a>"; /********** File Labels ***********/ $labels = labelToLink($qr['tags']); /********** File Compability ***********/ $this->perrows = $jml; $this->show_panel = $show_panel; $this->category[$no] = $category; $this->catlink[$no] = $catlink; $this->author[$no] = $author; $this->title[$no] = $title; $this->link[$no] = $link; $this->labels[$no] = $labels; $this->date[$no] = $qr['year']; $this->hits[$no] = $qr['hits']; $this->desc[$no] = $qr['description']; if (url_param('feed') == 'rss' and url_param('feed') == 'rss' or app_param('label')) { $this->description[$no] = $qr['description']; } if (defined('SEF_URL')) { $link = link_paging('?'); } else { if (checkhomepage()) { $link = "?"; } else { $link = "?app=pdf&view=category&id={$categoryId}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } } $no++; } if ($no == 0) { echo "<h1 style='margin:20px auto'>Pustaka Kosong !!!!</h1>"; } //start paging links $db->select(FDBPrefix . 'pustaka_file', '*', "status=1 {$whereCat} {$level_access}"); $jml = mysql_affected_rows(); if ($jml > $rowsPerPage) { $pagelink = $paging->createPaging($link); } else { $pagelink = null; } //send paging var relsult $this->pglink = $pagelink; //if parameter found rss page if (url_param('feed') == 'rss' and url_param('feed') == 'rss' or app_param('label')) { $this->catName = $categoryName; $this->catDesc = $categoryDesc; } } } else { pustaka_Page_Notfound; } }
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); $cat_id = app_param('id'); if (categoryInfo('name', $cat_id)) { $article = new Article(); $article->category('category', $cat_id, $format); require "apps/app_article/view/format/{$format}.php"; } else { echo _404_; }
//load Apps System loadAppsSystem(); if (!defined('MetaDesc')) { define('MetaDesc', siteConfig('site_desc')); } if (!defined('MetaKeys')) { define('MetaKeys', siteConfig('site_keys')); } if (!defined('TitleValue')) { define('TitleValue', app_param('name')); } if (!defined('MetaAuthor')) { define('MetaAuthor', siteConfig('site_name')); } if (!defined('MetaRobots')) { if (app_param('app') == null) { define('MetaRobots', 'noindex'); } else { if (siteConfig('follow_link')) { define('MetaRobots', 'index, follow'); } else { define('MetaRobots', 'index, nofollow'); } } } /********************************************/ /* Define Type & Site Title */ /********************************************/ if (isset($_GET['theme']) and $_GET['theme'] == 'module') { define('PageTitle', 'Module_Position'); } else {
function add_permalink($title, $cat = NULL, $pid = null, $ext = null, $next = null) { $page = _Page; if (!preg_match("/[0-9]/", $page)) { $page = null; } if (SEF_URL and !checkHomePage() and !$page) { $db = new FQuery(); $db->connect(); $eqpos = strpos($_SERVER['REQUEST_URI'], "="); $tapos = strpos($_SERVER['REQUEST_URI'], "?"); if ($eqpos > 0 and $tapos > 0 and empty($_GET['page'])) { $permalink = str_replace(" ", "-", strtolower($title)); if (app_param('app') == 'article' and app_param('view') == 'item') { while (substr_count($permalink, '/')) { $permalink = str_replace("/", "-", $permalink); } } $category = str_replace(" ", "-", strtolower($cat)); if (!empty($cat)) { $permalink = strtolower($category) . "/" . $permalink; } else { $permalink = $permalink; } while (substr_count($permalink, "[")) { $permalink = str_replace("[", "", $permalink); } while (substr_count($permalink, "]")) { $permalink = str_replace("]", "", $permalink); } while (substr_count($permalink, "(")) { $permalink = str_replace("(", "", $permalink); } while (substr_count($permalink, ")")) { $permalink = str_replace(")", "", $permalink); } while (substr_count($permalink, "{")) { $permalink = str_replace("{", "", $permalink); } while (substr_count($permalink, "}")) { $permalink = str_replace("}", "", $permalink); } while (substr_count($permalink, "&")) { $permalink = str_replace("&", "", $permalink); } while (substr_count($permalink, "&")) { $permalink = str_replace("&", "", $permalink); } /************ ? removal **************/ while (substr_count($permalink, "?")) { $permalink = str_replace("?", "", $permalink); } /************ + removal **************/ while (substr_count($permalink, "+")) { $permalink = str_replace("+", "", $permalink); } /************ # removal **************/ while (substr_count($permalink, "#")) { $permalink = str_replace("#", "", $permalink); } /************ & removal **************/ while (substr_count($permalink, "\\&")) { $permalink = str_replace("\\&", "", $permalink); } /************ . removal **************/ while (substr_count($permalink, ".")) { $permalink = str_replace(".", "-", $permalink); } /************ ! removal **************/ while (substr_count($permalink, "!")) { $permalink = str_replace("!", "", $permalink); } /************ ` removal **************/ while (substr_count($permalink, "`")) { $permalink = str_replace("`", "", $permalink); } /************ ' removal **************/ while (substr_count($permalink, "'")) { $permalink = str_replace("'", "", $permalink); } /************ " removal **************/ while (substr_count($permalink, "\"")) { $permalink = str_replace('"', "", $permalink); } /************ ; removal **************/ while (substr_count($permalink, ";")) { $permalink = str_replace(';', "", $permalink); } /************ " removal **************/ while (substr_count($permalink, '|')) { $permalink = str_replace('|', "", $permalink); } /************ % removal **************/ while (substr_count($permalink, '%')) { $permalink = str_replace('%', "", $permalink); } /************ * removal **************/ while (substr_count($permalink, '*')) { $permalink = str_replace('*', "", $permalink); } /************ ^ removal **************/ while (substr_count($permalink, '^')) { $permalink = str_replace('^', "", $permalink); } /************ \ removal **************/ while (substr_count($permalink, '\\')) { $permalink = str_replace("\\", "", $permalink); } /************ \ removal **************/ /************ , removal **************/ while (substr_count($permalink, ',')) { $permalink = str_replace(",", "", $permalink); } /************ $ removal **************/ while (substr_count($permalink, '$')) { $permalink = str_replace("\$", "", $permalink); } /************ @ removal **************/ while (substr_count($permalink, '@')) { $permalink = str_replace("@", "", $permalink); } while (substr_count($permalink, "--")) { $permalink = str_replace("--", "-", $permalink); } if (empty($pid)) { $pid = Page_ID; } $link = getLink(); if (!empty($category) and empty($ext)) { $permalink = $permalink . SEF_EXT; } else { if (!empty($ext)) { $ext = str_replace(".", "", $ext); $permalink = "{$permalink}.{$ext}"; } } if (check_permalink('link', $link)) { redirect(FUrl . $permalink); } else { if (!empty($permalink)) { if ($c = check_permalink('permalink', $permalink)) { $x = 2; $permalink = str_replace(SEF_EXT, "", $permalink); while ($c) { $p = "{$permalink}-{$x}"; $c = check_permalink('permalink', $p . SEF_EXT); $x++; } $permalink = $p . SEF_EXT; } if (!empty($permalink) and $permalink != "-" and !empty($link)) { $qr = $db->insert(FDBPrefix . 'permalink', array("", "{$link}", "{$permalink}", $pid, 1, 0)); } if (isset($qr)) { redirect(FUrl . $permalink); } } } } } }
/** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); /********************************************/ /* Site Information */ /********************************************/ /* Define SEF Base URL */ define('FBase', FUrl()); define('FUrl', 'http://' . FBase); /* Define deed url */ define('_FEED_', app_param('feed')); /* SEF Information */ define('SEF_URL', siteConfig('sef_url')); define('SEF_EXT', siteConfig('sef_ext')); /* Site Information */ define('SiteUrl', siteConfig('site_url')); define('SiteTitle', siteConfig('site_title')); define('SiteName', siteConfig('site_name')); define('SiteLang', siteConfig('lang')); define('SiteOnline', siteConfig('site_status')); /* Title Information */ define('TitleType', siteConfig('title_type')); define('TitleDiv', siteConfig('title_divider')); /********************************************/ /* SEF Pagination */ /********************************************/
<?php /** * @version 2.0 * @package Fiyo Contact * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description **/ defined('_FINDEX_') or die('Access Denied'); $view = app_param('view'); $app = app_param('app'); echo "<div id='contact'>"; switch ($view) { default: require "view/office.php"; break; case 'group': require "view/group.php"; break; case 'person': require "view/personal.php"; break; } echo "</div>";
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description **/ defined('_FINDEX_') or die('Access Denied'); $id = app_param('id'); $contact = new Contact() or die; //$contact -> send(@$_POST['name'],@$_POST['email'],@$_POST['text'],@$_POST['send'],@$_POST['to']); $param = menuInfo('parameter'); $email = parse_param('office_email', $param); $ph1 = parse_param('office_phone1', $param); $ph2 = parse_param('office_phone2', $param); $addr = parse_param('office_address', $param); $text = parse_param('office_text', $param); $fax = parse_param('office_fax', $param); $map = parse_param('office_map', $param); ?> <script> function reloadCaptcha() { document.getElementById('captcha').src = document.getElementById('captcha').src+ '?' +new Date(); } $(function() { $('.send_contact').click(function() { var name = $("#contact-name").val();
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); //memuat file pendukung query dan fungsi lainya require_once '../config.php'; require_once '../system/query.php'; require_once '../system/function.php'; require_once '../system/user.php'; require_once '../system/site.php'; require_once 'function.php'; //check table setting $r = mysql_query("SHOW TABLES LIKE '" . FDBPrefix . "setting'"); mysql_num_rows($r) or die(alert("error", "Table setting is not found. Please check <b>DBPrefix</b> on file config.php!", true, true)); //set default timezone $time = siteConfig('timezone'); if ($time) { date_default_timezone_set(siteConfig('timezone')); } //memuat file bahasa jika ditemukan loadLang("system"); define('MetaDesc', siteConfig('site_desc')); define('MetaKeys', siteConfig('site_keys')); define('TitleValue', app_param('name')); //memuat file pendukung system dan file appss loadSystemApps();
function category($id, $fp = null) { $db = new FQuery(); $db->connect(); $param = oneQuery('menu', 'id', Page_ID, 'parameter'); $show_panel = mod_param('show_name', $param); $read_more = mod_param('read_more', $param); $per_page = mod_param('per_page', $param); $this->sname = mod_param('show_name', $param); $this->sgroup = mod_param('show_group', $param); $this->sgender = mod_param('show_gender', $param); $this->saddress = mod_param('show_address', $param); $this->semail = mod_param('show_email', $param); $this->sjob = mod_param('show_job', $param); $this->slinks = mod_param('show_links', $param); $this->sphone = mod_param('show_phone', $param); $this->sphoto = $sphoto = mod_param('show_photo', $param); $groupId = app_param('id'); $whereCat = "AND group_id = {$id}"; $sql = $db->select(FDBPrefix . 'contact', '*', 'status = 1 AND group_id=' . $id); $qr = @mysql_fetch_array($sql); if (empty($qr['id'])) { echo "<h3>Opps, Contact group is empty!"; } else { loadPaging(); $paging = new paging(); $rowsPerPage = $per_page; $result = $paging->pagerQuery(FDBPrefix . 'contact', "*", "status=1 {$whereCat}", 'id ASC', $rowsPerPage); $no = 0; $sum = mysql_affected_rows(); while ($qr = mysql_fetch_array($result)) { $group = oneQuery('contact_group', 'id', $qr['group_id'], 'name'); $vlink = "?app=contact&view=person&id={$qr['id']}"; $link = make_permalink($vlink, Page_ID); $title = "<a href=\"{$link}\">{$qr['name']}</a>"; if (empty($read_more)) { $read_more = "read more..."; } $readmore = "<a href=\"{$link}\"class='readmore'>{$read_more}</a>"; $comment = FQuery('comment', "link='{$vlink}'AND status=1"); $name = "<a href='{$link}'>{$qr['name']}</a>"; if ($sphoto == 1 and !empty($qr['photo'])) { $photo = "<img src=\"{$qr['photo']}\" width=\"150px\">"; } if (!empty($qr['email'])) { $email = "<a href='mailto:{$qr['email']}' title=\"send mail to {$qr['name']}\">{$qr['email']}</a>"; } else { $email = ""; } if (!empty($qr['photo'])) { $photo = "<img src='{$qr['photo']}' title=\"{$qr['name']}'s contact photo\" />"; } if (!empty($qr['tw'])) { $tw = " <a href='http://twitter.com/{$qr['tw']}' title=\"follow {$qr['name']} on twitter\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/tw.png'></a>"; } if (!empty($qr['fb'])) { $fb = " <a href='http://facebook.com/{$qr['fb']}' title=\"find {$qr['name']} on facebook\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/fb.png'></a>"; } if (!empty($qr['web'])) { $web = " <a href='http://{$qr['web']}' title=\"visit {$qr['name']}'s website\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/web.png'></a>"; } if (!empty($qr['ym'])) { $ym = " <a href='ymsgr:sendIM?{$qr['ym']}' title=\"chat with {$qr['name']} via YahooMasangger\"><img src='" . FUrl . "apps/app_contact/theme/images/ym.png'></a>"; } if (isset($ym) or isset($fb) or isset($tw) or isset($web)) { $links = $ym . $fb . $tw . $web; } else { $links = ''; } $this->perrows = $sum; $this->name[$no] = $name; $this->photo[$no] = $photo; $this->group[$no] = $group; $this->gender[$no] = $qr['gender']; $this->address[$no] = $qr['city'] . ", " . $qr['country']; $this->email[$no] = @$qr['email']; $this->job[$no] = $qr['job']; $this->links[$no] = $links; $this->phone[$no] = $qr['phone']; $this->fax[$no] = $qr['fax']; $this->per_page = $per_page; $ym = $fb = $tw = $web = null; //reset $link variable; if (defined('SEF_URL')) { $link = link_paging('?'); } else { $link = "?app=contact&view=group&id={$groupId}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } $no++; } $db->select(FDBPrefix . 'contact', '*', "status=1 {$whereCat}"); $jml = mysql_affected_rows(); if ($jml > $rowsPerPage) { $pagelink = $paging->createPaging($link); } else { $pagelink = null; } $this->pagelink = $pagelink; } }
* @license GNU/GPL, see LICENSE.txt * @description **/ defined('_FINDEX_') or die('Access Denied!'); $id = app_param('id'); $view = app_param('view'); $format = menu_param('format'); if ($format != 'blog' and $format != 'list') { $format = 'default'; } switch ($view) { case 'featured': require "apps/app_article/view/featured.php"; break; case 'archives': require "apps/app_article/view/default.php"; break; case 'category': require "apps/app_article/view/category.php"; break; case 'item': require "apps/app_article/view/item.php"; break; default: if (app_param('tag') != null) { require "apps/app_article/view/tag.php"; } else { echo "<h3>Opps, Articles you are looking for is not available! <Opps</h3>"; } break; }
$pdf = new pdf(); $pdf->category(app_param('label'), Page_ID, 1); if (isset($pdf->category)) { $category = $pdf->category; $catlink = $pdf->catlink; $text = $pdf->desc; $pagelink = $pdf->pglink; $link = $pdf->link; $perrows = $pdf->perrows; $author = $pdf->author; $title = $pdf->title; $title = $pdf->title; $labels = $pdf->labels; $hits = $pdf->hits; $date = $pdf->date; $label = ucfirst(app_param('label')); if ($title) { if (!empty($label)) { echo "<h1 class='title'>{$label}</h1>"; } else { if (defined('Apps_Title')) { echo "<h1 class='title'>" . Apps_Title . "</h1>"; } else { echo "<h1>pdf<h1>"; } } ?> <div id="pdf-default"> <?php for ($i = 0; $i < $perrows; $i++) { ?>
* @copyright Copyright (C) 2012 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt */ defined('_FINDEX_') or die('Access Denied'); $height = mod_param('height', $modParam); $thumbW = mod_param('thumbW', $modParam); $thumbH = mod_param('thumbH', $modParam); $limit = mod_param('limit', $modParam); $limitd = mod_param('limit', $modParam) + 10; $filter = mod_param('filter', $modParam); $cat = mod_param('cat', $modParam); $showImg = mod_param('showImg', $modParam); $db = new FQuery(); $db->connect(); $level = Level_Access; if (app_param() == 'article') { $t = @articleInfo($filter); $t = str_replace("'", '', $t); $t = str_replace('"', '', $t); $t = str_replace('%', '', $t); $t = str_replace('?', '', $t); $q = explode(" ", $t); $z = $c = ''; foreach ($q as $idx => $qry) { if ($idx != 0) { $z .= '+'; } $z .= "{$qry}"; } $z = "`article` LIKE '%{$z}%'"; $cat = explode(",", $cat);
$auto = oneQuery('comment_setting', 'name', "'auto_submit'", 'value'); if ($auto == 0) { if ($_SESSION['USER_LEVEL'] == 1 or $_SESSION['USER_LEVEL'] == 2) { $auto = 1; } else { $auto = null; } } $no = null; $_POST['web'] = str_replace("<", "<", $_POST['web']); $_POST['web'] = str_replace(">", ">", $_POST['web']); $_POST['web'] = str_replace(" ", "", $_POST['web']); $_POST['web'] = str_replace(" ", "", $_POST['web']); $text = htmlentities($_POST['com']); $parent = 1; $apps = app_param(); $com = $db->insert(FDBPrefix . 'comment', array("", "{$link}", $_SESSION['USER_ID'], "{$_POST['name']}", "{$_POST['email']}", "{$_POST['web']}", date("Y-m-d H:i:s", time()), "{$text}", "{$auto}", "{$apps}", "{$parent}", "{$parent}", "{$parent}")); if ($com and $auto) { $notice = alert("info", comment_Notice_Info, true); } else { $notice = alert("info", comment_Notice_Info2, true); } if (empty($no)) { $no = 1; } //Comment will appear after page reload $link = "{$go_link}#comment-{$no}"; } } } else { $notice = alert("error", comment_Notice_Error5, true);
function category($type, $id = null, $format = null) { $link = null; /* Set global parameter */ $show_panel = menu_param('show_panel', Page_ID); $show_rss = menu_param('show_rss', Page_ID); $read_more = menu_param('read_more', Page_ID); $per_page = menu_param('per_page', Page_ID); $intro = menu_param('intro', Page_ID); if (empty($intro)) { $intro = $per_page; } /* Set Access_Level */ $accessLevel = Level_Access; if ($type == 'archives') { $where = "status=1"; } else { if ($type == 'category') { $catName = categoryInfo('name', $id); $catDesc = categoryInfo('description', $id); $catLink = categoryLink($id); $where = "status=1 AND category = {$id}"; } else { if ($type == 'featured') { $where = "status=1 AND featured = 1"; } else { if ($type == 'tag') { if (empty($per_page)) { $per_page = 10; } $tag = app_param('tag'); $tag = str_replace("-", " ", $tag); $where = "status=1 AND tags LIKE '%" . $tag . "%'"; } } } } if (_FEED_ == 'rss') { $per_page = 20; $pages = url_param('page'); if ($pages != null) { $link = str_replace("?page={$pages}", "", getUrl()); redirect("{$link}?feed=rss"); } } loadPaging(); $paging = new paging(); $result = $paging->pagerQuery(FDBPrefix . 'article', "*,\n\t\tDATE_FORMAT(date,'%d %M %Y') as date,\n\t\tDATE_FORMAT(date,'%Y-%m-%d %H:%i:%s') as order_date,\n\t\tDATE_FORMAT(date,'%a, %m %d %Y %H:%i:%s') as time,\n\t\tDATE_FORMAT(date,'%d') as f,\n\t\tDATE_FORMAT(date,'%D') as d,\n\t\tDATE_FORMAT(date,'%b') as b,\n\t\tDATE_FORMAT(date,'%a') as a,\n\t\tDATE_FORMAT(date,'%W') as D,\n\t\tDATE_FORMAT(date,'%m') as n,\n\t\tDATE_FORMAT(date,'%M') as m,\n\t\tDATE_FORMAT(date,'%y') as y,\n\t\tDATE_FORMAT(date,'%Y') as Y,\n\t\tDATE_FORMAT(date,'%h') as h,\n\t\tDATE_FORMAT(date,'%H') as H,\n\t\tDATE_FORMAT(date,'%p') as p,\n\t\tDATE_FORMAT(date,'%i') as i,\n\t\tDATE_FORMAT(date,'%s') as s", "{$where} {$accessLevel}", 'order_date DESC', $per_page); $no = 0; $perrows = mysql_affected_rows(); while ($qr = mysql_fetch_array($result)) { /* Category Details */ $catLinks = categoryLink($qr['category']); $category = categoryInfo('name', $qr['category']); $catHref = "<a href='{$catLinks}'>{$category}</a>"; /* Author */ if (empty($qr['author'])) { $author = userInfo('name', 1); } else { $author = $qr['author']; } /* Article Links */ $link = "?app=article&view=item&id={$qr['id']}"; $vlink = str_replace("&", "&", $link); $vlink = make_permalink($vlink); /* Article Title */ $title = "<a href='{$vlink}'>{$qr['title']}</a>"; $link = make_permalink($link); /* Article Tags */ $tags = tagToLink($qr['tags']); /* Article Content */ $article = $qr['article']; if (checkLocalhost()) { $article = str_replace(FLocal . "media/", "media/", $article); $article = str_replace("/media/", FUrl . "media/", $article); } $comment = null; /* Article Comments */ $comm = FQuery('comment', "link='{$link}'AND status=1"); if (FQuery('apps', "folder='app_comment'")) { $comment = "<a class='send-comment' href='{$link}#comment'>"; if ($comm > 1) { $comment .= "<span>{$comm}</span> " . Comments; } if ($comm == 1) { $comment .= "<span>{$comm}</span> " . Comment; } if ($comm < 1) { $comment .= Send_Comment; } $comment .= "</a>"; } $scomment = mod_param('show_comment', articleInfo('parameter', $qr['id'])); if (!$scomment) { $comment = ''; } /* Read More */ if (empty($read_more)) { $read_more = Readmore; } $readmore = "<a href='{$link}' class='readmore'>{$read_more}</a> {$comment}"; /* Intro limit (read more) */ $content = $article; /* Blog Style */ if ($format == 'blog' or $type == 'tag' or $format == 'list') { $image = articleImage($content); $image = str_replace("/media", "/media/.thumbs", $image); $imgH = menu_param('imgH', Page_ID); $imgW = menu_param('imgW', Page_ID); $this->image[$no] = $image; $this->imgH = $imgH; $this->imgW = $imgW; $content = preg_replace("/<img[^>]+\\>/i", "", $content); } $content = articleIntro($content); $panel = menu_param('panel_format', Page_ID); $fpanel = "#" . menu_param('panel_format', Page_ID); $dpanel = str_replace('%rel', "", $fpanel); if (empty($panel) or !strpos($dpanel, '%')) { if (siteConfig('lang') == 'id') { $panel = "<b>%A</b> · %f %m %Y · %c"; } else { $panel = "%m, %f %Y · <b>%A</b> · %c"; } } $panel = str_replace('%A', $author, $panel); $panel = str_replace('%c', "{$catHref}", $panel); $panel = str_replace('%h', $qr['hits'], $panel); $timeRel = dateRelative($qr['H'], $qr['i'], $qr['s'], $qr['n'], $qr['f'], $qr['Y']); if ($timeRel and strpos($fpanel, '%rel')) { $panel = str_replace(', ', "", $panel); $panel = str_replace('%d', "", $panel); $panel = str_replace('%f', "{$timeRel}", $panel); $panel = str_replace('%m', "", $panel); $panel = str_replace('%n', "", $panel); $panel = str_replace('%y', "", $panel); $panel = str_replace('%Y', "", $panel); $panel = str_replace('%H', "", $panel); $panel = str_replace('%h', "", $panel); $panel = str_replace('%i', "", $panel); $panel = str_replace('%s', "", $panel); $panel = str_replace('%p', "", $panel); if (strlen($panel) < 3) { $panel = $timeRel; } } else { if (siteConfig('lang') == 'id') { $panel = str_replace('%f', $qr['f'], $panel); } else { $panel = str_replace('%f', $qr['d'], $panel); } $panel = str_replace("%rel", $panel, $panel); $panel = str_replace('%d', $qr['d'], $panel); $panel = str_replace('%a', $qr['a'], $panel); $panel = str_replace('%b', $qr['b'], $panel); $panel = str_replace('%m', $qr['m'], $panel); $panel = str_replace('%n', $qr['n'], $panel); $panel = str_replace('%y', $qr['y'], $panel); $panel = str_replace('%Y', $qr['Y'], $panel); $panel = str_replace('%H', $qr['H'], $panel); $panel = str_replace('%h', $qr['h'], $panel); $panel = str_replace('%i', $qr['i'], $panel); $panel = str_replace('%s', $qr['s'], $panel); $panel = str_replace('%p', $qr['p'], $panel); } $panel = str_replace('*', "", $panel); /* RSS Feed */ $this->perrows = $perrows; $this->intro = $intro; $this->show_rss = $show_rss; $this->show_panel = $show_panel; $this->panel[$no] = $panel; $this->category[$no] = $category; $this->catlink[$no] = $catLinks; $this->readmore[$no] = $readmore; $this->comment[$no] = $comment; $this->author[$no] = $author; $this->title[$no] = $title; $this->link[$no] = $link; $this->tags[$no] = $tags; $this->ftime[$no] = $qr['time']; $this->hits[$no] = $qr['hits']; $this->desc[$no] = clearXMLString("{$content}"); $this->ftitle[$no] = clearXMLString($qr['title']); $this->content[$no] = $content; if (defined('SEF_URL')) { $link = link_paging('?'); if (strpos(getUrl(), '&') > 0) { $link = link_paging('&'); } } else { if (checkhomepage()) { $link = "?"; } else { if (!url_param('id')) { $tag = app_param('tag'); $link = "?app=article&tag={$tag}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } else { $link = "?app=article&view=category&id={$categoryId}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } } } $no++; } // pageLink $this->pglink = $paging->createPaging($link); // rssLink if ($type == 'tag') { $tag = str_replace(" ", "-", $tag); $rssLink = "?app=article&tag={$tag}&feed=rss"; } else { if ($type == 'category') { $rssLink = "?app=article&view=category&id={$id}&feed=rss"; } else { $rssLink = "?app=article&view=archives&feed=rss"; } } if (_FEED_ == 'rss') { $rssLink = make_permalink($rssLink); $this->rssTitle = @clearXMLString(SiteTitle); $categoryLink = @clearXMLString($rssLink); $categoryLink = str_replace(".xml", "", $categoryLink); $this->rssLink = $categoryLink; $this->rssDesc = @$categoryDesc; } else { $this->rssLink = make_permalink($rssLink); } }