<div class=""><h2 class="title"><?php echo $title[$i]; ?> </h2> <div class='pdf_panel'> <span> <?php echo "<b><i>{$author[$i]}</i></b> · {$category[$i]} · Th.{$date[$i]}"; ?> </span> </div> <div class="clear"></div> <?php echo cutWords(htmlToText($text[$i]), 40); ?> </div> </div> </div> <?php } ?> <div class="pdf_main"> <?php echo $pagelink; ?> </div>
$db->connect(); $user_id = USER_ID; if (USER_LEVEL > 3) { $sql = $db->select(FDBPrefix . "comment", "*,DATE_FORMAT(date,'%W, %b %d %Y') as dates", "parent_user_id = {$user_id} OR thread_user_id = {$user_id}", 'date DESC LIMIT 10'); echo USER_LEVEL; } else { $sql = $db->select(FDBPrefix . "comment", "*,DATE_FORMAT(date,'%W, %b %d %Y') as dates", "", 'date DESC LIMIT 10'); } $no = 0; while ($qr = mysql_fetch_array($sql)) { $id = "{$qr['id']}"; $auth = "{$qr['name']}"; $info = "{$qr['date']}"; $imgr = md5("{$qr['email']}"); $foto = " <span class='c_gravatar' data-gravatar-hash=\"{$imgr}\"></span>"; $comment = cutWords(htmlToText($qr['comment']), 10); $hide = Hide; $cedit = Edit; $read = Read; $delete = Delete; $approve = Approve; $app = link_param('app', "{$qr['link']}"); $aid = link_param('id', "{$qr['link']}"); $app = "{$qr['apps']}"; if (empty($app)) { $app = 'article'; } $lread = $_POST['url'] . check_permalink("link", "?app=article&view=item&id={$aid}", "permalink"); $edit = "?app={$app}&view=comment&act=edit&id={$id}"; $title = oneQuery('article', 'id', $aid, 'title'); $red = '';
if ($opentag) { $closetag = substr($text[$i], $opentag); $closetag = strpos($closetag, ">"); $image = substr($text[$i], $opentag, $opentag + $closetag); $a = strpos($image, 'src="'); if (empty($a)) { $a = strpos($image, "src='"); } $b = substr($image, $a + 5); $c = strpos($b, '"'); if (empty($c)) { $c = strpos($b, "'"); } $img = substr($image, $a + 5, $c); } $img = str_replace("/files", "/files/.thumbs", $img); $desc[$i] = cutWords($desc[$i], 20); echo ' <item> <title>' . strip_tags($title[$i]) . '</title> <link><![CDATA[' . $link[$i] . ']]></link> <guid><![CDATA[' . $link[$i] . ']]></guid> <description><![CDATA[' . $desc[$i] . ']]></description> <category>' . $category[0] . '</category> <pubDate>' . $time[$i] . '</pubDate> <media:thumbnail width="66" height="49" url="' . FUrl . $img . '"/> <media:thumbnail width="144" height="81" url="' . FUrl . $img . '"/> </item>'; } echo '</channel> </rss>';
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; }