示例#1
0
文件: apps.php 项目: mul14/FiyoCMS
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');
        }
    }
}
示例#2
0
function articleHits($vid)
{
    $db = new FQuery();
    $db->connect();
    $hits = $vid + 1;
    $id = app_param('id');
    $db->update(FDBPrefix . 'article', array('hits' => "{$hits}"), "id={$id}");
}
示例#3
0
function update($a, $b)
{
    $db = new FQuery();
    $db->connect();
    $qr = $db->update(FDBPrefix . "comment_setting", array('value' => "{$b}"), "name='{$a}'");
    if ($qr) {
        return true;
    }
}
示例#4
0
function option_sub_cat($parent_id, $cat, $pre)
{
    $db = new FQuery();
    $db->connect();
    $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id} AND id!={$parent_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 . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    }
}
示例#5
0
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;
}
示例#6
0
文件: parent.php 项目: mul14/FiyoCMS
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 . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    }
}
示例#7
0
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 . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    }
}
示例#8
0
文件: modules.php 项目: mul14/FiyoCMS
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++;
                        }
                    }
                }
            }
        }
    }
}
示例#9
0
function make_permalink($source, $id = null, $page = null, $like = null)
{
    if (SEF_URL) {
        $db = new FQuery();
        $db->connect();
        $sql = $db->select(FDBPrefix . "permalink", "*", "link ='{$source}'");
        if ($like == true) {
            $sql = $db->select(FDBPrefix . "permalink", "*", "link LIKE '%{$source}%'");
        }
        $link = mysql_fetch_array($sql);
        $link = FUrl . "{$link['permalink']}";
        if (!empty($id)) {
            $source = FUrl . $source;
        } else {
            $source = FUrl . $source;
        }
        if (mysql_affected_rows() > 0) {
            $source = $link;
        } else {
            $source = $source;
        }
    } else {
        if (defined('Page_ID') or $_GET['id'] = Page_ID) {
            $source = FUrl . "{$source}";
        }
    }
    return str_replace("&", "&amp;", $source);
}
示例#10
0
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 . "&nbsp;&nbsp;&nbsp;&nbsp;");
        }
    }
}
示例#11
0
文件: menu.php 项目: mul14/FiyoCMS
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>";
    }
}
示例#12
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;
     }
 }
示例#13
0
 function item($q, $menuId)
 {
     /* Call new FQuery */
     $db = new FQuery();
     $db->connect();
     /* Set Access_Level */
     $accessLevel = Level_Access;
     $q = str_replace("'", "", $q);
     $q = str_replace("/", "", $q);
     $q = str_replace("\\", "", $q);
     $q = str_replace('"', "", $q);
     $q = str_replace('  ', " ", $q);
     if (empty($q)) {
         $q = $_SESSION['search'];
     }
     /* Call new paging */
     loadPaging();
     $paging = new paging();
     $rowsPerPage = 10;
     $keyword = trim($q);
     //remove space before and after
     $article = explode_query($q, 'article');
     $title = explode_query($q, 'title');
     $author = explode_query($q, 'author');
     $tag = explode_query($q, 'tags');
     $condition = "{$article} {$title} {$author} {$tag}";
     $user = FQuery('user', "`name` LIKE  '%{$q}%'", 'id');
     /* Check total article by query */
     FQuery('article', "status=1 AND (`author_id` ='{$user}' {$condition}) {$accessLevel}");
     $total = mysql_affected_rows();
     /* paging query */
     $result = $paging->pagerQuery(FDBPrefix . 'article', "*,DATE_FORMAT(date,'%d %M %Y') as date,DATE_FORMAT(date,'%Y-%m-%d %H:%i:%s') as order_date", "status=1 AND (`author_id` ='{$user}' {$condition}) \n\t\t{$accessLevel}", 'order_date DESC', $rowsPerPage);
     $no = 0;
     $jml = mysql_affected_rows();
     while ($qr = mysql_fetch_array($result)) {
         //category
         $category = oneQuery('article_category', 'id', $qr['category'], 'name');
         $catlink = make_permalink("?app=article&view=category&id={$qr['category']}");
         //autho
         if (!empty($qr['author_id'])) {
             if (!empty($qr['author'])) {
                 $author = $qr['author'];
             } else {
                 $author = oneQuery('user', 'id', $qr['author_id'], 'name');
             }
         } else {
             $author = "Administrator";
         }
         $strpos = 0;
         $article = stripTags($qr['article']);
         $article2 = strtolower($article);
         $strpos = strpos("{$article2}", "{$q}");
         $query = str_replace(", ", ",", $q);
         $query = str_replace(" ,", ",", $q);
         $query = trim($query);
         if (strpos($query, ",")) {
             $query = explode(",", $query);
         } else {
             $query = explode(" ", $q);
         }
         $i = 0;
         $z = '';
         $y = '';
         foreach ($query as $v) {
             $y[$i] = $v;
             $i++;
         }
         for ($n = $i * $i - 1; $n >= 0; $n--) {
         }
         if ($strpos >= 40) {
             $strpos = $strpos - 40;
             $article2 = substr("{$article2}", $strpos);
             $strpos2 = strpos("{$article2}", " ");
             $article = substr("{$article}", $strpos + $strpos2);
             $article = "..." . $article;
         }
         $article = cutWords($article, 35);
         $article .= "...";
         $link = "?app=article&view=item&id={$qr['id']}";
         $link = make_permalink($link, Page_ID);
         $qr['title'] = search_match($qr['title'], $q);
         $article = search_match($article, $q);
         $author = search_match($author, $q);
         $category = search_match($category, $q);
         $title = "<a href=\"{$link}\">{$qr['title']}</a>";
         $readmore = null;
         $this->category[$no] = $category;
         $this->catlink[$no] = $catlink;
         $this->readmore[$no] = $readmore;
         $this->author[$no] = $author;
         $this->title[$no] = $title;
         $this->date[$no] = $qr['date'];
         $this->article[$no] = $article;
         $this->perrows = $jml;
         $this->total = $total;
         if (defined('SEF_URL')) {
             $link = link_paging('?');
         } else {
             $link = "?app=article&view=category&id={$categoryId}";
             $link = make_permalink($link, Page_ID);
             $link = $link . "&";
         }
         $no++;
     }
     FQuery('article', "status=1 AND (`author_id` ='{$user}' {$condition}) {$accessLevel}");
     $jml = mysql_affected_rows();
     if ($jml > $rowsPerPage) {
         $pagelink = $paging->createPaging($link);
     } else {
         $pagelink = null;
     }
     if (strpos(getUrl(), '?q')) {
         $pagelink = str_replace("?page=", "&page=", $pagelink);
     }
     $this->pglink = $pagelink;
 }
