當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Viewer::get_items方法代碼示例

本文整理匯總了PHP中Viewer::get_items方法的典型用法代碼示例。如果您正苦於以下問題:PHP Viewer::get_items方法的具體用法?PHP Viewer::get_items怎麽用?PHP Viewer::get_items使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Viewer的用法示例。


在下文中一共展示了Viewer::get_items方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

// load classes
include_once "../WEB-INC/class.db.php";
include_once "../WEB-INC/class.auth.php";
include_once "../WEB-INC/class.data_viewer.php";
// global vars
$strPage = isset($_GET['view']) ? $_GET['view'] : null;
$intChannelID = isset($_GET['channel']) ? $_GET['channel'] : false;
$username = isset($_POST['username']) ? $_POST['username'] : null;
$password = isset($_POST['password']) ? sha1($_POST['password']) : null;
//sha1 encryption has been used here this can be changed when changed, you will also need to change the passwords in the config file.
// classes
$cDb = new db();
$cAuth = new auth();
$cDataViewer = new Viewer();
//$cDataViewer->get_last_items();
$cDataViewer->get_items(null, "NOW", null, "pubDate", "ASC", 0, 10);
for ($c = 0; $cDataViewer->last_posts['count'] > $c; $c++) {
    $channel_title = $cDataViewer->last_posts['data'][$c]['channel']['chiTitle'];
    $channel_url = $cDataViewer->last_posts['data'][$c]['channel']['chURL'];
    $channel_link = $cDataViewer->last_posts['data'][$c]['channel']['chiLink'];
    $item_id = $cDataViewer->last_posts['data'][$c]['item']['item_id'];
    $item_title = $cDataViewer->last_posts['data'][$c]['item']['title'];
    $item_link = $cDataViewer->last_posts['data'][$c]['item']['link'];
    $item_descr = $cDataViewer->last_posts['data'][$c]['item']['description'];
    $item_pubDate = date('d.m.Y h:i', strtotime($cDataViewer->last_posts['data'][$c]['item']['pubDate']));
    $item_comments = isset($cDataViewer->last_posts['data'][$c]['item']['comments']) ? $cDataViewer->last_posts['data'][$c]['item']['comments'] : null;
    $item_comments = $item_comments ? "<a href='{$item_comments}'>Читать дальше &rarr;</a>" : null;
    $return .= <<<PPH
\t\t\t<div class=item> 
\t\t\t\t<div class=date>
\t\t\t\t\t<b><font color="#999999">{$item_pubDate}</font></b>
開發者ID:vanzhiganov,項目名稱:NewsArggregator,代碼行數:31,代碼來源:l.php


注:本文中的Viewer::get_items方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。