本文整理汇总了PHP中RSS::showIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::showIcon方法的具体用法?PHP RSS::showIcon怎么用?PHP RSS::showIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSS
的用法示例。
在下文中一共展示了RSS::showIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public static function show($start_date = null, $end_date = null)
{
if (!Blog_User::allowView()) {
return null;
}
$db = new PHPWS_DB('blog_entries');
if ($start_date) {
$db->addWhere('publish_date', $start_date, '>=', 'and', 2);
}
if ($end_date) {
$db->addWhere('publish_date', $end_date, '<=', 'and', 2);
}
$db->addWhere('approved', 1);
$db->addWhere('publish_date', time(), '<');
$db->addWhere('expire_date', time(), '>', 'and', 1);
$db->addWhere('expire_date', 0, '=', 'or', 1);
$db->setGroupConj(1, 'and');
Key::restrictView($db, 'blog');
$total_entries = Blog_User::totalEntries($db);
$limit = PHPWS_Settings::get('blog', 'blog_limit');
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 0;
}
if (!is_numeric($page) || $page < 2) {
$offset = $page = 0;
} else {
$offset = ($page - 1) * $limit;
}
Layout::addStyle('blog');
$result = Blog_User::getEntries($db, $limit, $offset);
if ($page > 0 && empty($result)) {
PHPWS_Core::reroute('blog/action/view/page/1');
}
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
return NULL;
}
if (empty($result)) {
if (Current_User::allow('blog')) {
MiniAdmin::add('blog', PHPWS_Text::secureLink(dgettext('blog', 'Create first blog entry!'), 'blog', array('action' => 'admin', 'command' => 'new')));
}
return NULL;
}
if ($page < 2) {
$past_entries = PHPWS_Settings::get('blog', 'past_entries');
if ($past_entries) {
$db->setLimit($past_entries, $limit);
$past = $db->getObjects('Blog');
if (PHPWS_Error::isError($past)) {
PHPWS_Error::log($past);
} elseif ($past) {
Blog_User::showPast($past);
}
}
}
$rss = false;
foreach ($result as $blog) {
if (!$rss) {
if (PHPWS_Core::moduleExists('rss')) {
PHPWS_Core::initModClass('rss', 'RSS.php');
$key = new Key($blog->key_id);
RSS::showIcon($key);
$rss = true;
}
}
$view = $blog->view();
if (!empty($view)) {
$list[] = $view;
}
}
$page_vars['action'] = 'view';
if ($page > 1) {
$page_vars['page'] = $page - 1;
$tpl['PREV_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Previous page'), 'blog', $page_vars);
if ($limit + $offset < $total_entries) {
$page_vars['page'] = $page + 1;
$tpl['NEXT_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Next page'), 'blog', $page_vars);
}
} elseif ($limit + $offset < $total_entries) {
$page_vars['page'] = 2;
$tpl['NEXT_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Next page'), 'blog', $page_vars);
}
$tpl['ENTRIES'] = implode('', $list);
$content = PHPWS_Template::process($tpl, 'blog', 'list_view.tpl');
if (Current_User::allow('blog', 'edit_blog')) {
Blog_User::miniAdminList();
$vars['action'] = 'admin';
$vars['command'] = 'new';
$link[] = PHPWS_Text::secureLink(dgettext('blog', 'Add new blog'), 'blog', $vars);
MiniAdmin::add('blog', $link);
}
return $content;
}
示例2:
<?php
/**
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
$key = Key::getCurrent();
if (empty($key) || $key->isDummy() || $key->restricted) {
return;
}
PHPWS_Core::initModClass('rss', 'RSS.php');
RSS::showIcon($key);