示例#14
0
文件: sys_pdf.php 项目: mul14/FiyoCMS
 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;
     }
 }
示例#15
0
function addappstep1()
{
    ?>
<script type="text/javascript" charset="utf-8">
if (!$.isFunction($.fn.dataTable) ) {
	var script = '../plugins/plg_jquery_ui/datatables.js';
	document.write('<'+'script src="'+script+'" type="text/javascript"><' + '/script>');	
}	
$(function() {		
	
		$("input[type='radio']:checked").parents('tr').addClass('active');
	$("input[type='radio']:checked").click(function(e){	
		$("input[type='radio']:checked").parents('tr').addClass('active');
	});
	$("form").submit(function(e){
		var ff = this;
		var checked = $('input:checked').length > 0;
		if(checked) {
				ff.submit();
		} else {
			noticeabs("<?php 
    echo alert('error', Please_Select_Menu);
    ?>
");
			$('input').next().addClass('input-error');
			return false;
		}
	});
	loadTable();
});
</script>
<form method="post">
	<div id="app_header">
		<div class="warp_app_header">
			<div class="app_title"><?php 
    echo New_Menu;
    ?>
</div>			
			<div class="app_link">
				<a class="delete btn btn-default btn-sm btn-grad" href="?app=menu" title="<?php 
    echo Back;
    ?>
"><i class="icon-arrow-left"></i>&nbsp;<?php 
    echo Prev;
    ?>
</a>
				<button type="submit" class="btn btn-success  btn-sm btn-grad" title="<?php 
    echo Delete;
    ?>
" value="Next" name="next"><?php 
    echo Next;
    ?>
 &nbsp;<i class="icon-arrow-right"></i></button>
			</div>
		</div>			 
	</div>
	<table class="data">
		<thead>
			<tr>
				<th style="width:1%; text-align:center" class="no" ></th>
				<th style="width:18% !important;"><?php 
    echo Menu_Type_or_Apps_Name;
    ?>
</th>
				<th style="width:18% !important;"><?php 
    echo AddOns_Author;
    ?>
</th>
				<th style="width:65% !important;"><?php 
    echo Description;
    ?>
</th>
			</tr>
		</thead>
		</thead>
		<?php 
    $db = new FQuery();
    $db->connect();
    $sql = $db->select(FDBPrefix . 'apps', '*', 'type <= 1', "name ASC");
    $apps_date = $apps_version = '-';
    while ($qr = mysql_fetch_array($sql)) {
        $file = "../apps/{$qr['folder']}/app_details.php";
        if (file_exists($file)) {
            include "../apps/{$qr['folder']}/app_details.php";
        }
        echo "<tr target-radio='{$qr['folder']}'>";
        echo "<td align='center'><input type=\"radio\" name=\"apps\" value=\"{$qr['folder']}\" data-name='{$qr['folder']}' target-radio='{$qr['folder']}'></td><td><a>{$qr['name']}</a></td><td>{$qr['author']}</td>\n\t\t\t\t<td>{$app_desc}</td>";
        echo "</tr>";
    }
    ?>
 
		<tr target-radio="link">
			<td align="center"><input type="radio" name="apps" value="link" target-radio="link" data-name="link"></td>
			<td><a data-placement='right' class='tips' ><?php 
    echo External_Link;
    ?>
</a></td>
			<td>Fiyo CMS</td>
			<td><?php 
    echo External_Link_tip;
    ?>
</td>
		</tr>
		<tr target-radio="sperator">
			<td align="center"><input type="radio" name="apps" value="sperator" target-radio="link" data-name="sperator"></td>
			<td><a data-placement='right' class='tips' ><?php 
    echo Sperator;
    ?>
</a></td>
			<td>Fiyo CMS</td>
			<td><?php 
    echo Sperator_tip;
    ?>
</td>
		</tr>
	</table>
</form>			
<?php 
}
示例#16
0
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}&nbsp;&nbsp;|_ {$check} {$qr['name']}</li>";
        option_sub_menu($qr['id'], $sub + 1, "&nbsp;" . $pre . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $page);
    }
}
示例#17
0
function delete_permalink($link)
{
    $db = new FQuery();
    $db->connect();
    $db->delete(FDBPrefix . 'permalink', "permalink='{$link}'");
}
示例#18
0
文件: index.php 项目: mul14/FiyoCMS
<?php

