From: Andrew Dolgov Date: Mon, 5 Jan 2009 08:09:05 +0000 (+0100) Subject: add ability to customize amount of returned entries for syndicated feeds X-Git-Tag: 1.3.0~170 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ead2715d9c9a436b507e48cf5975015f0ddb493d;p=tt-rss.git add ability to customize amount of returned entries for syndicated feeds --- diff --git a/backend.php b/backend.php index 13c470a9..54966115 100644 --- a/backend.php +++ b/backend.php @@ -417,6 +417,7 @@ case "publish": $key = db_escape_string($_GET["key"]); + $limit = (int)db_escape_string($_GET["limit"]); $result = db_query($link, "SELECT login, owner_uid FROM ttrss_user_prefs, ttrss_users WHERE @@ -428,7 +429,7 @@ $owner = db_fetch_result($result, 0, "owner_uid"); $login = db_fetch_result($result, 0, "login"); - generate_syndicated_feed($link, $owner, -2, false); + generate_syndicated_feed($link, $owner, -2, false, $limit); } else { print "User not found"; @@ -440,6 +441,7 @@ $user = db_escape_string($_GET["user"]); $pass = db_escape_string($_GET["pass"]); $is_cat = $_GET["is_cat"] != false; + $limit = (int)db_escape_string($_GET["limit"]); $search = db_escape_string($_GET["q"]); $match_on = db_escape_string($_GET["m"]); @@ -452,7 +454,7 @@ if ($_SESSION["uid"] || http_authenticate_user($link)) { - generate_syndicated_feed($link, 0, $feed, $is_cat, + generate_syndicated_feed($link, 0, $feed, $is_cat, $limit, $search, $search_mode, $match_on); } break; // rss diff --git a/functions.php b/functions.php index 38b11c66..593edaf1 100644 --- a/functions.php +++ b/functions.php @@ -3483,10 +3483,12 @@ } function generate_syndicated_feed($link, $owner_uid, $feed, $is_cat, - $search, $search_mode, $match_on) { + $limit, $search, $search_mode, $match_on) { + + if (!$limit) $limit = 30; $qfh_ret = queryFeedHeadlines($link, $feed, - 30, false, $is_cat, $search, $search_mode, $match_on, "updated DESC", 0, + $limit, false, $is_cat, $search, $search_mode, $match_on, "updated DESC", 0, $owner_uid); $result = $qfh_ret[0];