本文整理汇总了PHP中getFeedTitle函数的典型用法代码示例。如果您正苦于以下问题:PHP getFeedTitle函数的具体用法?PHP getFeedTitle怎么用?PHP getFeedTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFeedTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_prefs_tab
function hook_prefs_tab($args)
{
if ($args != "prefFeeds") {
return;
}
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('af_readability settings') . "\">";
print_notice("Enable the plugin for specific feeds in the feed editor.");
print "<form dojoType=\"dijit.form.Form\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\tevt.preventDefault();\n\t\t\tif (this.validate()) {\n\t\t\t\tconsole.log(dojo.objectToQuery(this.getValues()));\n\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\tnotify_info(transport.responseText);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//this.reset();\n\t\t\t}\n\t\t\t</script>";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"af_readability\">";
$enable_share_anything = $this->host->get($this, "enable_share_anything");
$enable_share_anything_checked = $enable_share_anything ? "checked" : "";
print "<input dojoType=\"dijit.form.CheckBox\"\n\t\t\t{$enable_share_anything_checked} name=\"enable_share_anything\" id=\"enable_share_anything\">\n\t\t\t<label for=\"enable_share_anything\">" . __("Use Readability for pages shared via bookmarklet.") . "</label>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Save") . "</button>";
print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds");
if (!is_array($enabled_feeds)) {
$enabled_feeds = array();
}
$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
$this->host->set($this, "enabled_feeds", $enabled_feeds);
if (count($enabled_feeds) > 0) {
print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>";
print "<ul class=\"browseFeedList\" style=\"border-width : 1px\">";
foreach ($enabled_feeds as $f) {
print "<li>" . "<img src='images/pub_set.png'\n\t\t\t\t\t\tstyle='vertical-align : middle'> <a href='#'\n\t\t\t\t\t\tonclick='editFeed({$f})'>" . getFeedTitle($f) . "</a></li>";
}
print "</ul>";
}
print "</div>";
}
示例2: filter_test
function filter_test($filter_type, $reg_exp, $action_id, $action_param, $filter_param, $inverse, $feed_id, $cat_id, $cat_filter)
{
$result = db_query($this->link, "SELECT name FROM ttrss_filter_types WHERE\n\t\t\tid = " . $filter_type);
$type_name = db_fetch_result($result, 0, "name");
$result = db_query($this->link, "SELECT name FROM ttrss_filter_actions WHERE\n\t\t\tid = " . $action_id);
$action_name = db_fetch_result($result, 0, "name");
$filter["reg_exp"] = $reg_exp;
$filter["action"] = $action_name;
$filter["type"] = $type_name;
$filter["action_param"] = $action_param;
$filter["filter_param"] = $filter_param;
$filter["inverse"] = $inverse;
$filters[$type_name] = array($filter);
if ($feed_id) {
$feed = $feed_id;
} else {
$feed = -4;
}
$regexp_valid = preg_match('/' . $filter['reg_exp'] . '/', $filter['reg_exp']) !== FALSE;
print __("Articles matching this filter:");
print "<div class=\"filterTestHolder\">";
print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
if ($regexp_valid) {
$feed_title = getFeedTitle($this->link, $feed);
$qfh_ret = queryFeedHeadlines($this->link, $cat_filter ? $cat_id : $feed, 30, "", $cat_filter, false, false, false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
$result = $qfh_ret[0];
$articles = array();
$found = 0;
while ($line = db_fetch_assoc($result)) {
$entry_timestamp = strtotime($line["updated"]);
$entry_tags = get_article_tags($this->link, $line["id"], $_SESSION["uid"]);
$content_preview = truncate_string(strip_tags($line["content_preview"]), 100, '...');
if ($line["feed_title"]) {
$feed_title = $line["feed_title"];
}
print "<tr>";
print "<td width='5%' align='center'><input\n\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" checked=\"1\"\n\t\t\t\t\tdisabled=\"1\" type=\"checkbox\"></td>";
print "<td>";
print $line["title"];
print " (";
print "<b>" . $feed_title . "</b>";
print "): ";
print "<span class=\"insensitive\">" . $content_preview . "</span>";
print " " . mb_substr($line["date_entered"], 0, 16);
print "</td></tr>";
$found++;
}
if ($found == 0) {
print "<tr><td align='center'>" . __("No articles matching this filter has been found.") . "</td></tr>";
}
} else {
print "<tr><td align='center' class='error'>" . __("Invalid regular expression.") . "</td></tr>";
}
print "</table>";
print "</div>";
}
示例3: digestupdate
function digestupdate()
{
$feed_id = db_escape_string($_REQUEST['feed_id']);
$offset = db_escape_string($_REQUEST['offset']);
$seq = db_escape_string($_REQUEST['seq']);
if (!$feed_id) {
$feed_id = -4;
}
if (!$offset) {
$offset = 0;
}
$reply = array();
$reply['seq'] = $seq;
$headlines = API::api_get_headlines($this->link, $feed_id, 30, $offset, '', $feed_id == -4, true, false, "unread", "updated DESC", 0, 0);
$reply['headlines'] = array();
$reply['headlines']['title'] = getFeedTitle($this->link, $feed_id);
$reply['headlines']['content'] = $headlines;
print json_encode($reply);
}
示例4: feedlist_init_feed
private function feedlist_init_feed($feed_id, $title = false, $unread = false, $error = '', $updated = '')
{
$obj = array();
$feed_id = (int) $feed_id;
if (!$title) {
$title = getFeedTitle($this->link, $feed_id, false);
}
if ($unread === false) {
$unread = getFeedUnread($this->link, $feed_id, false);
}
$obj['id'] = 'FEED:' . $feed_id;
$obj['name'] = $title;
$obj['unread'] = (int) $unread;
$obj['type'] = 'feed';
$obj['error'] = $error;
$obj['updated'] = $updated;
$obj['icon'] = getFeedIcon($feed_id);
$obj['bare_id'] = $feed_id;
return $obj;
}
示例5: hook_prefs_tab
function hook_prefs_tab($args)
{
if ($args != "prefFeeds") {
return;
}
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('af_readability settings') . "\">";
print_notice("Enable the plugin for specific feeds in the feed editor.");
$enabled_feeds = $this->host->get($this, "enabled_feeds");
if (!array($enabled_feeds)) {
$enabled_feeds = array();
}
$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
$this->host->set($this, "enabled_feeds", $enabled_feeds);
if (count($enabled_feeds) > 0) {
print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>";
print "<ul class=\"browseFeedList\" style=\"border-width : 1px\">";
foreach ($enabled_feeds as $f) {
print "<li>" . "<img src='images/pub_set.png'\n\t\t\t\t\t\tstyle='vertical-align : middle'> <a href='#'\n\t\t\t\t\t\tonclick='editFeed({$f})'>" . getFeedTitle($f) . "</a></li>";
}
print "</ul>";
}
print "</div>";
}
示例6: queryFeedHeadlines
//.........这里部分代码省略.........
}
}
}
}
if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
$date_sort_field = "updated";
} else {
$date_sort_field = "date_entered";
}
if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$order_by = "{$date_sort_field}";
} else {
$order_by = "{$date_sort_field} DESC";
}
if ($view_mode != "noscores") {
$order_by = "score DESC, {$order_by}";
}
if ($override_order) {
$order_by = $override_order;
}
$feed_title = "";
if ($search) {
$feed_title = T_sprintf("Search results: %s", $search);
} else {
if ($cat_view) {
$feed_title = getCategoryTitle($link, $feed);
} else {
if (is_numeric($feed) && $feed > 0) {
$result = db_query($link, "SELECT title,site_url,last_error\n\t\t\t\t\t\t\tFROM ttrss_feeds WHERE id = '{$feed}' AND owner_uid = {$owner_uid}");
$feed_title = db_fetch_result($result, 0, "title");
$feed_site_url = db_fetch_result($result, 0, "site_url");
$last_error = db_fetch_result($result, 0, "last_error");
} else {
$feed_title = getFeedTitle($link, $feed);
}
}
}
$content_query_part = "content as content_preview, cached_content, ";
if (is_numeric($feed)) {
if ($feed >= 0) {
$feed_kind = "Feeds";
} else {
$feed_kind = "Labels";
}
if ($limit_query_part) {
$offset_query_part = "OFFSET {$offset}";
}
// proper override_order applied above
if ($vfeed_query_part && !$ignore_vfeed_group && get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) {
if (!$override_order) {
$order_by = "ttrss_feeds.title, {$order_by}";
} else {
$order_by = "ttrss_feeds.title, {$override_order}";
}
}
if (!$allow_archived) {
$from_qpart = "ttrss_entries,ttrss_user_entries,ttrss_feeds{$ext_tables_part}";
$feed_check_qpart = "ttrss_user_entries.feed_id = ttrss_feeds.id AND";
} else {
$from_qpart = "ttrss_entries{$ext_tables_part},ttrss_user_entries\n\t\t\t\t\t\tLEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)";
}
$query = "SELECT DISTINCT\n\t\t\t\t\t\tdate_entered,\n\t\t\t\t\t\tguid,\n\t\t\t\t\t\tttrss_entries.id,ttrss_entries.title,\n\t\t\t\t\t\tupdated,\n\t\t\t\t\t\tlabel_cache,\n\t\t\t\t\t\ttag_cache,\n\t\t\t\t\t\talways_display_enclosures,\n\t\t\t\t\t\tsite_url,\n\t\t\t\t\t\tnote,\n\t\t\t\t\t\tnum_comments,\n\t\t\t\t\t\tcomments,\n\t\t\t\t\t\tint_id,\n\t\t\t\t\t\tunread,feed_id,marked,published,link,last_read,orig_feed_id,\n\t\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms,\n\t\t\t\t\t\t{$vfeed_query_part}\n\t\t\t\t\t\t{$content_query_part}\n\t\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,19) as updated_noms,\n\t\t\t\t\t\tauthor,score\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{$from_qpart}\n\t\t\t\t\tWHERE\n\t\t\t\t\t{$feed_check_qpart}\n\t\t\t\t\tttrss_user_entries.ref_id = ttrss_entries.id AND\n\t\t\t\t\tttrss_user_entries.owner_uid = '{$owner_uid}' AND\n\t\t\t\t\t{$search_query_part}\n\t\t\t\t\t{$filter_query_part}\n\t\t\t\t\t{$view_query_part}\n\t\t\t\t\t{$since_id_part}\n\t\t\t\t\t{$query_strategy_part} ORDER BY {$order_by}\n\t\t\t\t\t{$limit_query_part} {$offset_query_part}";
if ($_REQUEST["debug"]) {
print $query;
}
$result = db_query($link, $query);
示例7: getRuleName
private function getRuleName($rule)
{
if (!$rule) {
$rule = json_decode($_REQUEST["rule"], true);
}
$feed_id = $rule["feed_id"];
if (strpos($feed_id, "CAT:") === 0) {
$feed_id = (int) substr($feed_id, 4);
$feed = getCategoryTitle($feed_id);
} else {
$feed_id = (int) $feed_id;
if ($rule["feed_id"]) {
$feed = getFeedTitle((int) $rule["feed_id"]);
} else {
$feed = __("All feeds");
}
}
$result = $this->dbh->query("SELECT description FROM ttrss_filter_types\n\t\t\tWHERE id = " . (int) $rule["filter_type"]);
$filter_type = $this->dbh->fetch_result($result, 0, "description");
return T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]), $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "");
}
示例8: search
function search()
{
$this->params = explode(":", $this->dbh->escape_string($_REQUEST["param"]), 2);
$active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false";
print "<div class=\"dlgSec\">" . __('Look for') . "</div>";
print "<div class=\"dlgSecCont\">";
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\tstyle=\"font-size : 16px; width : 20em;\"\n\t\t\trequired=\"1\" name=\"query\" type=\"search\" value=''>";
print "<hr/>" . __('Limit search to:') . " ";
print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\">\n\t\t\t<option value=\"all_feeds\">" . __('All feeds') . "</option>";
$feed_title = getFeedTitle($active_feed_id);
if (!$is_cat) {
$feed_cat_title = getFeedCatTitle($active_feed_id);
} else {
$feed_cat_title = getCategoryTitle($active_feed_id);
}
if ($active_feed_id && !$is_cat) {
print "<option selected=\"1\" value=\"this_feed\">{$feed_title}</option>";
} else {
print "<option disabled=\"1\" value=\"false\">" . __('This feed') . "</option>";
}
if ($is_cat) {
$cat_preselected = "selected=\"1\"";
}
if (get_pref('ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
print "<option {$cat_preselected} value=\"this_cat\">{$feed_cat_title}</option>";
} else {
//print "<option disabled>".__('This category')."</option>";
}
print "</select>";
print "</div>";
print "<div class=\"dlgButtons\">";
if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">\n\t\t\t\t<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">" . __("Search syntax") . "</a>\n\t\t\t\t</div>";
}
print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">" . __('Search') . "</button>\n\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">" . __('Cancel') . "</button>\n\t\t</div>";
}
示例9: hook_prefs_tab
function hook_prefs_tab($args)
{
if ($args != "prefFeeds") {
return;
}
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Mark similar articles as read') . "\">";
if (DB_TYPE != "pgsql") {
print_error("Database type not supported.");
}
$result = db_query("select 'similarity'::regproc");
if (db_num_rows($result) == 0) {
print_error("pg_trgm extension not found.");
}
$similarity = $this->host->get($this, "similarity");
$min_title_length = $this->host->get($this, "min_title_length");
$enable_globally = $this->host->get($this, "enable_globally");
if (!$similarity) {
$similarity = '0.75';
}
if (!$min_title_length) {
$min_title_length = '32';
}
$enable_globally_checked = $enable_globally ? "checked" : "";
print "<form dojoType=\"dijit.form.Form\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\tevt.preventDefault();\n\t\t\tif (this.validate()) {\n\t\t\t\tconsole.log(dojo.objectToQuery(this.getValues()));\n\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\tnotify_info(transport.responseText);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//this.reset();\n\t\t\t}\n\t\t\t</script>";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"af_psql_trgm\">";
print_notice("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.");
print "<br/>";
print_notice("Enable the plugin for specific feeds in the feed editor.");
print "<h3>" . __("Global settings") . "</h3>";
print "<table>";
print "<tr><td width=\"40%\">" . __("Minimum similarity:") . "</td>";
print "<td>\n\t\t\t<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\tplaceholder=\"0.75\"\n\t\t\trequired=\"1\" name=\"similarity\" value=\"{$similarity}\"></td></tr>";
print "<tr><td width=\"40%\">" . __("Minimum title length:") . "</td>";
print "<td>\n\t\t\t<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\tplaceholder=\"32\"\n\t\t\trequired=\"1\" name=\"min_title_length\" value=\"{$min_title_length}\"></td></tr>";
print "<tr><td width=\"40%\">" . __("Enable for all feeds:") . "</td>";
print "<td>\n\t\t\t<input dojoType=\"dijit.form.CheckBox\"\n\t\t\t{$enable_globally_checked} name=\"enable_globally\"></td></tr>";
print "</table>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Save") . "</button>";
print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds");
if (!array($enabled_feeds)) {
$enabled_feeds = array();
}
$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
$this->host->set($this, "enabled_feeds", $enabled_feeds);
if (count($enabled_feeds) > 0) {
print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>";
print "<ul class=\"browseFeedList\" style=\"border-width : 1px\">";
foreach ($enabled_feeds as $f) {
print "<li>" . "<img src='images/pub_set.png'\n\t\t\t\t\t\tstyle='vertical-align : middle'> <a href='#'\n\t\t\t\t\t\tonclick='editFeed({$f})'>" . getFeedTitle($f) . "</a></li>";
}
print "</ul>";
}
print "</div>";
}
示例10: getRuleName
private function getRuleName($rule)
{
if (!$rule) {
$rule = json_decode($_REQUEST["rule"], true);
}
$feed_id = $rule["feed_id"];
if (strpos($feed_id, "CAT:") === 0) {
$feed_id = (int) substr($feed_id, 4);
$feed = getCategoryTitle($this->link, $feed_id);
} else {
$feed_id = (int) $feed_id;
if ($rule["feed_id"]) {
$feed = getFeedTitle($this->link, (int) $rule["feed_id"]);
} else {
$feed = __("All feeds");
}
}
$result = db_query($this->link, "SELECT description FROM ttrss_filter_types\n\t\t\tWHERE id = " . (int) $rule["filter_type"]);
$match_on = db_fetch_result($result, 0, "description");
return T_sprintf("%s on %s in %s", $rule["reg_exp"], $match_on, $feed);
}
示例11: count
<?php
$fd = $facebook_data['data'];
$arrLen = count($fd);
for ($i = 0; $i < $arrLen; $i++) {
print PHP_EOL . ' <entry>' . PHP_EOL;
print ' <id>tag:facebook.com,' . date("Y-m-d", strtotime($fd[$i]['created_time'])) . ':/' . $fd[$i]['from']['name'] . '/statuses/' . $fd[$i]['id'] . '</id>' . PHP_EOL;
if (isset($fd[$i]['link']) && $fd[$i]['type'] == 'photo') {
print ' <link href="' . $fd[$i]['link'] . '" rel="alternate" type="text/html"/>' . PHP_EOL;
} else {
print ' <link href="http://facebook.com/' . $fd[$i]['id'] . '" rel="alternate" type="text/html"/>' . PHP_EOL;
}
print ' <title>' . getFeedTitle($fd[$i]) . '</title>' . PHP_EOL;
-(print ' <summary type="html"><![CDATA[' . $fd[$i]['message'] . ']]></summary>' . PHP_EOL);
$text = ' <content type="html"><![CDATA[<p>' . processString(nl2br($fd[$i]['message'] . ' ' . $fd[$i]['link'])) . '</p>' . (isset($fd[$i]['picture']) ? '<img src="' . $fd[$i]['picture'] . '"/>' : '') . ']]></content>';
print $text . PHP_EOL;
print ' <pubdate>' . date('c', strtotime($fd[$i]['created_time'])) . '</pubdate>' . PHP_EOL;
print ' <updated>' . date('c', strtotime($fd[$i]['updated_time'])) . '</updated>' . PHP_EOL;
print ' <author><name>' . $fd[$i]['from']['name'] . '</name></author>' . PHP_EOL;
print ' </entry>' . PHP_EOL;
}
print '</feed>' . PHP_EOL;
print '<!-- vim:ft=xml -->';
function getFeedTitle($feed)
{
$title = "";
if (isset($feed['message'])) {
appendStringToTitle($feed['message'], $title);
}
if (isset($feed['link']) && isset($feed['name'])) {
appendStringToTitle($feed['name'], $title);
示例12: getLabelCounters
if (!$cat_id || $cat_id == -2) {
$counters = getLabelCounters($link, true);
foreach (array_keys($counters) as $id) {
$unread = $counters[$id]["counter"];
if ($unread || !$unread_only) {
$row = array("id" => $id, "title" => $counters[$id]["description"], "unread" => $counters[$id]["counter"], "cat_id" => -2);
array_push($feeds, $row);
}
}
}
/* Virtual feeds */
if (!$cat_id || $cat_id == -1) {
foreach (array(-1, -2, -3, -4, 0) as $i) {
$unread = getFeedUnread($link, $i);
if ($unread || !$unread_only) {
$title = getFeedTitle($link, $i);
$row = array("id" => $i, "title" => $title, "unread" => $unread, "cat_id" => -1);
array_push($feeds, $row);
}
}
}
print json_encode($feeds);
break;
case "getCategories":
$unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
$result = db_query($link, "SELECT \n\t\t\t\t\tid, title FROM ttrss_feed_categories \n\t\t\t\tWHERE owner_uid = " . $_SESSION["uid"]);
$cats = array();
while ($line = db_fetch_assoc($result)) {
$unread = getFeedUnread($link, $line["id"], true);
if ($unread || !$unread_only) {
array_push($cats, array("id" => $line["id"], "title" => $line["title"], "unread" => $unread));
示例13: queryFeedHeadlines
//.........这里部分代码省略.........
$ext_tables_part = ",ttrss_labels2,ttrss_user_labels2";
$query_strategy_part = "ttrss_labels2.id = ttrss_user_labels2.label_id AND\n\t\t\t\t\t\tttrss_user_labels2.article_id = ref_id";
}
} else {
if ($feed == -3) {
// fresh virtual feed
$query_strategy_part = "unread = true";
$intl = get_pref($link, "FRESH_ARTICLE_MAX_AGE", $owner_uid);
if (DB_TYPE == "pgsql") {
$query_strategy_part .= " AND updated > NOW() - INTERVAL '{$intl} hour' ";
} else {
$query_strategy_part .= " AND updated > DATE_SUB(NOW(), INTERVAL {$intl} HOUR) ";
}
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} else {
if ($feed == -4) {
// all articles virtual feed
$query_strategy_part = "true";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} else {
if ($feed <= -10) {
// labels
$label_id = -$feed - 11;
$query_strategy_part = "label_id = '{$label_id}' AND\n\t\t\t\t\tttrss_labels2.id = ttrss_user_labels2.label_id AND\n\t\t\t\t\tttrss_user_labels2.article_id = ref_id";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$ext_tables_part = ",ttrss_labels2,ttrss_user_labels2";
} else {
$query_strategy_part = "id > 0";
// dumb
}
}
}
}
}
}
}
}
}
}
if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$order_by = "updated";
} else {
$order_by = "updated DESC";
}
if ($view_mode != "noscores") {
$order_by = "score DESC, {$order_by}";
}
if ($override_order) {
$order_by = $override_order;
}
$feed_title = "";
if ($search) {
$feed_title = "Search results";
} else {
if ($cat_view) {
$feed_title = getCategoryTitle($link, $feed);
} else {
if ((int) $feed == $feed && $feed > 0) {
$result = db_query($link, "SELECT title,site_url,last_error \n\t\t\t\t\t\t\tFROM ttrss_feeds WHERE id = '{$feed}' AND owner_uid = {$owner_uid}");
$feed_title = db_fetch_result($result, 0, "title");
$feed_site_url = db_fetch_result($result, 0, "site_url");
$last_error = db_fetch_result($result, 0, "last_error");
} else {
$feed_title = getFeedTitle($link, $feed);
}
}
}
$content_query_part = "content as content_preview,";
if (preg_match("/^-?[0-9][0-9]*\$/", $feed) != false) {
if ($feed >= 0) {
$feed_kind = "Feeds";
} else {
$feed_kind = "Labels";
}
if ($limit_query_part) {
$offset_query_part = "OFFSET {$offset}";
}
if ($vfeed_query_part && get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) {
if (!$override_order) {
$order_by = "ttrss_feeds.title, {$order_by}";
}
}
if ($feed != "0") {
$from_qpart = "ttrss_entries,ttrss_user_entries,ttrss_feeds{$ext_tables_part}";
$feed_check_qpart = "ttrss_user_entries.feed_id = ttrss_feeds.id AND";
} else {
$from_qpart = "ttrss_entries,ttrss_user_entries{$ext_tables_part}\n\t\t\t\t\t\tLEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)";
}
$query = "SELECT DISTINCT \n\t\t\t\t\t\tguid,\n\t\t\t\t\t\tttrss_entries.id,ttrss_entries.title,\n\t\t\t\t\t\tupdated,\n\t\t\t\t\t\tnote,\n\t\t\t\t\t\tunread,feed_id,marked,published,link,last_read,orig_feed_id,\n\t\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms,\n\t\t\t\t\t\t{$vfeed_query_part}\n\t\t\t\t\t\t{$content_query_part}\n\t\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,19) as updated_noms,\n\t\t\t\t\t\tauthor,score\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{$from_qpart}\n\t\t\t\t\tWHERE\n\t\t\t\t\t{$group_limit_part}\n\t\t\t\t\t{$feed_check_qpart}\n\t\t\t\t\tttrss_user_entries.ref_id = ttrss_entries.id AND\n\t\t\t\t\tttrss_user_entries.owner_uid = '{$owner_uid}' AND\n\t\t\t\t\t{$search_query_part}\n\t\t\t\t\t{$view_query_part}\n\t\t\t\t\t{$query_strategy_part} ORDER BY {$order_by}\n\t\t\t\t\t{$limit_query_part} {$offset_query_part}";
if ($_REQUEST["debug"]) {
print $query;
}
$result = db_query($link, $query);
} else {
// browsing by tag
$feed_kind = "Tags";
$result = db_query($link, "SELECT\n\t\t\t\t\tguid,\n\t\t\t\t\tnote,\n\t\t\t\t\tttrss_entries.id as id,title,\n\t\t\t\t\tupdated,\n\t\t\t\t\tunread,feed_id,orig_feed_id,\n\t\t\t\t\tmarked,link,last_read,\t\t\t\t\n\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms,\n\t\t\t\t\t{$vfeed_query_part}\n\t\t\t\t\t{$content_query_part}\n\t\t\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,19) as updated_noms,\n\t\t\t\t\tscore\n\t\t\t\t\tFROM\n\t\t\t\t\t\tttrss_entries,ttrss_user_entries,ttrss_tags\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tref_id = ttrss_entries.id AND \n\t\t\t\t\t\tttrss_user_entries.owner_uid = '{$owner_uid}' AND\n\t\t\t\t\t\tpost_int_id = int_id AND tag_name = '{$feed}' AND\n\t\t\t\t\t\t{$view_query_part}\n\t\t\t\t\t\t{$search_query_part}\n\t\t\t\t\t\t{$query_strategy_part} ORDER BY {$order_by}\n\t\t\t\t\t{$limit_query_part}");
}
return array($result, $feed_title, $feed_site_url, $last_error);
}
示例14: render_search_form
function render_search_form($link, $active_feed_id = false, $is_cat = false)
{
print "<div id=\"heading\">";
print __("Search") . " <span id=\"headingAddon\">\n\t\t\t\t(<a href=\"index.php\">" . __("Go back") . "</a>)</span></div>";
print "<form method=\"GET\" action=\"index.php\" class=\"searchForm\">";
print "<input type=\"hidden\" name=\"go\" value=\"vf\">";
print "<input type=\"hidden\" name=\"id\" value=\"{$active_feed_id}\">";
print "<input type=\"hidden\" name=\"cat\" value=\"{$is_cat}\">";
print "<table><tr><td>" . __('Search:') . "</td><td>";
print "<input name=\"query\"></td></tr>";
print "<tr><td>" . __('Where:') . "</td><td>";
print "<select name=\"search_mode\">\n\t\t\t<option value=\"all_feeds\">" . __('All feeds') . "</option>";
$feed_title = getFeedTitle($link, $active_feed_id);
if (!$is_cat) {
$feed_cat_title = getFeedCatTitle($link, $active_feed_id);
} else {
$feed_cat_title = getCategoryTitle($link, $active_feed_id);
}
if ($active_feed_id && !$is_cat) {
print "<option selected value=\"this_feed\">{$feed_title}</option>";
} else {
print "<option disabled>" . __('This feed') . "</option>";
}
if ($is_cat) {
$cat_preselected = "selected";
}
if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
print "<option {$cat_preselected} value=\"this_cat\">{$feed_cat_title}</option>";
} else {
//print "<option disabled>".__('This category')."</option>";
}
print "</select></td></tr>";
print "<tr><td>" . __('Match on:') . "</td><td>";
$search_fields = array("title" => __("Title"), "content" => __("Content"), "both" => __("Title or content"));
print_select_hash("match_on", 3, $search_fields);
print "</td></tr></table>";
print "<input type=\"submit\" value=\"" . __('Search') . "\">";
print "</form>";
print "</div>";
}
示例15: render_article
function render_article($link, $id, $feed_id, $cat_id)
{
$query = "SELECT title,link,content,feed_id,comments,int_id,\n\t\t\tmarked,unread,published,\n\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,16) as updated,\n\t\t\tauthor\n\t\t\tFROM ttrss_entries,ttrss_user_entries\n\t\t\tWHERE\tid = '{$id}' AND ref_id = id AND owner_uid = " . $_SESSION["uid"];
$result = db_query($link, $query);
if (db_num_rows($result) != 0) {
$line = db_fetch_assoc($result);
$tmp_result = db_query($link, "UPDATE ttrss_user_entries \n\t\t\t\tSET unread = false,last_read = NOW() \n\t\t\t\tWHERE ref_id = '{$id}'\n\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
if (get_pref($link, 'HEADLINES_SMART_DATE')) {
$updated_fmt = smart_date_time(strtotime($line["updated"]));
} else {
$short_date = get_pref($link, 'SHORT_DATE_FORMAT');
$updated_fmt = date($short_date, strtotime($line["updated"]));
}
$title = $line["title"];
$article_link = $line["link"];
$feed_title = getFeedTitle($link, $feed_id, false);
print "<div class=\"panel\" id=\"article-{$id}\" title=\"{$title}\" \n\t\t\t\tselected=\"true\"\n\t\t\t\tmyBackLabel='{$feed_title}' myBackHref='feed.php?id={$feed_id}&cat={$cat_id}'>";
print "<h2><a target='_blank' href='{$article_link}'>{$title}</a></h2>";
print "<fieldset>";
/* print "<div class=\"row\">";
print "<label id='title'><a target='_blank' href='$article_link'>$title</a></label>";
print "</div>"; */
$is_starred = sql_bool_to_bool($line["marked"]) ? "true" : "false";
$is_published = sql_bool_to_bool($line["published"]) ? "true" : "false";
print "<div class=\"row\">";
print "<label id='updated'>Updated:</label>";
print "<input enabled='false' name='updated' disabled value='{$updated_fmt}'/>";
print "</div>";
print "</fieldset>";
$content = sanitize_rss($link, $line["content"]);
$content = preg_replace("/href=/i", "target=\"_blank\" href=", $content);
if (!mobile_get_pref($link, "SHOW_IMAGES")) {
$content = preg_replace('/<img[^>]+>/is', '', $content);
}
print "<p>{$content}</p>";
print "<fieldset>";
print "<div class=\"row\">\n\t <label>Starred</label>\n\t <div class=\"toggle\" onclick=\"toggleMarked({$id}, this)\" toggled=\"{$is_starred}\"><span class=\"thumb\"></span><span class=\"toggleOn\">ON</span><span class=\"toggleOff\">OFF</span></div>\n\t </div>";
print "<div class=\"row\">\n\t <label>Published</label>\n\t <div class=\"toggle\" onclick=\"togglePublished({$id}, this)\" toggled=\"{$is_published}\"><span class=\"thumb\"></span><span class=\"toggleOn\">ON</span><span class=\"toggleOff\">OFF</span></div>\n\t </div>";
print "</fieldset>";
print "</div>";
}
}