本文整理汇总了PHP中rss_plugin_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP rss_plugin_hook函数的具体用法?PHP rss_plugin_hook怎么用?PHP rss_plugin_hook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rss_plugin_hook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
rss_plugin_hook('rss.plugins.sidemenu', null);
foreach ($this->items as $item) {
echo "<" . $this->ctnr . ' class="' . $item['class'] . '"' . ' id="sidemenu' . $item['id'] . '"' . ">" . '<a href="#" onclick="' . $item["action"] . '; return false;">' . $item["label"] . '</a>' . "</" . $this->ctnr . ">\n";
}
}
示例2: rss_main_object
function rss_main_object()
{
rss_plugin_hook("rss.plugins.before.mainobject", null);
foreach ($GLOBALS['rss']->mainObject as $o) {
$o->render();
}
}
示例3: rss_itemlist_prerender_callback
function rss_itemlist_prerender_callback()
{
if (isset($GLOBALS['rss']->currentItemList->preRender) && count($GLOBALS['rss']->currentItemList->preRender)) {
foreach ($GLOBALS['rss']->currentItemList->preRender as $prAction) {
list($prAfnct, $prAargs) = $prAction;
call_user_func($prAfnct, $prAargs);
}
}
rss_plugin_hook('rss.plugins.items.beforeitemsimmediate', null);
}
示例4: Navigation
function Navigation()
{
$this->appendNavItem(getPath(), __('<span>H</span>ome'), LOCATION_HOME);
if (!getConfig("rss.config.restrictrefresh")) {
$this->appendNavItem(getPath() . 'update.php', __('<span>R</span>efresh'), LOCATION_UPDATE);
}
$this->appendNavItem(getPath() . 'search.php', __('<span>S</span>earch'), LOCATION_SEARCH);
$this->appendNavItem(getPath() . 'admin/', __('A<span>d</span>min'), LOCATION_ADMIN);
if (($an = rss_plugin_hook('rss.plugins.afternav', null)) != null) {
$this->postRender .= $an;
}
$GLOBALS['rss']->nav = $this;
rss_plugin_hook('rss.plugins.navelements', null);
}
示例5: rss_main_feeds
rss_main_feeds();
?>
<a href="http://haiti.ushahidi.com/"><img src="http://sitroom.ushahididev.com/wp-content/uploads/help-haiti.png"></a>
</div>
<img src="img/logo.png" class="htlogo" >
<?php
rss_errors_render();
rss_plugin_hook('rss.plugins.before.maindiv', rss_main_div_id());
?>
<div <?php
echo rss_main_div_id();
?>
class="frame">
<?php
rss_main_object();
?>
</div>
<div id="footer" class="frame">
<?php
rss_main_footer();
?>
</div>
</div>
<?php
rss_plugin_hook('rss.plugins.bodyend', null);
?>
</body>
</html>
示例6: __exp_itemRatedCB
/**
* this exported AJAX method is only here so that the plugin callback
* hook is asynchronous
*/
function __exp_itemRatedCB($iid, $rt)
{
rss_plugin_hook("rss.plugins.rating.rated", array($iid, $rt));
return null;
}
示例7: readItems
if ($cntUnreadItems == 0 && $cntTotalItems) {
// we showed no unread items
// Should we show some uread items?
if ($cntReadItems == -1) {
readItems($cntTotalItems);
} else {
readItems($cntReadItems);
}
}
} else {
// We are showing read and unread items
if ($cntTotalItems) {
readItems($cntTotalItems - $cntUnreadItems);
}
}
rss_plugin_hook('rss.plugins.frontpage.afterread', null);
$GLOBALS['rss']->header = new Header("", LOCATION_HOME, array('cid' => null, 'fid' => null));
$GLOBALS['rss']->feedList = new FeedList(false);
$GLOBALS['rss']->renderWithTemplate('index.php');
/*
function getHiddenChannelIds() {
static $hiddenIds;
if ($hiddenIds == NULL) {
$sql = "select fk_ref_object_id from " .getTable('properties')
." where domain='feed' and property = 'Hide from front-page'";
$rs = rss_query($sql);
while (list($cid) = rss_fetch_row($rs)) {
$hiddenIds[] = $cid;
}
}
return $hiddenIds;
示例8: rss_plugin_hook
<div class="item">
<?php
rss_plugin_hook("rss.plugins.items.beforetitle", rss_item_id());
?>
<div class="item-title" id="i<?php
echo rss_item_id();
?>
">
<a href="<?php
echo rss_item_url();
?>
" class="item_url" target="_blank"><?php
echo rss_item_title();
?>
</a>
<em>(<?php
echo rss_item_date();
?>
<?php
echo rss_item_author();
?>
)</em>
</div>
<div class="item-body" style="display:none">
<?php
/*<div id="sad<?php echo rss_item_id(); ?>" style="display:none"></div>
<?php if (rss_item_has_enclosure()) { ?>
<h5><?php echo __('Enclosure:'); ?> [<a href="<?php echo rss_item_enclosure(); ?>"><?php echo __('download'); ?></a><?php rss_plugin_hook("rss.plugins.items.enclosure", null); ?>]</h5>
<?php } ?>
<div class="content" id="c<?php echo rss_item_id(); ?>">
<?php echo rss_item_content(); ?>
示例9: rss_plugin_hook
<span><a href="#top">TOP</a></span>
<?php
echo rss_plugin_hook("rss.plugins.footer.span", null);
?>
<span>
<a href="http://gregarius.net/">Gregarius</a> <?php
echo _VERSION_;
echo rss_svn_rev('.');
?>
<!--
<?php
echo __(' powered by ');
?>
<a href="http://php.net">PHP</a>,
<a href="http://magpierss.sourceforge.net/">MagpieRSS</a>,
<a href="http://sourceforge.net/projects/kses">kses</a>,
<a href="http://www.modernmethod.com/sajax/">SAJAX</a>
-->
</span>
<span>
Tentatively valid <a title="Tentatively valid XHTML: the layout validates, but the actual content coming from the feeds I can't do very much." href="http://validator.w3.org/check/referer">XHTML1.0</a>,
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS2.0</a>
</span>
<span style="border-right:none">
<?php
echo __('Last Update');
?>
: <?php
echo rss_footer_last_modif();
?>
</span>
示例10: getThemeMedia
/**
* Returns the theme's "media" component, e.g. 'web',
* 'rss' or 'mobile'.
*/
function getThemeMedia()
{
static $media;
if ($media) {
return $media;
}
// Default to "web".
$media = 'web';
// Has the user specified anything?
if (isset($_GET['rss'])) {
$media = 'rss';
} elseif (isset($_SESSION['mobile']) || isset($_REQUEST['mobile']) || isMobileDevice()) {
$media = 'mobile';
}
// This is here so that auto-detected (e.g. mobile) medias
// can be overridden.
if (isset($_REQUEST['media'])) {
$media = sanitize($_REQUEST['media'], RSS_SANITIZER_WORDS);
}
// Finally: let plugins voice their opinion
$media = rss_plugin_hook('rss.plugins.thememedia', $media);
return $media;
}
示例11: render
function render()
{
$this->javascriptFiles = rss_plugin_hook('rss.plugins.javascript', $this->javascriptFiles);
$GLOBALS['rss']->header =& $this;
rss_require(RSS::getTemplateFile("header.php"));
if ($this->extraHTML) {
echo $this->extraHTML;
}
}
示例12: render
function render()
{
_pf("ItemList -> render()");
if ($this->readCount + $this->unreadCount == 0 && $this->beforeList == "") {
return;
}
$this->rss->currentItemList = $this;
rss_plugin_hook('rss.plugins.items.beforeitems', null);
include $this->rss->getTemplateFile($this->_template);
_pf("done: ItemList -> render()");
rss_plugin_hook('rss.plugins.items.afteritems', null);
}
示例13: add_channel
function add_channel($url, $folderid = 0, $title_ = null, $descr_ = null, $tags = null)
{
if (!$url || strlen($url) <= 7) {
return array(-2, "Invalid URL {$url}");
}
if (!is_numeric($folderid)) {
return array(-2, "Invalid folderid {$folderid}");
}
$url = sanitize(str_replace('&', '&', $url), RSS_SANITIZER_URL);
$urlDB = rss_real_escape_string($url);
//htmlentities($url);
$res = rss_query("select count(*) as channel_exists from " . getTable("channels") . " where url='{$urlDB}'");
list($channel_exists) = rss_fetch_row($res);
if ($channel_exists > 0) {
// fatal
return array(-2, "Looks like you are already subscribed to this channel");
}
$res = rss_query("select 1+max(position) as np from " . getTable("channels"));
list($np) = rss_fetch_row($res);
if (!$np) {
$np = "0";
}
// Here we go!
//error_reporting(E_ALL);
$old_level = error_reporting(E_ERROR);
$rss = fetch_rss($url);
error_reporting($old_level);
if ($rss) {
if ($title_) {
$title = rss_real_escape_string($title_);
} elseif (is_object($rss) && array_key_exists('title#', $rss->channel)) {
if (array_key_exists('title', $rss->channel)) {
$title = rss_real_escape_string($rss->channel['title']);
} else {
$title = " ";
}
} else {
$title = "";
}
if (is_object($rss) && array_key_exists('link', $rss->channel)) {
$siteurl = rss_real_escape_string(htmlentities($rss->channel['link']));
} else {
$siteurl = "";
}
$refreshinterval = 0;
if (is_object($rss) && array_key_exists('syn', $rss->channel)) {
$syn = $rss->channel['syn'];
if (array_key_exists('updateperiod', $syn)) {
if ("hourly" == $syn['updateperiod']) {
if (array_key_exists('updatefrequency', $syn)) {
$refreshinterval = 60 * $syn['updatefrequency'];
}
}
}
}
if ($descr_) {
$descr = rss_real_escape_string($descr_);
} elseif (is_object($rss) && array_key_exists('description', $rss->channel)) {
$descr = rss_real_escape_string($rss->channel['description']);
} else {
$descr = "";
}
//lets see if this server has a favicon
$icon = "";
if (getConfig('rss.output.showfavicons')) {
// if we got nothing so far, lets try to fall back to
// favicons
if ($icon == "" && $siteurl != "") {
$match = get_host($siteurl, $host);
$uri = "http://" . $host . "favicon.ico";
if ($match && getContentType($uri, $contentType)) {
if (preg_match("/image\\/x-icon/", $contentType)) {
$icon = $uri;
}
}
}
}
$private = preg_match('|(https?://)([^:]+:[^@]+@)(.+)$|', $url);
if ($title != "") {
$title = strip_tags($title);
$descr = strip_tags($descr);
// add channel to root folder by default
if (!$folderid) {
$folderid = getRootFolder();
}
list($title, $urlDB, $siteurl, $folderid, $descr, $icon) = rss_plugin_hook('rss.plugins.feed.new', array($title, $urlDB, $siteurl, $folderid, $descr, $icon));
$mode = RSS_MODE_UNREAD_STATE;
if ($private) {
$mode |= RSS_MODE_PRIVATE_STATE;
}
$sql = "insert into " . getTable("channels") . " (title, url, siteurl, parent, descr, dateadded, icon, position, mode, daterefreshed)" . " values ('{$title}', '{$urlDB}', '{$siteurl}', {$folderid}, '{$descr}', now(), '{$icon}', {$np}, {$mode}, '0000-00-00 00:00:00')";
rss_query($sql);
$newid = rss_insert_id();
if ($icon && cacheFavicon($icon)) {
rss_query("update " . getTable("channels") . " set icon='blob:" . $icon . "'" . " where id={$newid}");
}
if ($tags != "") {
__exp__submitTag($newid, $tags, "'channel'");
}
if (false == empty($refreshinterval)) {
//.........这里部分代码省略.........
示例14: getPath
echo $title;
?>
</h2>
<?php
if (hidePrivate()) {
?>
<p>(<a href="<?php
echo getPath();
?>
?mobilelogin&media=mobile">Login</a> to mark items read)</p>
<?php
}
?>
<form method="post" action="<?php
print getPath();
?>
">
<?php
}
rss_itemlist_feeds();
if (!isMobileDevice()) {
?>
<input type='hidden' name='mobile' />
<?php
}
?>
<p id="nextitems"><input type='submit' value='Next »»' /></p>
</form>
<?php
rss_plugin_hook('rss.plugins.bodyend.media', getThemeMedia());
示例15: cleanUp
function cleanUp($newIds, $ignorePrivate = false)
{
if (!hidePrivate() || $ignorePrivate) {
if (count($newIds) > 0 && getConfig('rss.config.markreadonupdate')) {
rss_query("update " . getTable("item") . " set unread = unread & " . SET_MODE_READ_STATE . " where unread & " . RSS_MODE_UNREAD_STATE . " and id not in (" . implode(",", $newIds) . ")");
}
}
setProperty('__meta__', 'meta.lastupdate', 'misc', time());
if (count($newIds) > 0) {
rss_invalidate_cache();
}
rss_plugin_hook('rss.plugins.updates.after', null);
}