From f27d955a58bffbb9f24c82fcca427e0ac7d37312 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 1 Oct 2006 11:19:39 +0100 Subject: module fixes --- backend.php | 177 ++++-------------------------------------------------------- 1 file changed, 9 insertions(+), 168 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index ac9847053..24295769a 100644 --- a/backend.php +++ b/backend.php @@ -80,13 +80,14 @@ 0 => "User", 10 => "Administrator"); + require_once "modules/pref-prefs.php"; require_once "modules/popup-dialog.php"; require_once "modules/help.php"; require_once "modules/pref-feeds.php"; require_once "modules/pref-filters.php"; require_once "modules/pref-labels.php"; require_once "modules/pref-users.php"; - require_once "modules/pref-prefs.php"; + require_once "modules/pref-feed-browser.php"; require_once "modules/backend-rpc.php"; $script_started = getmicrotime(); @@ -579,11 +580,12 @@ module_pref_labels($link); } - if ($op == "error") { - print "
"; - $msg = $_GET["msg"]; - print $msg; - print "
"; + if ($op == "pref-prefs") { + module_pref_prefs($link); + } + + if ($op == "pref-users") { + module_pref_users($link); } if ($op == "help") { @@ -611,14 +613,6 @@ } - if ($op == "pref-prefs") { - module_pref_prefs($link); - } - - if ($op == "pref-users") { - module_pref_users($link); - } - if ($op == "user-details") { if (WEB_DEMO_MODE || $_SESSION["access_level"] < 10) { @@ -730,160 +724,7 @@ } if ($op == "pref-feed-browser") { - - if (!ENABLE_FEED_BROWSER) { - print "Feed browser is administratively disabled."; - return; - } - - $subop = $_REQUEST["subop"]; - - if ($subop == "details") { - $id = db_escape_string($_GET["id"]); - - print "
"; - print "Feed information:"; - print "
"; - - $result = db_query($link, "SELECT - feed_url,site_url, - SUBSTRING(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE id = '$id'"); - - $feed_url = db_fetch_result($result, 0, "feed_url"); - $site_url = db_fetch_result($result, 0, "site_url"); - $last_updated = db_fetch_result($result, 0, "last_updated"); - - if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $last_updated = smart_date_time(strtotime($last_updated)); - } else { - $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $last_updated = date($short_date, strtotime($last_updated)); - } - - print "Site: $site_url ". - "(feed), ". - "Last updated: $last_updated"; - - print "
"; - - $result = db_query($link, "SELECT - ttrss_entries.title, - content,link, - substring(date_entered,1,19) as date_entered, - substring(updated,1,19) as updated - FROM ttrss_entries,ttrss_user_entries - WHERE ttrss_entries.id = ref_id AND feed_id = '$id' - ORDER BY updated DESC LIMIT 5"); - - if (db_num_rows($result) > 0) { - - print "Last headlines:
"; - - print "
"; - print "
    "; - while ($line = db_fetch_assoc($result)) { - - if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $entry_dt = smart_date_time(strtotime($line["updated"])); - } else { - $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $entry_dt = date($short_date, strtotime($line["updated"])); - } - - print "
  • " . $line["title"] . "" . - " ($entry_dt)
  • "; - } - print "
"; - } - - print "
"; - - return; - } - - print "

This panel shows feeds subscribed by other users of this system, just in case you are interested in some of them too.

"; - - $limit = db_escape_string($_GET["limit"]); - - if (!$limit) $limit = 25; - - $owner_uid = $_SESSION["uid"]; - - $result = db_query($link, "SELECT feed_url,COUNT(id) AS subscribers - FROM ttrss_feeds WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf - WHERE tf.feed_url = ttrss_feeds.feed_url - AND owner_uid = '$owner_uid') GROUP BY feed_url - ORDER BY subscribers DESC LIMIT $limit"); - - - print "
- Top - -
"; - - print "

Selection: - "; - - print "

"; - - print ""; - + module_pref_feed_browser($link); } if ($op == "rss") { -- cgit v1.2.3