本文整理汇总了PHP中PluginHost::feed_to_pfeed_id方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginHost::feed_to_pfeed_id方法的具体用法?PHP PluginHost::feed_to_pfeed_id怎么用?PHP PluginHost::feed_to_pfeed_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginHost
的用法示例。
在下文中一共展示了PluginHost::feed_to_pfeed_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format_headlines_list
private function format_headlines_list($feed, $method, $view_mode, $limit, $cat_view, $next_unread_feed, $offset, $vgr_last_feed = false, $override_order = false, $include_children = false)
{
if (isset($_REQUEST["DevForceUpdate"])) {
header("Content-Type: text/plain; charset=utf-8");
}
$disable_cache = false;
$reply = array();
$rgba_cache = array();
$timing_info = microtime(true);
$topmost_article_ids = array();
if (!$offset) {
$offset = 0;
}
if ($method == "undefined") {
$method = "";
}
$method_split = explode(":", $method);
if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
// Update the feed if required with some basic flood control
$result = $this->dbh->query("SELECT cache_images," . SUBSTRING_FOR_DATE . "(last_updated,1,19) AS last_updated\n\t\t\t\t\tFROM ttrss_feeds WHERE id = '{$feed}'");
if ($this->dbh->num_rows($result) != 0) {
$last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated"));
$cache_images = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "cache_images"));
if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) {
include "rssfuncs.php";
update_rss_feed($feed, true, true);
} else {
$this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'\n\t\t\t\t\t\t\tWHERE id = '{$feed}'");
}
}
}
if ($method_split[0] == "MarkAllReadGR") {
catchup_feed($method_split[1], false);
}
// FIXME: might break tag display?
if (is_numeric($feed) && $feed > 0 && !$cat_view) {
$result = $this->dbh->query("SELECT id FROM ttrss_feeds WHERE id = '{$feed}' LIMIT 1");
if ($this->dbh->num_rows($result) == 0) {
$reply['content'] = "<div align='center'>" . __('Feed not found.') . "</div>";
}
}
@($search = $this->dbh->escape_string($_REQUEST["query"]));
if ($search) {
$disable_cache = true;
}
@($search_mode = $this->dbh->escape_string($_REQUEST["search_mode"]));
if ($_REQUEST["debug"]) {
$timing_info = print_checkpoint("H0", $timing_info);
}
// error_log("format_headlines_list: [" . $feed . "] method [" . $method . "]");
if ($search_mode == '' && $method != '') {
$search_mode = $method;
}
// error_log("search_mode: " . $search_mode);
if (!$cat_view && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) {
$handler = PluginHost::getInstance()->get_feed_handler(PluginHost::feed_to_pfeed_id($feed));
// function queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
if ($handler) {
$options = array("limit" => $limit, "view_mode" => $view_mode, "cat_view" => $cat_view, "search" => $search, "search_mode" => $search_mode, "override_order" => $override_order, "offset" => $offset, "owner_uid" => $_SESSION["uid"], "filter" => false, "since_id" => 0, "include_children" => $include_children);
$qfh_ret = $handler->get_headlines(PluginHost::feed_to_pfeed_id($feed), $options);
}
} else {
$qfh_ret = queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order, $offset, 0, false, 0, $include_children);
}
$vfeed_group_enabled = get_pref("VFEED_GROUP_BY_FEED") && $feed != -6;
if ($_REQUEST["debug"]) {
$timing_info = print_checkpoint("H1", $timing_info);
}
$result = $qfh_ret[0];
$feed_title = $qfh_ret[1];
$feed_site_url = $qfh_ret[2];
$last_error = $qfh_ret[3];
$last_updated = strpos($qfh_ret[4], '1970-') === FALSE ? make_local_datetime($qfh_ret[4], false) : __("Never");
$highlight_words = $qfh_ret[5];
$vgroup_last_feed = $vgr_last_feed;
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url, $feed_title, $feed, $cat_view, $search, $search_mode, $view_mode, $last_error, $last_updated);
$headlines_count = $this->dbh->num_rows($result);
/* if (get_pref('COMBINED_DISPLAY_MODE')) {
$button_plugins = array();
foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
$pclass = "button_" . trim($p);
if (class_exists($pclass)) {
$plugin = new $pclass();
array_push($button_plugins, $plugin);
}
}
} */
if ($offset == 0) {
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINES_BEFORE) as $p) {
$reply['content'] .= $p->hook_headlines_before($feed, $cat_view, $qfh_ret);
}
}
if ($this->dbh->num_rows($result) > 0) {
$lnum = $offset;
$num_unread = 0;
$cur_feed_title = '';
if ($_REQUEST["debug"]) {
$timing_info = print_checkpoint("PS", $timing_info);
}
//.........这里部分代码省略.........