";
-
- $result = db_query($link, "SELECT login,
- SUBSTRING(last_login,1,16) AS last_login,
- access_level,
- (SELECT COUNT(int_id) FROM ttrss_user_entries
- WHERE owner_uid = id) AS stored_articles,
- SUBSTRING(created,1,16) AS created
- FROM ttrss_users
- WHERE id = '$uid'");
-
- if (db_num_rows($result) == 0) {
- print "
User not found
";
- return;
- }
-
-# print "
User Details
";
-
- $login = db_fetch_result($result, 0, "login");
-
-# print "
$login
";
-
- print "
";
-
- $last_login = date(get_pref($link, 'LONG_DATE_FORMAT'),
- strtotime(db_fetch_result($result, 0, "last_login")));
-
- $created = date(get_pref($link, 'LONG_DATE_FORMAT'),
- strtotime(db_fetch_result($result, 0, "created")));
-
- $access_level = db_fetch_result($result, 0, "access_level");
- $stored_articles = db_fetch_result($result, 0, "stored_articles");
-
-# print "Username | $login |
";
-# print "Access level | $access_level |
";
- print "".__('Registered')." | $created |
";
- print "".__('Last logged in')." | $last_login |
";
- print "".__('Stored articles')." | $stored_articles |
";
-
- $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds
- WHERE owner_uid = '$uid'");
-
- $num_feeds = db_fetch_result($result, 0, "num_feeds");
-
- print "".__('Subscribed feeds count')." | $num_feeds |
";
-
-/* $result = db_query($link, "SELECT
- SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size
- FROM ttrss_user_entries,ttrss_entries
- WHERE owner_uid = '$uid' AND ref_id = id");
-
- $db_size = round(db_fetch_result($result, 0, "db_size") / 1024);
-
- print "Approx. used DB size | $db_size KBytes |
"; */
-
- print "
";
-
- print "
".__('Subscribed feeds')."
";
-
- $result = db_query($link, "SELECT id,title,site_url FROM ttrss_feeds
- WHERE owner_uid = '$uid' ORDER BY title");
-
- print "
";
-
- $row_class = "odd";
-
- while ($line = db_fetch_assoc($result)) {
-
- $icon_file = ICONS_URL."/".$line["id"].".ico";
-
- if (file_exists($icon_file) && filesize($icon_file) > 0) {
- $feed_icon = "";
+ if ($mode == "") {
+ outputArticleXML($link, $id, $feed_id);
} else {
- $feed_icon = "";
+ catchupArticleById($link, $id, 0);
}
- print "- $feed_icon ".$line["title"]."
";
+ foreach ($cids as $cid) {
+ if ($cid) {
+ outputArticleXML($link, $cid, $feed_id, false);
+ }
+ }
- $row_class = toggleEvenOdd($row_class);
+ if ($mode != "prefetch_old") {
+ print "";
+ getAllCounters($link, $omode);
+ print "";
+ }
- }
+ print "";
+ break; // view
- if (db_num_rows($result) < $num_feeds) {
- // FIXME - add link to show ALL subscribed feeds here somewhere
- print "- ...
";
- }
-
- print "
";
+ case "viewfeed":
- print "
";
+ $print_exec_time = true;
+ $timing_info = getmicrotime();
- print "";
+
+ $result = db_query($link, "SELECT login,
+ SUBSTRING(last_login,1,16) AS last_login,
+ access_level,
+ (SELECT COUNT(int_id) FROM ttrss_user_entries
+ WHERE owner_uid = id) AS stored_articles,
+ SUBSTRING(created,1,16) AS created
+ FROM ttrss_users
+ WHERE id = '$uid'");
+
+ if (db_num_rows($result) == 0) {
+ print "
User not found
";
+ return;
+ }
+
+ // print "
User Details
";
- if (db_num_rows($result) == 1) {
- $owner = db_fetch_result($result, 0, "owner_uid");
$login = db_fetch_result($result, 0, "login");
- generate_syndicated_feed($link, $owner, -2, false);
+ // print "
$login
";
- } else {
- print "
User not found";
- }
+ print "
";
- }
+ $last_login = date(get_pref($link, 'LONG_DATE_FORMAT'),
+ strtotime(db_fetch_result($result, 0, "last_login")));
- if ($op == "rss") {
- $feed = db_escape_string($_GET["id"]);
- $user = db_escape_string($_GET["user"]);
- $pass = db_escape_string($_GET["pass"]);
- $is_cat = $_GET["is_cat"] != false;
+ $created = date(get_pref($link, 'LONG_DATE_FORMAT'),
+ strtotime(db_fetch_result($result, 0, "created")));
- $search = db_escape_string($_GET["q"]);
- $match_on = db_escape_string($_GET["m"]);
- $search_mode = db_escape_string($_GET["smode"]);
+ $access_level = db_fetch_result($result, 0, "access_level");
+ $stored_articles = db_fetch_result($result, 0, "stored_articles");
- if (!$_SESSION["uid"] && $user && $pass) {
- authenticate_user($link, $user, $pass);
- }
+ // print "Username | $login |
";
+ // print "Access level | $access_level |
";
+ print "".__('Registered')." | $created |
";
+ print "".__('Last logged in')." | $last_login |
";
+ print "".__('Stored articles')." | $stored_articles |
";
- if ($_SESSION["uid"] ||
- http_authenticate_user($link)) {
+ $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds
+ WHERE owner_uid = '$uid'");
- generate_syndicated_feed($link, 0, $feed, $is_cat,
- $search, $search_mode, $match_on);
- }
+ $num_feeds = db_fetch_result($result, 0, "num_feeds");
- }
+ print "".__('Subscribed feeds count')." | $num_feeds |
";
- if ($op == "labelFromSearch") {
- $search = db_escape_string($_GET["search"]);
- $search_mode = db_escape_string($_GET["smode"]);
- $match_on = db_escape_string($_GET["match"]);
- $is_cat = db_escape_string($_GET["is_cat"]);
- $title = db_escape_string($_GET["title"]);
- $feed = sprintf("%d", $_GET["feed"]);
+ /*
+ $result = db_query($link, "SELECT
+ SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size
+ FROM ttrss_user_entries,ttrss_entries
+ WHERE owner_uid = '$uid' AND ref_id = id");
- $label_qparts = array();
+ $db_size = round(db_fetch_result($result, 0, "db_size") / 1024);
- $search_expr = getSearchSql($search, $match_on);
+ print "Approx. used DB size | $db_size KBytes |
";
+ */
+
+ print "
";
+
+ print "
".__('Subscribed feeds')."
";
+
+ $result = db_query($link, "SELECT id,title,site_url FROM ttrss_feeds
+ WHERE owner_uid = '$uid' ORDER BY title");
+
+ print "
";
+
+ $row_class = "odd";
+
+ while ($line = db_fetch_assoc($result)) {
+
+ $icon_file = ICONS_URL."/".$line["id"].".ico";
+
+ if (file_exists($icon_file) && filesize($icon_file) > 0) {
+ $feed_icon = "";
+ } else {
+ $feed_icon = "";
+ }
+
+ print "- $feed_icon ".$line["title"]."
";
+
+ $row_class = toggleEvenOdd($row_class);
- if ($is_cat) {
- if ($feed != 0) {
- $search_expr .= " AND ttrss_feeds.cat_id = $feed ";
- } else {
- $search_expr .= " AND ttrss_feeds.cat_id IS NULL ";
}
- } else {
- if ($search_mode == "all_feeds") {
- // NOOP
- } else if ($search_mode == "this_cat") {
- $tmp_result = db_query($link, "SELECT cat_id
- FROM ttrss_feeds WHERE id = '$feed'");
+ if (db_num_rows($result) < $num_feeds) {
+ // FIXME - add link to show ALL subscribed feeds here somewhere
+ print "- ...
";
+ }
+
+ print "
";
- $cat_id = db_fetch_result($tmp_result, 0, "cat_id");
+ print "
";
- if ($cat_id > 0) {
- $search_expr .= " AND ttrss_feeds.cat_id = $cat_id ";
+ print "