本文整理汇总了PHP中getCategoryTitle函数的典型用法代码示例。如果您正苦于以下问题:PHP getCategoryTitle函数的具体用法?PHP getCategoryTitle怎么用?PHP getCategoryTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCategoryTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedlist_init_cat
private function feedlist_init_cat($cat_id, $hidden = false)
{
$obj = array();
$cat_id = (int) $cat_id;
if ($cat_id > 0) {
$cat_unread = ccache_find($this->link, $cat_id, $_SESSION["uid"], true);
} else {
if ($cat_id == 0 || $cat_id == -2) {
$cat_unread = getCategoryUnread($this->link, $cat_id);
}
}
$obj['id'] = 'CAT:' . $cat_id;
$obj['items'] = array();
$obj['name'] = getCategoryTitle($this->link, $cat_id);
$obj['type'] = 'feed';
$obj['unread'] = (int) $cat_unread;
$obj['hidden'] = $hidden;
$obj['bare_id'] = $cat_id;
return $obj;
}
示例2: 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);
}
示例3: printCategoryHeader
function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true)
{
$tmp_category = getCategoryTitle($link, $cat_id);
if ($cat_id > 0) {
$cat_unread = ccache_find($link, $cat_id, $_SESSION["uid"], true);
} else {
if ($cat_id == 0 || $cat_id == -2) {
$cat_unread = getCategoryUnread($link, $cat_id);
}
}
if ($hidden) {
$holder_style = "display:none;";
$ellipsis = "…";
} else {
$holder_style = "";
$ellipsis = "";
}
$catctr_class = $cat_unread > 0 ? "catCtrHasUnread" : "catCtrNoUnread";
if ($can_browse) {
$browse_cat_link = "onclick=\"javascript:viewCategory({$cat_id})\"";
$inner_title_class = "catTitle";
} else {
$browse_cat_link = "";
$inner_title_class = "catTitleNL";
}
$cat_class = "feedCat";
print "<li class=\"{$cat_class}\" id=\"FCAT-{$cat_id}\">\n\t\t\t\t<img onclick=\"toggleCollapseCat({$cat_id})\" class=\"catCollapse\"\n\t\t\t\t\ttitle=\"" . __('Click to collapse category') . "\"\n\t\t\t\t\tsrc=\"images/cat-collapse.png\"><span class=\"{$inner_title_class}\" \n\t\t\t\t\tid=\"FCATN-{$cat_id}\" {$browse_cat_link}/>{$tmp_category}</span>";
print "<span id=\"FCAP-{$cat_id}\">";
print " <span id=\"FCATCTR-{$cat_id}\" \n\t\t\t\tclass=\"{$catctr_class}\">({$cat_unread})</span> {$ellipsis}";
print "</span>";
//print "</li>";
print "<ul class=\"feedCatList\" id=\"FCATLIST-{$cat_id}\" style='{$holder_style}'>";
}
示例4: search
function search()
{
$this->params = explode(":", db_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\">";
if (!SPHINX_ENABLED) {
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\tstyle=\"font-size : 16px; width : 12em;\"\n\t\t\t\trequired=\"1\" name=\"query\" type=\"search\" value=''>";
print " " . __('match on') . " ";
$search_fields = array("title" => __("Title"), "content" => __("Content"), "both" => __("Title or content"));
print_select_hash("match_on", 3, $search_fields, 'dojoType="dijit.form.Select"');
} else {
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\tstyle=\"font-size : 16px; width : 20em;\"\n\t\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($this->link, $active_feed_id);
if (!$is_cat) {
$feed_cat_title = getFeedCatTitle($this->link, $active_feed_id);
} else {
$feed_cat_title = getCategoryTitle($this->link, $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($this->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>";
print "</div>";
print "<div class=\"dlgButtons\">";
if (!SPHINX_ENABLED) {
print "<div style=\"float : left\">\n\t\t\t\t<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/redmine/wiki/tt-rss/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>";
}
示例5: 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)") : "");
}
示例6: queryFeedHeadlines
//.........这里部分代码省略.........
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} elseif ($feed == -4) {
// all articles virtual feed
$allow_archived = true;
$query_strategy_part = "true";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} elseif ($feed <= LABEL_BASE_INDEX) {
// labels
$label_id = feed_to_label_id($feed);
$query_strategy_part = "label_id = '{$label_id}' AND\n ttrss_labels2.id = ttrss_user_labels2.label_id AND\n ttrss_user_labels2.article_id = ref_id";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$ext_tables_part = ",ttrss_labels2,ttrss_user_labels2";
$allow_archived = true;
} else {
$query_strategy_part = "true";
}
$order_by = "score DESC, date_entered DESC, updated DESC";
if ($view_mode == "unread_first") {
$order_by = "unread DESC, {$order_by}";
}
if ($override_order) {
$order_by = $override_order;
}
if ($override_strategy) {
$query_strategy_part = $override_strategy;
}
if ($override_vfeed) {
$vfeed_query_part = $override_vfeed;
}
$feed_title = "";
if ($search) {
$feed_title = T_sprintf("Search results: %s", $search);
} elseif ($cat_view) {
$feed_title = getCategoryTitle($feed);
} elseif (is_numeric($feed) && $feed > 0) {
$result = db_query("SELECT title,site_url,last_error,last_updated\n FROM 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");
$last_updated = db_fetch_result($result, 0, "last_updated");
} else {
$feed_title = getFeedTitle($feed);
}
$content_query_part = "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('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 LEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)";
示例7: getCategories
function getCategories()
{
$unread_only = sql_bool_to_bool($_REQUEST["unread_only"]);
$enable_nested = sql_bool_to_bool($_REQUEST["enable_nested"]);
$include_empty = sql_bool_to_bool($_REQUEST['include_empty']);
// TODO do not return empty categories, return Uncategorized and standard virtual cats
if ($enable_nested) {
$nested_qpart = "parent_cat IS NULL";
} else {
$nested_qpart = "true";
}
$result = $this->dbh->query("SELECT\n\t\t\t\tid, title, order_id, (SELECT COUNT(id) FROM\n\t\t\t\tttrss_feeds WHERE\n\t\t\t\tttrss_feed_categories.id IS NOT NULL AND cat_id = ttrss_feed_categories.id) AS num_feeds,\n\t\t\t(SELECT COUNT(id) FROM\n\t\t\t\tttrss_feed_categories AS c2 WHERE\n\t\t\t\tc2.parent_cat = ttrss_feed_categories.id) AS num_cats\n\t\t\tFROM ttrss_feed_categories\n\t\t\tWHERE {$nested_qpart} AND owner_uid = " . $_SESSION["uid"]);
$cats = array();
while ($line = $this->dbh->fetch_assoc($result)) {
if ($include_empty || $line["num_feeds"] > 0 || $line["num_cats"] > 0) {
$unread = getFeedUnread($line["id"], true);
if ($enable_nested) {
$unread += getCategoryChildrenUnread($line["id"]);
}
if ($unread || !$unread_only) {
array_push($cats, array("id" => $line["id"], "title" => $line["title"], "unread" => $unread, "order_id" => (int) $line["order_id"]));
}
}
}
foreach (array(-2, -1, 0) as $cat_id) {
if ($include_empty || !$this->isCategoryEmpty($cat_id)) {
$unread = getFeedUnread($cat_id, true);
if ($unread || !$unread_only) {
array_push($cats, array("id" => $cat_id, "title" => getCategoryTitle($cat_id), "unread" => $unread));
}
}
}
$this->wrap(self::STATUS_OK, $cats);
}
示例8: 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";
示例9: module_popup_dialog
//.........这里部分代码省略.........
print "</select> ";
print "<p>";
$owner_uid = $_SESSION["uid"];
/* print __('Select:')."
<a href=\"javascript:selectPrefRows('fbrowse', true)\">".__('All')."</a>,
<a href=\"javascript:selectPrefRows('fbrowse', false)\">".__('None')."</a>"; */
print "<ul class='browseFeedList' id='browseFeedList'>";
print_feed_browser($link, $search, 25);
print "</ul>";
print "<div align='center'>\n\t\t\t\t<button onclick=\"feedBrowserSubscribe()\">" . __('Subscribe') . "</button>\n\t\t\t\t<button style='display : none' id='feed_archive_remove' onclick=\"feedArchiveRemove()\">" . __('Remove') . "</button>\n\t\t\t\t<button onclick=\"closeInfoBox()\" >" . __('Cancel') . "</button></div>";
print "</div>";
return;
}
if ($id == "search") {
print "<div id=\"infoBoxTitle\">" . __('Search') . "</div>";
print "<div class=\"infoBoxContents\">";
print "<form id='search_form' onsubmit='return false'>";
#$active_feed_id = db_escape_string($_REQUEST["param"]);
$params = split(":", db_escape_string($_REQUEST["param"]));
$active_feed_id = sprintf("%d", $params[0]);
$is_cat = $params[1] == "true";
print "<div class=\"dlgSec\">" . __('Look for') . "</div>";
print "<div class=\"dlgSecCont\">";
print "<input onkeypress=\"return filterCR(event, search)\"\n\t\t\t\tname=\"query\" size=\"20\" type=\"search\"\tvalue=''>";
print " " . __('match on') . " ";
$search_fields = array("title" => __("Title"), "content" => __("Content"), "both" => __("Title or content"));
print_select_hash("match_on", 3, $search_fields);
print "<br/>" . __('Limit search to:') . " ";
print "<select name=\"search_mode\">\n\t\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>";
print "</div>";
print "</form>";
print "<div class=\"dlgButtons\">\n\t\t\t<button onclick=\"javascript:search()\">" . __('Search') . "</button>\n\t\t\t<button onclick=\"javascript:closeInfoBox(true)\">" . __('Cancel') . "</button>\n\t\t\t</div>";
print "</div>";
return;
}
if ($id == "quickAddFilter") {
$active_feed_id = db_escape_string($_REQUEST["param"]);
print "<div id=\"infoBoxTitle\">" . __('Create Filter') . "</div>";
print "<div class=\"infoBoxContents\">";
print "<form id=\"filter_add_form\" onsubmit='return false'>";
print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">";
print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
print "<input type=\"hidden\" name=\"subop\" value=\"add\">";
$result = db_query($link, "SELECT id,description \n\t\t\t\tFROM ttrss_filter_types ORDER BY description");
$filter_types = array();
while ($line = db_fetch_assoc($result)) {
示例10: getCategoriesArchive
<h4>Categories:</h4>
<?php
$categories = getCategoriesArchive();
if ($categories->count() > 0) {
?>
<ul class="nav">
<?php
foreach ($categories as $category) {
?>
<li>
<a href="<?php
echo getCategoryURL($category->name());
?>
">
<?php
echo getCategoryTitle($category->name());
?>
(<?php
echo $category->results();
?>
)
</a>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p><strong>No categories found.</strong></p>
示例11: printNewsCategoryURL
/**
* Prints the full link to a news category
*
* @param string $before If you want to print text before the link
* @param string $catlink The category link of a category
*
* @return string
*/
function printNewsCategoryURL($before = '', $catlink = '')
{
if (!empty($catlink)) {
echo "<a href=\"" . getNewsCategoryURL($catlink) . "\" title=\"" . html_encode(getCategoryTitle($catlink)) . "\">" . $before . getCategoryTitle($catlink) . "</a>";
}
}
示例12: module_popup_dialog
//.........这里部分代码省略.........
print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">";
foreach (array(25, 50, 100, 200) as $l) {
$issel = $l == $limit ? "selected=\"1\"" : "";
print "<option {$issel} value=\"{$l}\">{$l}</option>";
}
print "</select> ";
print "</div>";
$owner_uid = $_SESSION["uid"];
print "<ul class='browseFeedList' id='browseFeedList'>";
print make_feed_browser($link, $search, 25);
print "</ul>";
print "<div align='center'>\n\t\t\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').execute()\">" . __('Subscribe') . "</button>\n\t\t\t\t<button dojoType=\"dijit.form.Button\" style='display : none' id='feed_archive_remove' onclick=\"dijit.byId('feedBrowserDlg').removeFromArchive()\">" . __('Remove') . "</button>\n\t\t\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').hide()\" >" . __('Cancel') . "</button></div>";
}
if ($id == "search") {
$params = explode(":", db_escape_string($_REQUEST["param"]), 2);
$active_feed_id = sprintf("%d", $params[0]);
$is_cat = $params[1] != "false";
print "<div class=\"dlgSec\">" . __('Look for') . "</div>";
print "<div class=\"dlgSecCont\">";
if (!SPHINX_ENABLED) {
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tstyle=\"font-size : 16px; width : 12em;\"\n\t\t\t\t\trequired=\"1\" name=\"query\" type=\"search\" value=''>";
print " " . __('match on') . " ";
$search_fields = array("title" => __("Title"), "content" => __("Content"), "both" => __("Title or content"));
print_select_hash("match_on", 3, $search_fields, 'dojoType="dijit.form.Select"');
} else {
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tstyle=\"font-size : 16px; width : 20em;\"\n\t\t\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\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=\"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($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>";
print "</div>";
print "<div class=\"dlgButtons\">";
if (!SPHINX_ENABLED) {
print "<div style=\"float : left\">\n\t\t\t\t\t<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/redmine/wiki/tt-rss/SearchSyntax\">Search syntax</a>\n\t\t\t\t\t</div>";
}
print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">" . __('Search') . "</button>\n\t\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">" . __('Cancel') . "</button>\n\t\t\t</div>";
}
if ($id == "quickAddFilter") {
$active_feed_id = db_escape_string($_REQUEST["param"]);
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"add\">";
$result = db_query($link, "SELECT id,description\n\t\t\t\tFROM ttrss_filter_types ORDER BY description");
$filter_types = array();
while ($line = db_fetch_assoc($result)) {
//array_push($filter_types, $line["description"]);
$filter_types[$line["id"]] = __($line["description"]);
示例13: queryFeedHeadlines
//.........这里部分代码省略.........
// labels
$label_id = feed_to_label_id($feed);
$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,";
$allow_archived = true;
} else {
$query_strategy_part = "true";
}
}
}
}
}
}
}
}
}
}
$order_by = "score DESC, date_entered DESC, updated DESC";
if ($override_order) {
$order_by = $override_order;
}
if ($override_strategy) {
$query_strategy_part = $override_strategy;
}
if ($override_vfeed) {
$vfeed_query_part = $override_vfeed;
}
$feed_title = "";
if ($search) {
$feed_title = T_sprintf("Search results: %s", $search);
} else {
if ($cat_view) {
$feed_title = getCategoryTitle($feed);
} else {
if (is_numeric($feed) && $feed > 0) {
$result = db_query("SELECT title,site_url,last_error,last_updated\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");
$last_updated = db_fetch_result($result, 0, "last_updated");
} else {
$feed_title = getFeedTitle($feed);
}
}
}
$content_query_part = "content, ";
if ($limit_query_part) {
$offset_query_part = "OFFSET {$offset}";
} else {
$offset_query_part = "";
}
if (is_numeric($feed)) {
// proper override_order applied above
if ($vfeed_query_part && !$ignore_vfeed_group && get_pref('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 = "{$ext_tables_part}ttrss_entries LEFT JOIN ttrss_user_entries ON (ref_id = ttrss_entries.id),ttrss_feeds";
$feed_check_qpart = "ttrss_user_entries.feed_id = ttrss_feeds.id AND";
} else {
$from_qpart = "{$ext_tables_part}ttrss_entries LEFT JOIN ttrss_user_entries ON (ref_id = ttrss_entries.id)\n\t\t\t\t\t\tLEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)";
示例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: load
/**
* load an question from DB
*
* @author Sebastien Piraux <pir@cerdecam.be>
* @param integer $id id of question
* @return boolean load successfull ?
*/
public function load($id)
{
$sql = "SELECT\n `id`,\n `title`,\n `description`,\n `attachment`,\n `type`,\n `grade`,\n `id_category`\n FROM `" . $this->tblQuestion . "`\n WHERE `id` = " . (int) $id;
$data = claro_sql_query_get_single_row($sql);
if (!empty($data)) {
// from query
$this->id = (int) $data['id'];
$this->title = $data['title'];
$this->description = $data['description'];
$this->attachment = $data['attachment'];
$this->type = $data['type'];
$this->grade = $data['grade'];
$this->categoryId = $data['id_category'];
$this->categoryTitle = getCategoryTitle($this->categoryId);
// create answer object
$this->setAnswer();
if (!is_null($this->answer)) {
$this->answer->load();
}
$this->buildDirPaths();
return true;
} else {
return false;
}
}