本文整理汇总了PHP中getGlobalUnread函数的典型用法代码示例。如果您正苦于以下问题:PHP getGlobalUnread函数的具体用法?PHP getGlobalUnread怎么用?PHP getGlobalUnread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getGlobalUnread函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getUnread
function getUnread()
{
$login = db_escape_string($_REQUEST["login"]);
$fresh = $_REQUEST["fresh"] == "1";
$result = db_query($this->link, "SELECT id FROM ttrss_users WHERE login = '{$login}'");
if (db_num_rows($result) == 1) {
$uid = db_fetch_result($result, 0, "id");
print getGlobalUnread($this->link, $uid);
if ($fresh) {
print ";";
print getFeedArticles($this->link, -3, false, true, $uid);
}
} else {
print "-1;User not found";
}
}
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:16,代码来源:public.php
示例2: getUnread
function getUnread()
{
$feed_id = $this->dbh->escape_string($_REQUEST["feed_id"]);
$is_cat = $this->dbh->escape_string($_REQUEST["is_cat"]);
if ($feed_id) {
$this->wrap(self::STATUS_OK, array("unread" => getFeedUnread($feed_id, $is_cat)));
} else {
$this->wrap(self::STATUS_OK, array("unread" => getGlobalUnread()));
}
}
开发者ID:Verisor,项目名称:tt-rss,代码行数:10,代码来源:api.php
示例3: getGlobalCounters
function getGlobalCounters($global_unread = -1)
{
$ret_arr = array();
if ($global_unread == -1) {
$global_unread = getGlobalUnread();
}
$cv = array("id" => "global-unread", "counter" => (int) $global_unread);
array_push($ret_arr, $cv);
$result = db_query("SELECT COUNT(id) AS fn FROM\n\t\t\tttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
$subscribed_feeds = db_fetch_result($result, 0, "fn");
$cv = array("id" => "subscribed-feeds", "counter" => (int) $subscribed_feeds);
array_push($ret_arr, $cv);
return $ret_arr;
}
开发者ID:nota-ja,项目名称:tt-rss,代码行数:14,代码来源:functions.php
示例4: getGlobalCounters
function getGlobalCounters($link, $global_unread = -1)
{
if ($global_unread == -1) {
$global_unread = getGlobalUnread($link);
}
print "<counter type=\"global\" id='global-unread' \n\t\t\tcounter='{$global_unread}'/>";
$result = db_query($link, "SELECT COUNT(id) AS fn FROM \n\t\t\tttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
$subscribed_feeds = db_fetch_result($result, 0, "fn");
print "<counter type=\"global\" id='subscribed-feeds' \n\t\t\tcounter='{$subscribed_feeds}'/>";
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:10,代码来源:functions.php
示例5: authenticate_user
authenticate_user($link, $user, $pass);
}
if ($_SESSION["uid"] || http_authenticate_user($link)) {
generate_syndicated_feed($link, 0, $feed, $is_cat, $limit, $search, $search_mode, $match_on);
}
break;
// rss
// rss
case "getUnread":
$login = db_escape_string($_REQUEST["login"]);
$fresh = $_REQUEST["fresh"] == "1";
header("Content-Type: text/plain; charset=utf-8");
$result = db_query($link, "SELECT id FROM ttrss_users WHERE login = '{$login}'");
if (db_num_rows($result) == 1) {
$uid = db_fetch_result($result, 0, "id");
print getGlobalUnread($link, $uid);
if ($fresh) {
print ";";
print getFeedArticles($link, -3, false, true, $uid);
}
} else {
print "-1;User not found";
}
$print_exec_time = false;
break;
// getUnread
// getUnread
case "digestTest":
header("Content-Type: text/plain");
print_r(prepare_headlines_digest($link, $_SESSION["uid"]));
$print_exec_time = false;
开发者ID:bigschottkyd,项目名称:Tiny-Tiny-RSS,代码行数:31,代码来源:backend.php
示例6: logout_user
}
break;
case "logout":
logout_user();
print api_wrap_reply(API_STATUS_OK, $seq, array("status" => "OK"));
break;
case "isLoggedIn":
print api_wrap_reply(API_STATUS_OK, $seq, array("status" => $_SESSION["uid"] != ''));
break;
case "getUnread":
$feed_id = db_escape_string($_REQUEST["feed_id"]);
$is_cat = db_escape_string($_REQUEST["is_cat"]);
if ($feed_id) {
print api_wrap_reply(API_STATUS_OK, $seq, array("unread" => getFeedUnread($link, $feed_id, $is_cat)));
} else {
print api_wrap_reply(API_STATUS_OK, $seq, array("unread" => getGlobalUnread($link)));
}
break;
/* Method added for ttrss-reader for Android */
/* Method added for ttrss-reader for Android */
case "getCounters":
/* flct (flc is the default) FIXME: document */
$output_mode = db_escape_string($_REQUEST["output_mode"]);
print api_wrap_reply(API_STATUS_OK, $seq, getAllCounters($link, $output_mode));
break;
case "getFeeds":
$cat_id = db_escape_string($_REQUEST["cat_id"]);
$unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
$limit = (int) db_escape_string($_REQUEST["limit"]);
$offset = (int) db_escape_string($_REQUEST["offset"]);
$feeds = api_get_feeds($link, $cat_id, $unread_only, $limit, $offset);
开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:31,代码来源:index.php
示例7: logout_user
}
break;
case "logout":
logout_user();
print json_encode(array("status" => "OK"));
break;
case "isLoggedIn":
print json_encode(array("status" => $_SESSION["uid"] != ''));
break;
case "getUnread":
$feed_id = db_escape_string($_REQUEST["feed_id"]);
$is_cat = db_escape_string($_REQUEST["is_cat"]);
if ($feed_id) {
print json_encode(array("unread" => getFeedUnread($link, $feed_id, $is_cat)));
} else {
print json_encode(array("unread" => getGlobalUnread($link)));
}
break;
case "getCounters":
/* TODO */
break;
case "getFeeds":
$cat_id = db_escape_string($_REQUEST["cat_id"]);
$unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
$limit = (int) db_escape_string($_REQUEST["limit"]);
$offset = (int) db_escape_string($_REQUEST["offset"]);
if ($limit) {
$limit_qpart = "LIMIT {$limit} OFFSET {$offset}";
} else {
$limit_qpart = "";
}
开发者ID:buggithubs,项目名称:Tiny-Tiny-RSS,代码行数:31,代码来源:index.php
示例8: getTotalUnread
function getTotalUnread($msg)
{
global $link;
$error_code = 0;
$login_o = $msg->getParam(0);
$pass_o = $msg->getParam(1);
$login = $login_o->scalarval();
$pass = $pass_o->scalarval();
$user_id = authenticate_user($link, $login, $pass);
if (authenticate_user($link, $login, $pass)) {
$reply_msg = getGlobalUnread($link);
} else {
$reply_msg = "Login failed.";
$error_code = 1;
}
if ($error_code != 0) {
return new xmlrpcresp(0, $error_code, $reply_msg);
} else {
return new xmlrpcresp(new xmlrpcval($reply_msg));
}
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:21,代码来源:xml-rpc.php
注:本文中的getGlobalUnread函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论