diff --git a/backend.php b/backend.php index 13c470a98..549661156 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 38b11c665..593edaf1f 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];