当前位置: 首页>>代码示例>>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;未经允许,请勿转载。