Esempio n. 1
0
function menu_param($value, $id = null)
{
    if (empty($id) and defined('Page_ID')) {
        $id = Page_ID;
    }
    $param = oneQuery('menu', 'id', $id, 'parameter');
    return mod_param("{$value}", $param);
}
Esempio n. 2
0
function pdfParameter($value)
{
    $menu_id = Page_ID;
    $param = pageInfo($menu_id, 'parameter');
    $param = mod_param($value, $param);
    return 1;
}
Esempio n. 3
0
/**
* @name			Module Statistic
* @version		2.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2014 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
*/
defined('_FINDEX_') or die('Access Denied');
$td = mod_param('today', $modParam);
$yd = mod_param('yesterday', $modParam);
$tw = mod_param('thisweek', $modParam);
$lw = mod_param('lastweek', $modParam);
$tm = mod_param('thismonth', $modParam);
$lm = mod_param('lastmonth', $modParam);
$tg = mod_param('all', $modParam);
$info = mod_param('info', $modParam);
require_once "mod_system.php";
?>

<table style="margin-bottom: 0; width: 100%">
	<tbody>
		<?php 
if ($td) {
    ?>
		<tr>
			<td style="width: 70%">
				<img src="<?php 
    echo FUrl;
    ?>
modules/mod_statistic/images/flag_green.png" alt="flag" width="16" height="16"> Hari Ini</td>
			<td style="text-align:right"><?php 
Esempio n. 4
0
        notice('error', Please_Select_Item);
        redirect(getUrl());
    }
}
/****************************************/
/*	 Redirect when Article-Id invalid	*/
/****************************************/
if (!isset($_POST['save_edit']) and !isset($_POST['apply_edit'])) {
    if (!isset($_REQUEST['view']) and isset($_REQUEST['act'])) {
        if ($_REQUEST['act'] == 'edit') {
            $id = $_REQUEST['id'];
            $level = USER_LEVEL;
            $db = new FQuery();
            $sql = $db->select(FDBPrefix . "article", "*", "id={$id}");
            $row = mysql_fetch_array($sql);
            $edlvl = mod_param('editor_level', $row['parameter']);
            if (!$row['id'] or $level > $row['level'] or !empty($edlvl) and $level > $edlvl) {
                redirect('?app=article');
            }
        }
    }
}
/****************************************/
/*	 	   Sub Article Category			*/
/****************************************/
// membuat fungsi sub-article yang akan di tampilkan dibawah parent_id
function sub_article($parent_id, $nos, $pre = null)
{
    $db = new FQuery();
    $db->connect();
    $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id}");
Esempio n. 5
0
<?php

/**
* @version		2.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
*/
defined('_FINDEX_') or die('Access Denied');
$type = mod_param("type", modParam);
$category = mod_param("category", modParam);
$sub_menu = mod_param("sub_menu", modParam);
$sub_title = mod_param("sub_title", modParam);
if ($type == 1) {
    $tipe1 = "selected";
}
if ($type == 2) {
    $tipe2 = "selected";
}
if ($sub_menu == 1) {
    $sub1 = "selected";
}
if ($sub_menu == 0) {
    $sub2 = "selected";
}
if ($sub_title == 1) {
    $sut1 = "selected";
}
if ($sub_title == 0) {
    $sut2 = "selected";
}
Esempio n. 6
0
<?php

