- function userdetails() {
-
- $uid = sprintf("%d", $_REQUEST["id"]);
-
- $result = $this->dbh->query("SELECT login,
- ".SUBSTRING_FOR_DATE."(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_FOR_DATE."(created,1,16) AS created
- FROM ttrss_users
- WHERE id = '$uid'");
-
- if ($this->dbh->num_rows($result) == 0) {
- print "<h1>".__('User not found')."</h1>";
- return;
- }
-
- print "<table width='100%'>";
-
- $last_login = make_local_datetime(
- $this->dbh->fetch_result($result, 0, "last_login"), true);
-
- $created = make_local_datetime(
- $this->dbh->fetch_result($result, 0, "created"), true);
-
- $stored_articles = $this->dbh->fetch_result($result, 0, "stored_articles");
-
- print "<tr><td>".__('Registered')."</td><td>$created</td></tr>";
- print "<tr><td>".__('Last logged in')."</td><td>$last_login</td></tr>";
-
- $result = $this->dbh->query("SELECT COUNT(id) as num_feeds FROM ttrss_feeds
- WHERE owner_uid = '$uid'");
-
- $num_feeds = $this->dbh->fetch_result($result, 0, "num_feeds");
-
- print "<tr><td>".__('Subscribed feeds count')."</td><td>$num_feeds</td></tr>";
- print "<tr><td>".__('Stored articles')."</td><td>$stored_articles</td></tr>";
-
- print "</table>";
-
- print "<h1>".__('Subscribed feeds')."</h1>";
-
- $result = $this->dbh->query("SELECT id,title,site_url FROM ttrss_feeds
- WHERE owner_uid = '$uid' ORDER BY title");
-
- print "<ul class=\"userFeedList\">";
-
- while ($line = $this->dbh->fetch_assoc($result)) {
-
- $icon_file = ICONS_URL."/".$line["id"].".ico";
-
- if (file_exists($icon_file) && filesize($icon_file) > 0) {
- $feed_icon = "<img class=\"tinyFeedIcon\" src=\"$icon_file\">";
- } else {
- $feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
- }
-
- print "<li>$feed_icon <a href=\"".$line["site_url"]."\">".$line["title"]."</a></li>";
-
- }
-
- if ($this->dbh->num_rows($result) < $num_feeds) {
- // FIXME - add link to show ALL subscribed feeds here somewhere
- print "<li><img
- class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\"> ...</li>";
- }
-
- print "</ul>";
-
- print "<div align='center'>
- <button dojoType=\"dijit.form.Button\" type=\"submit\">".__("Close this window").
- "</button></div>";
-
- return;
- }
-