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'); } } }
function option_sub_cat($parent_id, $cat, $pre) { $db = new FQuery(); $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id} AND id!={$_REQUEST['id']}"); while ($qr = mysql_fetch_array($sql)) { $s = multipleSelected($cat, $qr['id']); echo "<option value='{$qr['id']}' {$s}>{$pre} |_ {$qr['name']}</option>"; option_sub_cat($qr['id'], $cat, $pre . " "); } }
function valmonth($x) { $x = substr($x, 0, 7); $val = 0; $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'statistic', '*'); while ($qr = mysql_fetch_array($sql)) { $month = substr($qr['time'], 0, 7); if ($month == $x) { $val++; } } return $val; }
function option_sub_menu($parent_id, $sub = NULL, $pre) { $db = new FQuery(); $db->connect(); if ($_POST['id']) { $eid = "AND id!={$_POST['id']}"; } else { $eid = ''; } $sql = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id} {$eid}"); while ($qr = mysql_fetch_array($sql)) { if ($sub == $qr['id']) { $s = "selected"; } else { $s = ""; } echo "<option value='{$qr['id']}' {$s}>{$pre}|_ {$qr['name']}</option>"; option_sub_menu($qr['id'], $sub, $pre . " "); } }
<tr> <th style="width:1% !important;" class="no" colspan="0" id="ck"> <input type="checkbox" id="checkall" target="check_tag[]"></th> <th style="width:89% !important;"><?php echo Tags; ?> </th> <th style="width:10% !important; text-align:center"><?php echo Hits; ?> </th> </tr> </thead> <tbody> <?php $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'article_tags'); $no = 1; while ($qr = mysql_fetch_array($sql)) { $checkbox = "<input type='checkbox' data-name='rad-{$qr['id']}' sub-target='.sub-menu' name='check_tag[]' value='{$qr['id']}' rel='ck'>"; $name = "<a class='tips' title='" . Edit . "' data-placement='right' href='?app=article&view=tag&act=edit&id={$qr['id']}'>{$qr['name']}</a>"; echo "<tr>"; echo "<td align='center'>{$checkbox}</td><td>{$name}</td><td align='center'>{$qr['hits']}</td>"; echo "</tr>"; $no++; } ?> </tbody> </table> </form>
" style="min-width: 83.5%" size="18"></td> </tr> <tr> <td class="row-title" title="<?php echo Editor_level_tip; ?> " style="width:30%"><?php echo Editor_Level; ?> </td> <td><select name="param12" placeholder=""> <option value=""></option> <?php $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'user_group', '*', 'level >= ' . USER_LEVEL); while ($qrs = mysql_fetch_array($sql)) { if ($qrs['level'] == 3 and !$editor_level) { echo "<option value='{$qrs['level']}' selected>{$qrs['group_name']}</option>"; } else { if ($qrs['level'] == $editor_level) { echo "<option value='{$qrs['level']}' selected>{$qrs['group_name']}</option>"; } else { echo "<option value='{$qrs['level']}'>{$qrs['group_name']}</option>"; } } } ?> </select> </td> </tr>
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'setting', '*', "name='site_theme'"); $qr_themes = mysql_fetch_array($sql); $dir = opendir("../themes"); $no = 0; ?> <script type="text/javascript"> $(function() { $( ".count" ).html($(".col-theme:visible" ).length); $("#search").keyup(function(){ var v = $(this).val().toLowerCase(); $(".col-theme:contains("+v+")" ).css( "display", "block" ); $('.col-theme:not(:contains('+v+'))').hide(); $( ".count" ).html($(".col-theme:visible" ).length); }); $(".theme-btn").click(function(){ var vl = $(this); var value = vl.data('name'); $.ajax({ url: "apps/app_theme/controller/status.php",
* @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 = ""; } echo "<div class='inner-comment{$s}'>"; if ($gravatar) { echo "<div class='mod-avatar-comment'>{$img}</div>"; echo "<div class='mod-right-comment'>"; } else {
function option_sub_menu($parent_id, $sub = null, $pre = null, $page) { $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id}"); while ($qr = mysql_fetch_array($sql)) { $sel = multipleSelected($page, $qr['id']); if ($sel == 'selected') { $sel = "class='active' checked"; } $check = "<input {$sel} type='checkbox' name='page[]' value='{$qr['id']}' rel='ck'>"; echo "<li value='{$qr['id']}' {$sel}>{$pre} |_ {$check} {$qr['name']}</li>"; option_sub_menu($qr['id'], $sub + 1, " " . $pre . " ", $page); } }
function option_sub_cat($parent_id, $pre) { $db = new FQuery(); $db->connect(); if (!isset($_REQUEST['id']) or $_REQUEST['act'] == 'add') { $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id}"); } else { $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id} AND id != {$_REQUEST['id']}"); } while ($qr = @mysql_fetch_array($sql)) { if ($qr['level'] >= $_SESSION['USER_LEVEL']) { $scat = $pcat = 0; if (isset($_REQUEST['id'])) { $scat = oneQuery('article', 'id', $_REQUEST['id'], 'category'); $pcat = oneQuery('article_category', 'id', $scat, 'parent_id'); } if ($pcat == $qr['id'] or $scat == $qr['id']) { $s = "selected"; } else { $s = ""; } echo "<option value='{$qr['id']}' {$s}>{$pre}|_ {$qr['name']}</option>"; option_sub_cat($qr['id'], $pre . " "); } } }
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); $db = new FQuery(); $db->connect(); $level = Level_Access; $sql = $db->select(FDBPrefix . 'menu_category', '*', "id={$_REQUEST['id']} {$level}"); $qr = mysql_fetch_array($sql); if (!$qr) { redirect('index.php'); } ?> <form method="post" id="form"> <div id="app_header"> <div class="warp_app_header"> <div class="app_title"><?php echo Edit_Category; ?> </div> <div class="app_link"> <button class="btn btn-success save" title="<?php echo Save; ?> " name="apply_category" type="submit" value="Save" ><i class="icon-ok"></i> <?php echo Save;
/** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ if (!isset($_POST['user'])) { die('Access Denied!'); } session_start(); define('_FINDEX_', 1); require '../../../system/jscore.php'; $db = new FQuery(); $user = mysql_real_escape_string($_POST['user']); $sql = $db->select(FDBPrefix . "user", "*", "status=1 AND user='******' AND password='******'pass']) . "'"); $qr = mysql_fetch_array($sql); $jml = mysql_affected_rows(); if ($jml > 0) { $_SESSION['USER_ID'] = $qr['id']; $_SESSION['USER'] = $qr['user']; $_SESSION['USER_NAME'] = $qr['name']; $_SESSION['USER_EMAIL'] = $qr['email']; $_SESSION['USER_LEVEL'] = $qr['level']; $_SESSION['USER_LOG'] = $qr['time_log']; $time_log = date('Y-m-d H:i:s'); $db->update(FDBPrefix . 'user', array("time_log" => "{$time_log}"), "id={$qr['id']}"); $db->delete(FDBPrefix . "session_login", "user_id={$qr['id']}"); $qr = $db->insert(FDBPrefix . "session_login", array("{$qr['id']}", "{$qr['user']}", "{$qr['level']}", date('Y-m-d H:i:s'))); } if ($qr or !empty($_SESSION['USER_ID']) and $_SESSION['USER_LEVEL'] <= 3 and userInfo()) {
<option value='2' <?php echo @$view; ?> >Single Contact</option> </select> </td> </tr> <!-- Tipe tampilan menu --> <tr class="catok"> <td class="djudul" id="caton">Select Group</td> <td> <select id="cat"> <?php $db = new FQuery(); $db->connect(); $sql2 = $db->select(FDBPrefix . 'contact_group'); while ($qr2 = mysql_fetch_array($sql2)) { if ($id == $qr2['id']) { $s = 'selected'; } else { $s = ''; } echo "<option value='{$qr2['id']}' {$s}>{$qr2['name']}</option>"; } ?> </select> <input type="hidden" value="?app=contact&view=item&id=<?php echo $id; ?> " id="pgs" size="20" readonly />
function subsmenu($parent_id, $sub = null) { $db = new FQuery(); $db->connect(); if ($sub == 'apps') { $short = 'name ASC'; } else { $short = 'short ASC'; } $level = Level_Access; $menus = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id} AND status=1 {$level}", "{$short}"); $sum = mysql_affected_rows(); $no = 1; if (mysql_num_rows($menus) > 0) { echo "<ul class=\"sub-menu collapse\" id='nav-{$parent_id}'>"; while ($menu = mysql_fetch_array($menus)) { $link = @$menu['link']; $link = @$menu['link']; $subtitle = ''; $app = $menu['sub_name']; $a = ""; $l = substr(getUrl(), strpos(getUrl(), "?app=")); if ($l == $link) { $a = " active"; } if (empty($menu['class'])) { $menu['class'] = 'icon-double-angle-right'; } if ($menu['home'] == 0) { if ($menu['app'] == "sperator") { echo "<li class=\"{$a}\"><a href='#'><i class=\"{$menu['class']}\" style=\"{$menu['style']}\"></i> {$menu['name']}</a>"; subsmenu($menu['id']); echo "</li>"; } else { if ($menu['app'] == "link") { echo "<li class=\"{$a}\"><a href=\"{$link}\"><i class=\"{$menu['class']}\" style=\"{$menu['style']}\"></i> {$menu['name']}</a>"; subsmenu($menu['id']); echo "</li>"; } else { if (empty($menu['link'])) { $menu['link'] = "#"; } echo "<li class=\"{$a}\"><a href=\"{$link}\"><i class=\"{$menu['class']}\" style=\"{$menu['style']}\"></i> {$menu['name']}</a>"; subsmenu($menu['id']); echo "</li>"; } } } if ($app = 'menu' and $link == '?app=menu&view=add') { $level = Level_Access; $sql2 = $db->select(FDBPrefix . 'menu_category', "*", "id > 0 {$level}"); $sum = mysql_num_rows($sql2); $no = 1; while ($menu = mysql_fetch_array($sql2)) { $sump = FQuery("menu", "category='{$menu['category']}' AND home=1"); $summ = FQuery("menu", "category='{$menu['category']}'"); if ($sump) { $sump = "<span class='label label-danger home-label'>home</span>"; } else { $sump = ""; } echo "<li class='list-menu menu-{$menu['category']}'><a class='link' href='?app=menu&cat={$menu['category']}'><i class='icon-list-alt'></i>{$menu['title']}<span class='label label-primary'>{$summ}</span>{$sump}</a></li>"; $no++; } } } echo "</ul>"; } }
* @version 1.5.0 * @package Fiyo CMS * @copyright Copyright (C) 2012 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description **/ define('_FINDEX_', 1); require_once '../../../system/jscore.php'; $db = new FQuery(); $db->connect(); $act = $_POST['act']; switch ($act) { default: if (strlen($_POST['username']) < 4) { echo 2; } else { $sql = $db->select(FDBPrefix . 'user', '*', "user='******'username']}'"); $user = mysql_num_rows($sql); echo $user; } break; case 'email': if (!preg_match("/^.+@.+\\..+\$/", $_POST['email']) or substr_count($_POST['email'], "@") > 1) { echo 2; } else { $sql2 = $db->select(FDBPrefix . 'user', '*', "email='{$_POST['email']}'"); $email = mysql_num_rows($sql2); echo $email; } break; }
<option value='3' <?php echo $view3; ?> >Single Article</option> </select> </td> </tr> <!-- Tipe tampilan menu --> <tr class="catok invisible"> <td class="djudul" id="caton"></td> <td> <select id="cat" class="invisible"> <?php $db = new FQuery(); $db->connect(); $sql2 = $db->select(FDBPrefix . 'article_category'); while ($qr2 = mysql_fetch_array($sql2)) { if ($id == $qr2[id]) { $s = 'selected'; } else { $s = ''; } echo "<option value='{$qr2['id']}' {$s}>{$qr2['name']}</option>"; } $sql3 = $db->select(FDBPrefix . 'article', '*', "id={$id}"); $qr3 = mysql_fetch_array($sql3); ?> </select> <input type="hidden" value="?app=article&view=item&id=<?php echo $id;
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 Beta 1.0 * @package Fiyo CMS * @copyright Copyright (C) 2011 Fiyo CMS. * @license GNU/GPL, see liCENSE.php * @description mengolah data JQuery untuk mendapatkan nilai dari kategori **/ $cat = $_GET[cat]; $vw = $_GET[view]; require '../../config.php'; require '../../system/query.php'; $db = new FQuery(); $db->connect(); $db->select('app_store_category', '*', "id='{$cat}'"); $qr = $db->getResult(); echo "?app=app_store&cat={$qr['id']}&view={$vw}";
* @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt **/ define('_FINDEX_', 1); session_start(); if (!isset($_SESSION['USER_ID']) or !isset($_SESSION['USER_ID']) or $_SESSION['USER_LEVEL'] > 3 or !isset($_POST['url'])) { die; } require_once '../../../system/jscore.php'; ?> <table class="table tools"> <tbody> <?php $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . "article", "*,DATE_FORMAT(date,'%W, %b %d %Y') as dates", "", 'date DESC LIMIT 10'); $no = 1; while ($qr = mysql_fetch_array($sql)) { $read = check_permalink("link", "?app=article&view=item&id={$qr['id']}", "permalink"); 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';
function multipleDelete($table, $source, $item = null, $cat = null, $except = null, $sub = null) { $db = new FQuery(); $del = explode(",", $source); if (!isset($except)) { $except = null; } else { $except = $except; } if (!empty($cat)) { $cat = $fid = $cat; } else { $cat = 'category'; $fid = 'id'; } if (isset($source)) { foreach ($del as $id) { if (!empty($item)) { if (!empty($except)) { $art = $db->select(FDBPrefix . "{$item}", '*', "{$except} AND {$cat} ='{$id}'"); } else { $art = $db->select(FDBPrefix . "{$item}", '*', "{$cat} ='{$id}'"); } if (@mysql_num_rows($art) > 0) { $noempty = 1; break; } if (!isset($noempty)) { if (!empty($sub)) { if (!oneQuery($table, 'parent_id', $id)) { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } else { $noempty = 1; } } else { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } } else { $noempty = 1; } } else { if (isset($sub)) { if (!oneQuery($table, 'parent_id', $id)) { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } else { $noempty = 1; } } else { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } } } } if (isset($qr)) { return 1; } else { if (isset($noempty)) { return 'noempty'; } else { return null; } } }
echo Group_name; ?> </th> <th style="width:10% !important; text-align: center;">Level</th> <th style="width:60% !important;"><?php echo Description; ?> </th> <th style="width:5% !important;text-align: center;">ID</th> </tr> </thead> <tbody> <?php $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'user_group', '*', '', 'level ASC'); $no = 1; while ($qr = mysql_fetch_array($sql)) { $checkbox = null; if ($qr['level'] != 1 and $qr['level'] != 2 and $qr['level'] != 3) { $checkbox = "<input type='checkbox' name='check[]' value='{$qr['level']}'>"; } else { $checkbox = "<span class='icon lock'></lock>"; } $name = "<a class='tips' title='" . Edit . "' data-placement='right' href='?app=user&view=group&act=edit&id={$qr['id']}'>{$qr['group_name']}</a>"; if ($_SESSION['USER_LEVEL'] > 2) { $checkbox = "<span class='icon lock'></lock>"; $name = "{$qr['group_name']}"; } echo "<tr>"; echo "<td align='center'>{$checkbox}</td><td>{$name}</td><td align='center'>{$qr['level']}</td><td>{$qr['description']}</td><td align='center'>{$qr['id']}</td>";
* @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); if (!empty($tag) and $tag != $tagb) { $tags .= "<a class='tag{$size} tag-{$ltag}' href='{$link}'>{$tag}</a> "; } $tagb = $tag;
<?php /** * @name Comment * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt */ defined('_FINDEX_') or die('Access Denied'); $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'comment', '*', "link='{$link}' AND status=1", "date ASC"); $count = mysql_affected_rows(); if ($count != 0) { if (siteConfig('lang') == 'id') { $count = "{$count} Komentar"; } else { if ($count < 2) { $count = "{$count} Comment"; } else { $count = "{$count} Comments"; } } ?> <script> $(function() { var hash = $('.cmn-gravatar[data-gravatar-hash]').attr('data-gravatar-hash'); $.ajax({ url: 'http://gravatar.com/avatar/'+ hash +'?size=48' ,
echo Description; ?> </th> <th style="width:15% !important;text-align: center;" class='hidden-xs'>Total <?php echo Menu; ?> </th> <th style="width:5% !important; text-align: center;" class='hidden-xs' >ID</th> </tr> </thead> <tbody> <?php $db = new FQuery(); $db->connect(); $level = Level_Access; $sql = $db->select(FDBPrefix . 'menu_category', '*', SQL_USER_LEVEL); $no = 1; while ($qr = mysql_fetch_array($sql)) { $qr2 = $db->select(FDBPrefix . 'menu', '*', "category='{$qr['category']}'"); $jml2 = mysql_affected_rows(); $checkbox = "<input type='checkbox' name='check[]' value='{$qr['category']}' rel='ck'>"; $name = "<a data-placement='right' class='tips' title='" . Edit . "' href='?app=menu&view=edit_category&id={$qr['id']}'>{$qr['title']}</a>"; echo "<tr>"; echo "<td align='center'>{$checkbox}</td><td><span class='visible-xs right'>{$jml2} item</span>{$name}</td><td class='hidden-xs hidden-sm'>{$qr['category']}</td><td class='hidden-xs'>{$qr['description']}</td><td align='center' class='hidden-xs'>{$jml2}</td><td align='center' class='hidden-xs'>{$qr['id']}</td>"; echo "</tr>"; $no++; } ?> </tbody> </table> </form>
$allVisitor .= 0; } else { $allVisitor .= $v; } if ($x != 0) { $allVisitor .= ","; } } $z = 0; for ($x = $d14; $x >= 0; $x--) { $ytf = date('Y-m-d 00:00:00', strtotime("-{$x} days")); $t = $x - 1; $dtf = date('Y-m-d 00:00:00', strtotime("-{$t} days")); $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . "statistic", "*,COUNT(DISTINCT ip) AS q", "time < '{$dtf}'", "time ASC"); $row = mysql_fetch_array($sql); $unique = $row['q'] - $z; if ($unique < 0) { $unique = 0; } $z = $row['q']; if (empty($unique)) { $uniqueVisitor .= 0; } else { if ($x != $d14) { $uniqueVisitor .= $unique; } } if ($x != 0 and $x != $d14) { $uniqueVisitor .= ",";
**/ session_start(); define('_FINDEX_', 1); require '../../../system/jscore.php'; if (!isset($_POST['id'])) { alert('error', 'Access Denied!', true, true); die; } if (!isset($_POST['id'])) { header('../../../'); } else { require_once '../../../system/jscore.php'; $id = $_POST['id']; $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . 'article', '*', "id={$id}"); $qrs = @mysql_fetch_array($sql); if (isset($_POST['do'])) { if ($_POST['do'] == 'rate') { $rating = $_POST['rating']; $va = mod_param('rate_value', $qrs['parameter']); $rating += $va; $vo = mod_param('rate_counter', $qrs['parameter']); if (!is_numeric($vo) or !is_numeric($va)) { $vo1 = 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 { notice('error', Status_Invalid); } } /****************************************/ /* Add New contact */ /****************************************/ if (isset($_POST['save_add']) or isset($_POST['apply_add'])) { $db = new FQuery(); $db->connect(); if (!empty($_POST['name']) and !empty($_POST['gender']) and !empty($_POST['group'])) { $qr = $db->insert(FDBPrefix . 'contact', array("", "{$_POST['name']}", "{$_POST['gender']}", "{$_POST['email']}", "{$_POST['address']}", "{$_POST['city']}", "{$_POST['state']}", "{$_POST['country']}", "{$_POST['zip']}", "{$_POST['phone']}", "{$_POST['fax']}", "{$_POST['job']}", "{$_POST['photo']}", "{$_POST['web']}", "{$_POST['ym']}", "{$_POST['fb']}", "{$_POST['tw']}", "{$_POST['desc']}", "{$_POST['group']}", 1)); if ($qr and isset($_POST['apply_add'])) { $sql = $db->select(FDBPrefix . 'contact', 'id', '', 'id DESC'); $qr = mysql_fetch_array($sql); notice('success', Contact_Saved); redirect('?app=contact&act=edit&id=' . $qr['id'], 2); } elseif ($qr and isset($_POST['save_add'])) { notice('success', Contact_Saved); redirect('?app=contact', 2); } else { notice('error', Status_Fail); } } else { notice('error', Status_Invalid); } } /****************************************/ /* Edit contact */
function loadModuleCss() { if (isset($_GET['theme']) and $_GET['theme'] == 'module' and $_SESSION['USER_LEVEL'] < 3) { echo "<style>.theme-module {\n\t\tborder: 2px solid #e3e3e3; \n\t\tbackground: rgba(250,250,250,0.8);\n\t\tcolor : #666; \n\t\tpadding: 10px;\n\t\tmargin: 5px 3px;\n\t\tfont-weight: bold;\n\t\tcursor: pointer;\n\t\ttransition: all .2s ease;\n\t\t}\n\t\t.theme-module:hover {\n\t\tborder-color: #ff9000; \n\t\tbackground: rgba(255, 205, 130,0.15);\n\t\tcolor : #ff6100;\n\t\tbox-shadow: 0 0 10px #ffcd82;} </style>"; } else { $db = new FQuery(); $db->connect(); if (!defined('Page_ID') and $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] == FUrl) { $sql = $db->select(FDBPrefix . 'menu', '*', 'home=1'); $qr = mysql_fetch_array($sql); $pid = $qr['id']; } else { $pid = Page_ID; if (empty($pid)) { $pid = 0; } } $val = false; $no = 1; $qrs = $db->select(FDBPrefix . 'module', '*', "status=1 " . Level_Access, 'short ASC'); while ($qr = mysql_fetch_array($qrs)) { if (!empty($qr['page'])) { $pid = explode(",", $qr['page']); foreach ($pid as $a) { if ($a == Page_ID) { $file = "modules/{$qr['folder']}/mod_style.php"; if (file_exists($file)) { if ($no > 1) { echo "\t"; } require_once $file; echo "\n"; $no++; } } } } } } }
if (isset($_REQUEST['act'])) { if (!isset($_POST['delete']) and $_REQUEST['act'] == 'enable') { $db->update(FDBPrefix . 'comment', array("status" => "1"), 'id=' . $_REQUEST['id']); alert('info', Status_Applied); } if (!isset($_POST['delete']) and $_REQUEST['act'] == 'disable') { $db->update(FDBPrefix . 'comment', array("status" => "0"), 'id=' . $_REQUEST['id']); alert('info', Status_Applied); } } /****************************************/ /* Redirect when comment-Id not found */ /****************************************/ if (isset($_REQUEST['act'])) { if ($_REQUEST['act'] == 'edit') { $sql = $db->select(FDBPrefix . 'comment', '*', "id={$_REQUEST['id']}"); if (mysql_num_rows($sql) <= 0) { header('location:?app=comment'); } } } function update($a, $b) { $db = new FQuery(); $db->connect(); $qr = $db->update(FDBPrefix . "comment_setting", array('value' => "{$b}"), "name='{$a}'"); if ($qr) { return true; } } if (isset($_POST['save_config'])) {
function option_sub_cat($parent_id, $pre) { $db = new FQuery(); $db->connect(); $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id} AND id!={$_REQUEST['id']}"); while ($qr = mysql_fetch_array($sql)) { //select article 'info'rmation $sql2 = $db->select(FDBPrefix . 'article', '*', "id={$_REQUEST['id']}"); $at = mysql_fetch_array($sql2); //select article category 'info'rmation $sql3 = $db->select(FDBPrefix . 'article_category', '*', "id={$_REQUEST['id']}"); $pd = mysql_fetch_array($sql3); if ($pd['parent_id'] == $qr['id'] or $at['category'] == $qr['id']) { $s = "selected"; } else { $s = ""; } echo "<option value='{$qr['id']}' {$s}>{$pre} |_ {$qr['name']}</option>"; option_sub_cat($qr['id'], $pre . " "); } }