当前位置: 首页>>代码示例>>PHP>>正文


PHP getFeedArticles函数代码示例

本文整理汇总了PHP中getFeedArticles函数的典型用法代码示例。如果您正苦于以下问题:PHP getFeedArticles函数的具体用法?PHP getFeedArticles怎么用?PHP getFeedArticles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getFeedArticles函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getVirtCounters

function getVirtCounters()
{
    $ret_arr = array();
    for ($i = 0; $i >= -4; $i--) {
        $count = getFeedUnread($i);
        if ($i == 0 || $i == -1 || $i == -2) {
            $auxctr = getFeedArticles($i, false);
        } else {
            $auxctr = 0;
        }
        $cv = array("id" => $i, "counter" => (int) $count, "auxcounter" => $auxctr);
        //			if (get_pref('EXTENDED_FEEDLIST'))
        //				$cv["xmsg"] = getFeedArticles($i)." ".__("total");
        array_push($ret_arr, $cv);
    }
    $feeds = PluginHost::getInstance()->get_feeds(-1);
    if (is_array($feeds)) {
        foreach ($feeds as $feed) {
            $cv = array("id" => PluginHost::pfeed_to_feed_id($feed['id']), "counter" => $feed['sender']->get_unread($feed['id']));
            if (method_exists($feed['sender'], 'get_total')) {
                $cv["auxcounter"] = $feed['sender']->get_total($feed['id']);
            }
            array_push($ret_arr, $cv);
        }
    }
    return $ret_arr;
}
开发者ID:nota-ja,项目名称:tt-rss,代码行数:27,代码来源:functions.php

示例3: getFeedCounters

function getFeedCounters($active_feed = false)
{
    $ret_arr = array();
    $query = "SELECT ttrss_feeds.id,\n            ttrss_feeds.title,\n            " . SUBSTRING_FOR_DATE . "(ttrss_feeds.last_updated,1,19) AS last_updated,\n            last_error, value AS count\n        FROM ttrss_feeds, ttrss_counters_cache\n        WHERE ttrss_feeds.owner_uid = " . $_SESSION["uid"] . "\n            AND ttrss_counters_cache.owner_uid = ttrss_feeds.owner_uid\n            AND ttrss_counters_cache.feed_id = id";
    $result = db_query($query);
    while ($line = db_fetch_assoc($result)) {
        $id = $line["id"];
        $count = $line["count"];
        $last_error = htmlspecialchars($line["last_error"]);
        $last_updated = make_local_datetime($line['last_updated'], false);
        $has_img = feed_has_icon($id);
        if (date('Y') - date('Y', strtotime($line['last_updated'])) > 2) {
            $last_updated = '';
        }
        $cv = array("id" => $id, "updated" => $last_updated, "counter" => (int) $count, "has_img" => (int) $has_img);
        if ($last_error) {
            $cv["error"] = $last_error;
        }
        if (get_pref('EXTENDED_FEEDLIST')) {
            $cv["xmsg"] = getFeedArticles($id) . " " . __("total");
        }
        if ($active_feed && $id == $active_feed) {
            $cv["title"] = truncate_string($line["title"], 30);
        }
        array_push($ret_arr, $cv);
    }
    return $ret_arr;
}
开发者ID:adrianpietka,项目名称:bfrss,代码行数:28,代码来源:functions.php

示例4: getFeedUnread

function getFeedUnread($link, $feed, $is_cat = false)
{
    return getFeedArticles($link, $feed, $is_cat, true, $_SESSION["uid"]);
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:4,代码来源:functions.php

示例5: ccache_update

function ccache_update($link, $feed_id, $owner_uid, $is_cat = false, $update_pcat = true)
{
    if (!is_numeric($feed_id)) {
        return;
    }
    if (!$is_cat && $feed_id > 0) {
        $tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds \n\t\t\t\tWHERE id = '{$feed_id}'");
        $owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");
    }
    $prev_unread = ccache_find($link, $feed_id, $owner_uid, $is_cat, true);
    /* When updating a label, all we need to do is recalculate feed counters
     * because labels are not cached */
    if ($feed_id < 0) {
        ccache_update_all($link, $owner_uid);
        return;
    }
    if (!$is_cat) {
        $table = "ttrss_counters_cache";
    } else {
        $table = "ttrss_cat_counters_cache";
    }
    if ($is_cat && $feed_id >= 0) {
        if ($feed_id != 0) {
            $cat_qpart = "cat_id = '{$feed_id}'";
        } else {
            $cat_qpart = "cat_id IS NULL";
        }
        /* Recalculate counters for child feeds */
        $result = db_query($link, "SELECT id FROM ttrss_feeds\n\t\t\t\t\t\tWHERE owner_uid = '{$owner_uid}' AND {$cat_qpart}");
        while ($line = db_fetch_assoc($result)) {
            ccache_update($link, $line["id"], $owner_uid, false, false);
        }
        $result = db_query($link, "SELECT SUM(value) AS sv \n\t\t\t\tFROM ttrss_counters_cache, ttrss_feeds \n\t\t\t\tWHERE id = feed_id AND {$cat_qpart} AND \n\t\t\t\tttrss_feeds.owner_uid = '{$owner_uid}'");
        $unread = (int) db_fetch_result($result, 0, "sv");
    } else {
        $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid);
    }
    db_query($link, "BEGIN");
    $result = db_query($link, "SELECT feed_id FROM {$table}\n\t\t\tWHERE owner_uid = '{$owner_uid}' AND feed_id = '{$feed_id}' LIMIT 1");
    if (db_num_rows($result) == 1) {
        db_query($link, "UPDATE {$table} SET\n\t\t\t\tvalue = '{$unread}', updated = NOW() WHERE\n\t\t\t\tfeed_id = '{$feed_id}' AND owner_uid = '{$owner_uid}'");
    } else {
        db_query($link, "INSERT INTO {$table}\n\t\t\t\t(feed_id, value, owner_uid, updated) \n\t\t\t\tVALUES \n\t\t\t\t({$feed_id}, {$unread}, {$owner_uid}, NOW())");
    }
    db_query($link, "COMMIT");
    if ($feed_id > 0 && $prev_unread != $unread) {
        if (!$is_cat) {
            /* Update parent category */
            if ($update_pcat) {
                $result = db_query($link, "SELECT cat_id FROM ttrss_feeds\n\t\t\t\t\t\tWHERE owner_uid = '{$owner_uid}' AND id = '{$feed_id}'");
                $cat_id = (int) db_fetch_result($result, 0, "cat_id");
                ccache_update($link, $cat_id, $owner_uid, true);
            }
        }
    } else {
        if ($feed_id < 0) {
            ccache_update_all($link, $owner_uid);
        }
    }
    return $unread;
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:61,代码来源:functions.php

示例6: generate_syndicated_feed

         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;
     break;
     // digestTest
 // digestTest
开发者ID:bigschottkyd,项目名称:Tiny-Tiny-RSS,代码行数:31,代码来源:backend.php


注:本文中的getFeedArticles函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。