public function creatLink($id, $item = null) { $link = null; if (isset($item)) { do { $name = menuInfo('name', '', $id); $url = menuInfo('link', '', $id); $url = make_permalink($url); $link = "<li><span></span><a href='{$url}'>{$name}</a></li> {$link}"; } while ($id = menuInfo('parent_id', '', $id)); } else { while ($id = menuInfo('parent_id', '', $id)) { $name = menuInfo('name', '', $id); $url = menuInfo('link', '', $id); $url = make_permalink($url); $link = "<li><span></span><a href='{$url}'>{$name}</a></li> {$link}"; } } $home = "<li><span></span><a href='" . FUrl . "' class='breadchumb-home'>Home</a></li>"; if (!checkHomePage()) { return "{$home} {$link} <li><span></span>" . PageTitle . "</li>"; } else { return "<li><span></span>" . PageTitle . "</li>"; } }
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; } }
/** * @name User * @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(); loadLang(__DIR__); $view = app_param('view'); $key = @mysql_real_escape_string($_GET['key']); $res = @mysql_real_escape_string($_GET['res']); $linkLogin = make_permalink('?app=user&view=login'); $linkUser = make_permalink('?app=user'); $btnClass = 'style="text-align: center; font-size: 11px; font-family: arial,sans-serif; color: white; font-weight: bold; border-color: #3079ed; background-color: #4d90fe; background-image: linear-gradient(top,#4d90fe,#4787ed); text-decoration: none; display: inline-block; min-height: 27px; padding-left: 8px; padding-right: 8px; line-height: 27px; border-radius: 2px; border-width: 1px; "'; if ($view == 'register' or $view == 'login' or $view == 'forgot') { if (!empty($_SESSION['USER_ID'])) { redirect($linkUser); } else { if (!siteConfig('member_registration') and $view == 'register') { redirect($linkLogin); } } } else { if ($view == 'profile' or $view == 'logout' or $view == 'edit' or empty($view)) { if (empty($_SESSION['USER_ID']) and empty($key) and empty($res)) { redirect($linkLogin); }
* @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); $db = @new FQuery() or die; $db->connect(); $id = $_REQUEST['id']; $sql = $db->select(FDBPrefix . 'comment', '*', 'id=' . $id); $qr = mysql_fetch_array($sql); if ($qr['status'] == 1) { $status1 = "checked"; } else { $status2 = "checked"; } $link = str_replace(FUrl, "", make_permalink($qr['link'])); $link = "<a href='" . make_permalink($qr['link']) . "#comment-{$qr['id']}' target='_blank' class='tips outlink' title='click to see comment'>{$link}</a> "; ?> <form method="post"> <input value="<?php echo $qr['id']; ?> " type="hidden" name="id"> <div id="app_header"> <div class="warp_app_header"> <div class="app_title">Comment Manager</div> <div class="app_link"> <button type="submit" class="delete btn btn-success" title="<?php echo Save; ?> " value="<?php echo Save;
<?php /** * @name Search Module * @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'); $link = make_permalink('?app=search'); ?> <form class="search-form" action="<?php echo $link; ?> " method="post"> <input class="search-field" type="text" placeholder="Search..." name="q"> <input class="search-button btn" type="submit" value="Go" name="search"> </form>
function category($type, $id = null, $format = null) { $link = null; /* Set global parameter */ $show_panel = menu_param('show_panel', Page_ID); $show_rss = menu_param('show_rss', Page_ID); $read_more = menu_param('read_more', Page_ID); $per_page = menu_param('per_page', Page_ID); $intro = menu_param('intro', Page_ID); if (empty($intro)) { $intro = $per_page; } /* Set Access_Level */ $accessLevel = Level_Access; if ($type == 'archives') { $where = "status=1"; } else { if ($type == 'category') { $catName = categoryInfo('name', $id); $catDesc = categoryInfo('description', $id); $catLink = categoryLink($id); $where = "status=1 AND category = {$id}"; } else { if ($type == 'featured') { $where = "status=1 AND featured = 1"; } else { if ($type == 'tag') { if (empty($per_page)) { $per_page = 10; } $tag = app_param('tag'); $tag = str_replace("-", " ", $tag); $where = "status=1 AND tags LIKE '%" . $tag . "%'"; } } } } if (_FEED_ == 'rss') { $per_page = 20; $pages = url_param('page'); if ($pages != null) { $link = str_replace("?page={$pages}", "", getUrl()); redirect("{$link}?feed=rss"); } } loadPaging(); $paging = new paging(); $result = $paging->pagerQuery(FDBPrefix . 'article', "*,\n\t\tDATE_FORMAT(date,'%d %M %Y') as date,\n\t\tDATE_FORMAT(date,'%Y-%m-%d %H:%i:%s') as order_date,\n\t\tDATE_FORMAT(date,'%a, %m %d %Y %H:%i:%s') as time,\n\t\tDATE_FORMAT(date,'%d') as f,\n\t\tDATE_FORMAT(date,'%D') as d,\n\t\tDATE_FORMAT(date,'%b') as b,\n\t\tDATE_FORMAT(date,'%a') as a,\n\t\tDATE_FORMAT(date,'%W') as D,\n\t\tDATE_FORMAT(date,'%m') as n,\n\t\tDATE_FORMAT(date,'%M') as m,\n\t\tDATE_FORMAT(date,'%y') as y,\n\t\tDATE_FORMAT(date,'%Y') as Y,\n\t\tDATE_FORMAT(date,'%h') as h,\n\t\tDATE_FORMAT(date,'%H') as H,\n\t\tDATE_FORMAT(date,'%p') as p,\n\t\tDATE_FORMAT(date,'%i') as i,\n\t\tDATE_FORMAT(date,'%s') as s", "{$where} {$accessLevel}", 'order_date DESC', $per_page); $no = 0; $perrows = mysql_affected_rows(); while ($qr = mysql_fetch_array($result)) { /* Category Details */ $catLinks = categoryLink($qr['category']); $category = categoryInfo('name', $qr['category']); $catHref = "<a href='{$catLinks}'>{$category}</a>"; /* Author */ if (empty($qr['author'])) { $author = userInfo('name', 1); } else { $author = $qr['author']; } /* Article Links */ $link = "?app=article&view=item&id={$qr['id']}"; $vlink = str_replace("&", "&", $link); $vlink = make_permalink($vlink); /* Article Title */ $title = "<a href='{$vlink}'>{$qr['title']}</a>"; $link = make_permalink($link); /* Article Tags */ $tags = tagToLink($qr['tags']); /* Article Content */ $article = $qr['article']; if (checkLocalhost()) { $article = str_replace(FLocal . "media/", "media/", $article); $article = str_replace("/media/", FUrl . "media/", $article); } $comment = null; /* Article Comments */ $comm = FQuery('comment', "link='{$link}'AND status=1"); if (FQuery('apps', "folder='app_comment'")) { $comment = "<a class='send-comment' href='{$link}#comment'>"; if ($comm > 1) { $comment .= "<span>{$comm}</span> " . Comments; } if ($comm == 1) { $comment .= "<span>{$comm}</span> " . Comment; } if ($comm < 1) { $comment .= Send_Comment; } $comment .= "</a>"; } $scomment = mod_param('show_comment', articleInfo('parameter', $qr['id'])); if (!$scomment) { $comment = ''; } /* Read More */ if (empty($read_more)) { $read_more = Readmore; } $readmore = "<a href='{$link}' class='readmore'>{$read_more}</a> {$comment}"; /* Intro limit (read more) */ $content = $article; /* Blog Style */ if ($format == 'blog' or $type == 'tag' or $format == 'list') { $image = articleImage($content); $image = str_replace("/media", "/media/.thumbs", $image); $imgH = menu_param('imgH', Page_ID); $imgW = menu_param('imgW', Page_ID); $this->image[$no] = $image; $this->imgH = $imgH; $this->imgW = $imgW; $content = preg_replace("/<img[^>]+\\>/i", "", $content); } $content = articleIntro($content); $panel = menu_param('panel_format', Page_ID); $fpanel = "#" . menu_param('panel_format', Page_ID); $dpanel = str_replace('%rel', "", $fpanel); if (empty($panel) or !strpos($dpanel, '%')) { if (siteConfig('lang') == 'id') { $panel = "<b>%A</b> · %f %m %Y · %c"; } else { $panel = "%m, %f %Y · <b>%A</b> · %c"; } } $panel = str_replace('%A', $author, $panel); $panel = str_replace('%c', "{$catHref}", $panel); $panel = str_replace('%h', $qr['hits'], $panel); $timeRel = dateRelative($qr['H'], $qr['i'], $qr['s'], $qr['n'], $qr['f'], $qr['Y']); if ($timeRel and strpos($fpanel, '%rel')) { $panel = str_replace(', ', "", $panel); $panel = str_replace('%d', "", $panel); $panel = str_replace('%f', "{$timeRel}", $panel); $panel = str_replace('%m', "", $panel); $panel = str_replace('%n', "", $panel); $panel = str_replace('%y', "", $panel); $panel = str_replace('%Y', "", $panel); $panel = str_replace('%H', "", $panel); $panel = str_replace('%h', "", $panel); $panel = str_replace('%i', "", $panel); $panel = str_replace('%s', "", $panel); $panel = str_replace('%p', "", $panel); if (strlen($panel) < 3) { $panel = $timeRel; } } else { if (siteConfig('lang') == 'id') { $panel = str_replace('%f', $qr['f'], $panel); } else { $panel = str_replace('%f', $qr['d'], $panel); } $panel = str_replace("%rel", $panel, $panel); $panel = str_replace('%d', $qr['d'], $panel); $panel = str_replace('%a', $qr['a'], $panel); $panel = str_replace('%b', $qr['b'], $panel); $panel = str_replace('%m', $qr['m'], $panel); $panel = str_replace('%n', $qr['n'], $panel); $panel = str_replace('%y', $qr['y'], $panel); $panel = str_replace('%Y', $qr['Y'], $panel); $panel = str_replace('%H', $qr['H'], $panel); $panel = str_replace('%h', $qr['h'], $panel); $panel = str_replace('%i', $qr['i'], $panel); $panel = str_replace('%s', $qr['s'], $panel); $panel = str_replace('%p', $qr['p'], $panel); } $panel = str_replace('*', "", $panel); /* RSS Feed */ $this->perrows = $perrows; $this->intro = $intro; $this->show_rss = $show_rss; $this->show_panel = $show_panel; $this->panel[$no] = $panel; $this->category[$no] = $category; $this->catlink[$no] = $catLinks; $this->readmore[$no] = $readmore; $this->comment[$no] = $comment; $this->author[$no] = $author; $this->title[$no] = $title; $this->link[$no] = $link; $this->tags[$no] = $tags; $this->ftime[$no] = $qr['time']; $this->hits[$no] = $qr['hits']; $this->desc[$no] = clearXMLString("{$content}"); $this->ftitle[$no] = clearXMLString($qr['title']); $this->content[$no] = $content; if (defined('SEF_URL')) { $link = link_paging('?'); if (strpos(getUrl(), '&') > 0) { $link = link_paging('&'); } } else { if (checkhomepage()) { $link = "?"; } else { if (!url_param('id')) { $tag = app_param('tag'); $link = "?app=article&tag={$tag}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } else { $link = "?app=article&view=category&id={$categoryId}"; $link = make_permalink($link, Page_ID); $link = $link . "&"; } } } $no++; } // pageLink $this->pglink = $paging->createPaging($link); // rssLink if ($type == 'tag') { $tag = str_replace(" ", "-", $tag); $rssLink = "?app=article&tag={$tag}&feed=rss"; } else { if ($type == 'category') { $rssLink = "?app=article&view=category&id={$id}&feed=rss"; } else { $rssLink = "?app=article&view=archives&feed=rss"; } } if (_FEED_ == 'rss') { $rssLink = make_permalink($rssLink); $this->rssTitle = @clearXMLString(SiteTitle); $categoryLink = @clearXMLString($rssLink); $categoryLink = str_replace(".xml", "", $categoryLink); $this->rssLink = $categoryLink; $this->rssDesc = @$categoryDesc; } else { $this->rssLink = make_permalink($rssLink); } }
} $o = mysql_affected_rows(); $privatekey = pdfCOnfig('recaptcha_privatekey'); $publickey = pdfCOnfig('recaptcha_publickey'); echo "<div class='comment label'>{$o} Feedback</div>"; $no = 1; while ($com = mysql_fetch_array($sql)) { $email = strtolower(userInfo($com['user_id'])); $email = md5($email); $img = "<span class='cmn-gravatar' data-gravatar-hash='{$email}'></span>"; if ($com['user_id'] == 1 or $com['user_id'] == 2) { $s = " admin-comment"; } else { $s = ""; } $ulink = make_permalink('?app=pdf&view=user&id=1' . $com['user_id']); $uname = oneQuery('user', 'id', $com['user_id'], 'name'); $name = "<a href='{$ulink}'>{$uname}</a>"; $comment = str_replace("<", "<", $com['comment']); $comment = str_replace(">", ">", $comment); $comment = str_replace("\n", "<br>", $comment); $comment = str_replace("[b]", "<b>", $comment); $comment = str_replace("[/b]", "</b>", $comment); $comment = str_replace("[i]", "<i>", $comment); $comment = str_replace("[/i]", "</i>", $comment); $comment = str_replace("[u]", "<u>", $comment); $comment = str_replace("[/u]", "</u>", $comment); $author_reply = $com['author_reply']; $author_reply = str_replace(">", ">", $author_reply); $author_reply = str_replace("\n", "<br>", $author_reply); $author_reply = str_replace("[b]", "<b>", $author_reply);
function valid_permalink(&$p, &$error = null, $valid = null) { $p[$valid['_input']] = make_permalink($p[$valid['permalink']]); return true; }
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; } }
<?php /** * @name Logout * @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'); $link = make_permalink("?app=user"); ?> <form action="" method="post"> <div class="user-logout"> <h1>User Logout</h1> <p> <?php echo Sure2Logout__; ?> </p> <p> <input type="submit" name="logout" value="<?php echo Yes; ?> " class="button btn" /> <?php echo or_; ?> <a href="<?php echo $link; ?> " class="button btn"><?php
defined('_FINDEX_') or die('Access Denied'); if (siteConfig('member_registration')) { $new = "<a class='register' href='" . make_permalink('?app=user&view=register') . "'>Register</a>"; } ?> <div id="user"> <h1>User Login</h1> <form action="" method="POST"> <?php echo userNotice; ?> <div> <span>Username</span> <input type="text" autocomplete="off" name="user" placeholder="e.g. User"/> </div> <div> <span>Password</span> <input type="password" name="pass" placeholder="●●●●●●"/> </div> <div class="user-link"> <span> </span><input type="submit" name="login" value="Login" class="button btn login"/> <?php echo @$new; ?> <a href="<?php echo make_permalink('?app=user&view=lost_password'); ?> "><?php echo Lost_Password; ?> ?</a> </div> </form> </div>
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; }
if ($idx != 0) { $c .= ' OR '; } $c .= "category={$qry}"; } if (function_exists('articleInfo')) { $level = Level_Access; $date = articleInfo('date'); $sql = $db->select(FDBPrefix . "article", '*', "status = 1 AND ({$c}) AND date < '{$date}' {$level} ", "date DESC LIMIT 1"); $prev = mysql_fetch_array($sql); $sql2 = $db->select(FDBPrefix . "article", '*', "status = 1 AND ({$c}) AND date > '{$date}' {$level}", "date ASC LIMIT 1"); $next = mysql_fetch_array($sql2); $prev['link'] = "?app=article&view=item&id={$prev['id']}"; $prev['link'] = make_permalink($prev['link']); $next['link'] = "?app=article&view=item&id={$next['id']}"; $next['link'] = make_permalink($next['link']); echo "<div class='article-nextprev'>"; if (!empty($prev['title'])) { echo "<div class='prev'>\n\t\t<a href='{$prev['link']}'><span>< Prev</span> {$prev['title']}</a>\n\t</div>"; } else { echo "\n\t<div class='prev'>\n\t\t<a><span>||</span></a>\n\t</div>"; } if (!empty($next['title'])) { echo "<div class='next'>\n\t\t<a href='{$next['link']}'>{$next['title']} <span>Next ></span></a>\n\t</div>"; } else { echo "<div class='next'>\n\t\t<a><span>||</span></a>\n\t</div>"; } echo "</div>"; } else { echo "Not found any article."; }
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 { echo "<div class='mod-right-comment u3'>"; } $ltitle = strpos($com['link'], 'id='); $ltitle = substr($com['link'], $ltitle + 3); $ltitle = oneQuery('article', 'id', $ltitle, 'title'); $ltitle = "<a href='" . make_permalink($com['link']) . "' title='comment permalink'>{$ltitle}</a>"; if ($name and $title and $date) { echo "<span>{$com['name']}</span> <em>{$com['date']}</em><br/> on {$ltitle}"; } else { if (!$name and $title and $date) { echo "{$ltitle} on <em>{$com['date']}</em>"; } else { if ($name and $title) { echo "<span>{$com['name']}</span> on {$ltitle}"; } else { if ($name and $date) { echo "<span>{$com['name']}</span> on <em>{$com['date']}</em>"; } else { if ($name) { echo "<span>{$com['name']}</span>"; } else {
<tbody> <?php $db = new FQuery(); $db->connect(); $no = 1; $sql = $db->select(FDBPrefix . 'comment', '*', '', "id DESC"); while ($qr = mysql_fetch_array($sql)) { /* logika status aktif atau tidak */ if ($qr['status'] == 1) { $stat1 = "selected"; $stat2 = ""; } else { $stat2 = "selected"; $stat1 = ""; } $status = "\n\t\t\t\t<p class='switch'>\n\t\t\t\t\t<label class='cb-enable {$stat1}'><span>Show</span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2}'><span>Hide</span></label>\n\t\t\t\t\t<input type='text' value='{$qr['id']}' id='id' class='invisible'><input type='text' value='stat' id='type' class='invisible'>\n\t\t\t\t</p>"; $name = "<a class='tooltip ctedit' title='" . Click_to_edit . "' href='?app=comment&act=edit&id={$qr['id']}'>{$qr['name']}</a>"; $check = "<input type='checkbox' name='check[]' value='{$qr['id']}' rel='ck'>"; $link = str_replace("http://" . FUrl, "", make_permalink($qr['link'])); $comm = htmlentities(htmlToText($qr['comment'])); $comm = substr($comm, 0, 60); $comm = "<a href='" . make_permalink($qr['link']) . "#comment-{$qr['clink']}' target='_blank' class='tooltip outlink' title='" . See_comments . "'>{$comm} . . .</a> "; echo "<tr>"; echo "<td>{$no}</td><td align='center'>{$check}</td><td>{$name}</td><td>{$qr['email']}</td><td align='center'>{$status}</td><td>{$comm}</td>"; echo "</tr>"; $no++; } ?> </tbody> </table> </form>
if ($level == 1 and $uid > 0) { $s = " admin-comment"; } else { $s = ""; } $com['website'] = str_replace("http://", "", "{$com['website']}"); if (empty($com['website'])) { $name = "{$com['name']}"; } else { $name = "<a href='http://{$com['website']}'>{$com['name']}</a>"; } $comment = str_replace("<", "<", $com['comment']); $comment = str_replace(">", ">", $comment); $comment = str_replace("\n", "<br>", $comment); $comment = str_replace("[b]", "<b>", $comment); $comment = str_replace("[/b]", "</b>", $comment); $comment = str_replace("[i]", "<i>", $comment); $comment = str_replace("[/i]", "</i>", $comment); $comment = str_replace("[u]", "<u>", $comment); $comment = str_replace("[/u]", "</u>", $comment); echo "<div class='inner-comment{$s}' id='comment-{$com['id']}'>"; echo "<div class='avatar-comment'>{$img}</div>"; echo "<div class='right-comment'><b>{$name}</b> on {$com['date']}<div class='main-comment'><span><i><a href='" . make_permalink(getLink()) . "#comment-{$com['id']}' title='comment permalink'>#{$no}</a></i></span>{$comment} </div></div>"; echo "</div>"; $no++; } ?> </div> <?php }
<div class="user-profile"> <h1><?php echo Welcome; ?> , <?php echo USER_NAME; ?> </h1> <p> <?php echo user_Login_Success; ?> </p> <p> <a href="<?php echo make_permalink('?app=user&view=edit'); ?> " class="button btn"><?php echo Edit_Profile; ?> </a> <button class="button btn"><?php echo Logout; ?> </button> </p> <?php loadModule('user-profile'); ?> </div> </form>
*/ 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; } echo "<div class='article-tags'>{$tags}</div>";
if (siteConfig('member_registration')) { $new = "<a class='register' href='" . make_permalink('?app=user&view=register') . "'>Register</a>"; } ?> <div id="user"> <h1>Password Reminder</h1> <form action="" method="post"> <?php echo userNotice; ?> <p class="user-desc"><?php echo user_Password_Reminder; ?> </p> <div> <span>Email</span> <input type="text" name="email" /></div> <div class="user-link"> <span> </span> <input type="submit" name="forgot" value="<?php echo Send; ?> " class="button btn login"/> <a href="<?php echo make_permalink('?app=user&view=login'); ?> ">Login</a> <?php echo @$new; ?> </div> </form> </div>
<?php /** * @name Inline Menu * @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'); echo "<ul class=\"nav navbar-nav navbar-inline\">"; $no = 1; $qr = $db->select(FDBPrefix . "menu", "*", "category='{$category}' AND status=1 AND parent_id=0 " . Level_Access, "short ASC"); $sum = mysql_affected_rows(); while ($menu = mysql_fetch_array($qr)) { $link = make_permalink($menu['link'], $menu['id']); if ($sub_title == 1) { $subtitle = "<span>{$menu['sub_name']}</span>"; } else { $subtitle = ""; } if ($menu['id'] == Page_ID) { $a = " active"; } else { $a = ""; } if ($no == 1) { $pos = ' first'; } else { if ($no == $sum) { $pos = ' last';
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>"; } }