/**
* @name			Comment
* @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');
$db = new FQuery();
$db->connect();
loadLang(__DIR__);
if (!defined('SEF_URL')) {
    $link = check_permalink('link', getLink(), 'link');
    $go_link = FUrl . getLink() . "&pid={$_GET['pid']}";
} else {
    $link = @check_permalink('permalink', $_REQUEST['link'], 'link');
    $go_link = FUrl . @$_REQUEST['link'] . SEF_EXT;
}
require 'entry_comment.php';
define('CAPTCHA', false);
if (!CAPTCHA) {
    $valid = true;
    if (!isset($_SESSION['captcha'])) {
        $_SESSION['captcha'] = 99;
    }
    $_POST['secure'] = $_SESSION['captcha'];
    $_SESSION['ENABLE_CAPTCHA'] = false;
}
示例#19
0
function sub_menu($parent_id)
{
    $db = new FQuery();
    $db->connect();
    $menus = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id} AND status=1", "short ASC");
    $sum = mysql_affected_rows();
    $no = 1;
    if (mysql_num_rows($menus) > 0) {
        echo "<ul class=\"sub-menu\">";
        while ($menu = mysql_fetch_array($menus)) {
            if (defined('SEF_URL')) {
                $link = make_permalink($menu['link'], $menu['id']);
            } else {
                if (empty($menu['id'])) {
                    $menu['id'] = Page_ID;
                }
                $link = "{$menu['link']}";
            }
            $sub_title = _Mod_SubTitle_;
            if ($sub_title == 1) {
                $subtitle = "<span>{$menu['sub_name']}</span>";
            } else {
                $subtitle = "";
            }
            if ($menu['id'] == Page_ID) {
                $a = " active";
            } else {
                $a = "";
            }
            if ($no == 1) {
                $post = ' first';
            } else {
                if ($no == $sum) {
                    $post = ' last';
                } else {
                    $post = '';
                }
            }
            if ($menu['home'] == 0) {
                if ($menu['app'] == "sperator") {
                    echo "<li class=\"menu{$menu['class']}{$a}{$post}\"><a href='#'>{$menu['name']}{$subtitle}</a>";
                    if (_Mod_SubMenu_ == 1) {
                        sub_menu($menu['id']);
                    }
                    echo "</li>";
                } elseif ($menu['app'] == "link") {
                    echo "<li class=\"menu{$menu['class']}{$a}{$post}\" style=\"{$menu['style']}\"><a href=\"{$link}\">{$menu['name']}{$subtitle}</a>";
                    if (_Mod_SubMenu_ == 1) {
                        sub_menu($menu['id']);
                    }
                    echo "</li>";
                } else {
                    if (empty($menu['link'])) {
                        $menu['link'] = "#";
                    }
                    echo "<li class=\"menu{$menu['class']}{$a}{$post}\" style=\"{$menu['style']}\"><a href=\"{$link}\">{$menu['name']}{$subtitle}</a>";
                    if (_Mod_SubMenu_ == 1) {
                        sub_menu($menu['id']);
                    }
                    echo "</li>";
                }
            } else {
                echo "<li class=\"menu{$menu['class']}{$a}{$pos}\" style=\"{$menu['style']}\"><a href=\"" . FUrl . "\">{$menu['name']}{$subtitle}</a>";
                if (_Mod_SubMenu_ == 1) {
                    sub_menu($menu['id']);
                }
                echo "</li>";
            }
            $no++;
        }
        echo "</ul>";
    }
}