/**
* @version		Beta 1.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2011 Fiyo CMS.
* @license		GNU/GPL, see liCENSE.php
* @description	Simple Module banner for Fiyo CMS
**/
$show_panel = mod_param(show_panel, $qr[parameter]);
$read_more = mod_param(read_more, $qr[parameter]);
$per_page = mod_param(per_page, $qr[parameter]);
$view = link_param(view, $qr[link]);
$id = link_param(id, $qr[link]);
if ($view == 'category') {
    $view2 = 'selected';
}
if ($view == 'item') {
    $view3 = 'selected';
}
if ($show_panel == 1) {
    $panel1 = "checked";
}
if ($show_panel == 0) {
    $panel2 = "checked";
}
if (!$per_page) {
    $per_page = 5;
}
?>
<script type="text/javascript">
Esempio n. 7
0
/**
* @version		2.0
* @package		Fi Comments
* @copyright	Copyright (C) 2014 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
* @description	
**/
defined('_FINDEX_') or die('Access Denied');
$param1 = mod_param('name', modParam);
$param2 = mod_param('gravatar', modParam);
$param3 = mod_param('title', modParam);
$param4 = mod_param('comment', modParam);
$param5 = mod_param('date', modParam);
$param6 = mod_param('text', modParam);
$param7 = mod_param('item', modParam);
if ($param6 == "" or empty($param6)) {
    $param6 = 100;
}
if ($param7 == "" or empty($param7)) {
    $param7 = 5;
}
if ($param1) {
    $enpar1 = "selected checked";
    $dispar1 = "";
} else {
    $dispar1 = "selected checked";
    $enpar1 = "";
}
if ($param2) {
    $enpar2 = "selected checked";
Esempio n. 8
0
<?php

/**
* @version		1.5.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$cat = mod_param('cat', $modParam);
$end = mod_param('end', $modParam);
$start = mod_param('start', $modParam);
if (!$cat) {
    echo "Error::please set up your <b>Article Archive</b> module!";
} else {
    if (!$start) {
        $start = "1000-1-1";
    }
    if (!$end) {
        $end = date("Y-m-d");
    }
    $cats = explode(",", "{$cat}");
    $coma = substr_count("{$cat}", ",");
    $no = 1;
    $catx = $cato = '';
    foreach ($cats as $p) {
        if ($no != $coma + 1) {
            $cato = "category={$p} or ";
        } else {
            $cato = "category={$p}";
        }
Esempio n. 9
0
 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;
     }
 }
Esempio n. 10
0
<?php

/**
* @version		1.4.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$category = mod_param("category", $modParam);
$sub_title = mod_param("sub_title", $modParam);
$sub_menu = mod_param("sub_menu", $modParam);
$type_menu = mod_param("type", $modParam);
require_once "mod_system.php";
switch ($type_menu) {
    case 1:
        include "type/row_style.php";
        break;
    case 2:
        include "type/list_style.php";
        break;
}
Esempio n. 11
0
     $stat1 = "";
     $enable = 'disable';
 }
 /* logika frontpages */
 /* logika status aktif atau tidak */
 if ($aRow['featured'] == 1) {
     $fp1 = "selected";
     $fp2 = "";
     $featured = 'featured star';
 } else {
     $fp2 = "selected";
     $fp1 = "";
     $featured = 'not';
 }
 $title = $aRow['title'];
 $editor_level = mod_param('editor_level', $aRow['parameter']);
 if ($_SESSION['USER_LEVEL'] == 1 or $_SESSION['USER_ID'] == $aRow['author_id'] and $aRow['author_id'] != 0 or ($_SESSION['USER_LEVEL'] <= $editor_level or empty($editor_level) and $_SESSION['USER_LEVEL'] <= 3)) {
     $checkbox = "<label><input type='checkbox' data-name='rad-{$aRow['id']}' name='check[]' value='{$aRow['id']}' rel='ck' ><span class='input-check'></span></label>";
     $name = "<a class='tips' title='" . Edit . "' href='?app=article&act=edit&id={$aRow['id']}' target='_self' data-placement='right'>{$title}</a>";
     $status = "<span class='invisible'>{$enable}</span>\n\t\t\t\t<div class='switch s-icon activator editor'>\n\t\t\t\t\t<label class='cb-enable {$stat1} tips' data-placement='right' title='" . Disable . "'><span>\n\t\t\t\t\t<i class='icon-remove-sign'></i></span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2} tips' data-placement='right' title='" . Enable . "'><span>\n\t\t\t\t\t<i class='icon-ok-sign'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$aRow['id']}' class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$aRow['status']}'  class='type invisible'>\n\t\t\t\t</div>";
     $featured = "\n\t\t\t\t<div class='switch s-icon featured editor'><span class='invisible'>{$featured}</span>\n\t\t\t\t\t<label class='cb-enable {$fp1} tips' data-placement='left' title='" . Unfeatured . "'><span>\n\t\t\t\t\t<i class='icon-star'></i>\n\t\t\t\t\t</span></label>\n\t\t\t\t\t<label class='cb-disable {$fp2} tips' data-placement='left' title='" . Featured . "'><span>\n\t\t\t\t\t<i class='icon-star'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$aRow['id']}'  class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$aRow['featured']}' class='type invisible'>\n\t\t\t\t</div>";
 } else {
     $name = $title;
     $checkbox = "<span class='icon lock'></lock>";
     $status = "<span class='invisible'>{$enable}</span>\n\t\t\t\t<div class='switch s-icon activator help'>\n\t\t\t\t\t<label class='cb-enable {$stat1} tips' data-placement='right' title='" . Disable . "'><span>\n\t\t\t\t\t<i class='icon-remove-sign'></i></span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2} tips' data-placement='right' title='" . Enable . "'><span>\n\t\t\t\t\t<i class='icon-ok-sign'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$aRow['id']}' class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$aRow['status']}'  class='type invisible'>\n\t\t\t\t</div>";
     $featured = "\n\t\t\t\t<div class='switch s-icon featured help'><span class='invisible'>{$featured}</span>\n\t\t\t\t\t<label class='cb-enable {$fp1} tips' data-placement='left' title='" . Unfeatured . "'><span>\n\t\t\t\t\t<i class='icon-star'></i>\n\t\t\t\t\t</span></label>\n\t\t\t\t\t<label class='cb-disable {$fp2} tips' data-placement='left' title='" . Featured . "'><span>\n\t\t\t\t\t<i class='icon-star'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$aRow['id']}'  class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$aRow['featured']}' class='type invisible'>\n\t\t\t\t</div>";
 }
 if ($i == 0) {
     $row[] = $checkbox;
 } else {
     if ($i == 1) {
Esempio n. 12
0
<?php

/**
* @version		2.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2014 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.
**/
defined('_FINDEX_') or die('Access Denied');
$type = mod_param('type', modParam);
$item = mod_param('item', modParam);
$info = mod_param('info', modParam);
$other = mod_param('other', modParam);
$value = mod_param('value', modParam);
$filter = mod_param('filter', modParam);
if ($item == "" or empty($item)) {
    $item = 5;
}
if ($type == 1) {
    $a1 = "selected";
}
if ($type == 2) {
    $a2 = "selected";
}
if ($type == 3) {
    $a3 = "selected";
}
$filter1 = $filter2 = $filter3 = "";
if ($filter == 1) {
    $b1 = "selected";
    $filter1 = "name='param3'";
Esempio n. 13
0
/**
* @name			Module Statistic
* @version		1.5.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
*/
defined('_FINDEX_') or die('Access Denied');
$param1 = mod_param('today', modParam);
$param2 = mod_param('yesterday', modParam);
$param3 = mod_param('thisweek', modParam);
$param4 = mod_param('lastweek', modParam);
$param5 = mod_param('thismonth', modParam);
$param6 = mod_param('lastmonth', modParam);
$param7 = mod_param('all', modParam);
$param8 = mod_param('info', modParam);
?>

<script type="text/javascript">
$(document).ready( function(){ 
	$(".cb-enable").click(function(){
		var parent = $(this).parents('.switch');
		$('.cb-disable',parent).removeClass('selected');
		$(this).addClass('selected');
	});
	$(".cb-disable").click(function(){
		var parent = $(this).parents('.switch');
		$('.cb-enable',parent).removeClass('selected');
		$(this).addClass('selected');
	});
});
Esempio n. 14
0
    if ($read) {
        $read = $_POST['url'] . $read;
    } else {
        $read = $_POST['url'] . "?app=article&view=item&id={$qr['id']}";
    }
    $edit = "?app=article&act=edit&id={$qr['id']}";
    $auth = userInfo("name", "{$qr['author_id']}");
    $info = "{$qr['date']}";
    $read_article = Read;
    $edit_article = Edit;
    if ($no % 2 == 0) {
        $class = 'clr';
    } else {
        $class = 'cln';
    }
    echo "<tr><td class='no-tabs'>#{$no}</td><td width='100%'>{$qr['title']}\n\t\t\t<div class='tool-box'>\n\t\t\t\t<a href='{$read}' target='_blank'  class='btn btn-tools tips' title='{$read_article}'>{$read_article}</a>";
    $editor_level = mod_param('editor_level', $qr['parameter']);
    if ($editor_level >= USER_LEVEL or empty($editor_level)) {
        echo "<a href='{$edit}' class='btn btn-tools tips' title='{$edit_article}'>{$edit_article}</a>";
    }
    echo "</div>\t\t\t\n\t\t\t</td></tr>";
    $no++;
}
if (mysql_affected_rows() < 1) {
    echo "<tr><td style='text-align:center; padding: 40px 0; color: #ccc; font-size: 1.5em'>" . No_Article . "</td></tr>";
}
?>
				
       </tbody>			
</table>
<script>$(function() {$('.tooltips').tooltip();});</script>
Esempio n. 15
0
            }
            $vo1 = $vo + 1;
            $param = $qrs['parameter'];
            $pva = strpos($param, "rate_value={$va}");
            if ($pva) {
                $param = str_replace("rate_value={$va}", "rate_value={$rating}", $param);
            } else {
                $param .= "rate_value={$rating}" . ";\n";
            }
            $pvo = strpos($param, "rate_counter={$vo}");
            if ($pvo) {
                $param = str_replace("rate_counter={$vo}", "rate_counter={$vo1}", $param);
            } else {
                $param .= "rate_counter={$vo1}" . ";\n";
            }
            $param = strip_tags($param);
            $qr = $db->update(FDBPrefix . 'article', array("parameter" => "{$param}"), "id={$id}");
            if ($qr) {
                $_SESSION["article_rate_{$id}"] = true;
            }
        } else {
            if ($_POST['do'] == 'getrate') {
                // get rating
                $va = mod_param('rate_value', $qrs['parameter']);
                $vo = mod_param('rate_counter', $qrs['parameter']);
                $rating = @round($va / $vo, 1) * 20;
                echo $rating;
            }
        }
    }
}
Esempio n. 16
0
<?php

/**
* @version		2.0
* @package		Comments
* @copyright	Copyright (C) 2014 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$name = mod_param('name', $modParam);
$date = mod_param('date', $modParam);
$text = mod_param('text', $modParam);
$item = mod_param('item', $modParam);
$title = mod_param('title', $modParam);
$scomment = mod_param('comment', $modParam);
$gravatar = mod_param('gravatar', $modParam);
if ($item == "" or empty($item)) {
    $item = 5;
}
$db = new FQuery();
$db->connect();
$sql = $db->select(FDBPrefix . 'comment', '*', "status=1", "date DESC");
$no = 0;
while ($com = mysql_fetch_array($sql) and $no < $item) {
    $email = strtolower($com['email']);
    $email = md5($email);
    $img = "<span class='mod-gravatar' data-gravatar-hash='{$email}'></span>";
    if ($com['user_id'] == 1 or $com['user_id'] == 2) {
        $s = " admin-comment";
    } else {
        $s = "";
Esempio n. 17
0
<?php

/**
* @version		1.5.0
* @package		Article Related
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$type = mod_param('type', $modParam);
switch ($type) {
    case 'category':
        require "type/category.php";
        break;
    default:
        require "type/default.php";
}
@(include_once 'js.php');
Esempio n. 18
0
/**
* @version		1.5.0
* @package		Article Tags
* @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();
$level = Level_Access;
$tags = '';
$sql = $db->select(FDBPrefix . "article", 'tags', "status = 1 AND tags != '' {$level}", "RAND() LIMIT 50");
while ($tag = mysql_fetch_array($sql)) {
    $tags .= $tag['tags'] . ",";
}
$tagz = explode(",", $tags);
sort($tagz);
$tags = $tagb = null;
foreach ($tagz as $tag) {
    $size = rand(1, 4);
    $link = str_replace(" ", "-", "?app=article&tag={$tag}");
    $link = make_permalink($link);
    $ltag = strtolower($tag);
Esempio n. 19
0
 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&amp;view=item&amp;id={$qr['id']}";
         $vlink = str_replace("&amp;", "&", $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> &#183; %f %m %Y &#183; %c";
             } else {
                 $panel = "%m, %f %Y &#183; <b>%A</b> &#183; %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 . "&amp;";
                 } else {
                     $link = "?app=article&view=category&id={$categoryId}";
                     $link = make_permalink($link, Page_ID);
                     $link = $link . "&amp;";
                 }
             }
         }
         $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);
     }
 }