$op = $_REQUEST["op"];
- define('SCHEMA_VERSION', 7);
+ define('SCHEMA_VERSION', 8);
require_once "sanity_check.php";
require_once "config.php";
+
+ require_once "db.php";
+ require_once "db-prefs.php";
+ require_once "functions.php";
+ require_once "magpierss/rss_fetch.inc";
$err_msg = check_configuration_variables();
if ($err_msg) {
- print "Fatal error: $err_msg";
- exit;
+ header("Content-Type: application/xml");
+ print_error_xml(9, $err_msg); die;
}
if ((!$op || $op == "rpc" || $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) {
if (!$_SESSION["uid"] && $op != "globalUpdateFeeds") {
if ($op == "rpc") {
- print "<error error-code=\"6\"/>";
+ print_error_xml(6); die;
} else {
print "
<html><body>
}
if (!$op) {
- print "<error error-code=\"7\"/>";
- exit;
+ print_error_xml(7); exit;
}
- require_once "db.php";
- require_once "db-prefs.php";
- require_once "functions.php";
- require_once "magpierss/rss_fetch.inc";
-
$purge_intervals = array(
0 => "Default",
-1 => "Never purge",
setcookie('ttrss_vf_refresh', FEEDS_FRAME_REFRESH);
setcookie('ttrss_vf_daemon', ENABLE_UPDATE_DAEMON);
+
+ if (get_pref($link, "ON_CATCHUP_SHOW_NEXT_FEED")) {
+ setcookie('ttrss_vf_catchupnext', 1);
+ } else {
+ setcookie('ttrss_vf_catchupnext', 0);
+ }
}
$fetch = $_GET["fetch"];
type=\"text/css\" href=\"tt-rss_compact.css\"/>";
}
- print "<script type=\"text/javascript\" src=\"functions.js\"></script>
- <script type=\"text/javascript\" src=\"feedlist.js\"></script>
+ $script_dt_add = get_script_dt_add();
+
+ print "<script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
+ <script type=\"text/javascript\" src=\"feedlist.js?$script_dt_add\"></script>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<!--[if gte IE 5.5000]>
<script type=\"text/javascript\" src=\"pngfix.js\"></script>
num_comments,
author
FROM ttrss_entries,ttrss_user_entries
- WHERE id = '$id' AND ref_id = id");
+ WHERE id = '$id' AND ref_id = id AND owner_uid = " . $_SESSION["uid"]);
print "<html><head>
<title>Tiny Tiny RSS : Article $id</title>
type=\"text/css\" href=\"tt-rss_compact.css\"/>";
}
- print "<script type=\"text/javascript\" src=\"functions.js\"></script>
+ $script_dt_add = get_script_dt_add();
+
+ print "<script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</head><body $rtl_tag>";
$view_mode = db_escape_string($_GET["view"]);
$limit = db_escape_string($_GET["limit"]);
$cat_view = db_escape_string($_GET["cat"]);
+ $next_unread_feed = db_escape_string($_GET["nuf"]);
if (!$skip) $skip = 0;
type=\"text/css\" href=\"tt-rss_compact.css\"/>";
}
+ if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
+ update_generic_feed($link, $feed, $cat_view);
+ }
+
+ if ($subop == "MarkAllRead") {
+ catchup_feed($link, $feed, $cat_view);
+
+ if (get_pref($link, 'ON_CATCHUP_SHOW_NEXT_FEED')) {
+ if ($next_unread_feed) {
+ $feed = $next_unread_feed;
+ }
+ }
+ }
+
if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {
$result = db_query($link, "SELECT rtl_content FROM ttrss_feeds
$rtl_content = false;
}
+ $script_dt_add = get_script_dt_add();
+
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
- <script type=\"text/javascript\" src=\"functions.js\"></script>
- <script type=\"text/javascript\" src=\"viewfeed.js\"></script>
+ <script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
+ <script type=\"text/javascript\" src=\"viewfeed.js?$script_dt_add\"></script>
<!--[if gte IE 5.5000]>
<script type=\"text/javascript\" src=\"pngfix.js\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss-ie.css\">
window.onload = init;
</script>";
- if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
- update_generic_feed($link, $feed, $cat_view);
- }
-
- if ($subop == "MarkAllRead") {
- catchup_feed($link, $feed, $cat_view);
- }
-
$search = db_escape_string($_GET["search"]);
$search_mode = db_escape_string($_GET["smode"]);
$feed_title = "?";
}
+ $feed_title = db_unescape_string($feed_title);
+
if ($feed < -10) error_reporting (0);
print "<div id=\"headlinesContainer\">";
print "<div class=\"cdmHeader\">";
- print "<div style=\"float : right\">$updated_fmt</div>";
+ print "<div style=\"float : right\">$updated_fmt,
+ <a class=\"cdmToggleLink\"
+ href=\"javascript:toggleUnread($id)\">Toggle unread</a>
+ </div>";
- print "<a target=\"new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
+ print "<a class=\"title\"
+ onclick=\"javascript:toggleUnread($id, 0)\"
+ target=\"new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
if ($line["feed_title"]) {
print " (<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)";
print "</div>";
print "<div class=\"cdmContent\">" . $line["content_preview"] . "</div>";
-
+
print "<div style=\"float : right\">$marked_pic</div>
- <div class=\"cdmFooter\">
+ <div lass=\"cdmFooter\">
<input type=\"checkbox\" onclick=\"toggleSelectRowById(this,
'RROW-$id')\" class=\"feedCheckBox\" id=\"RCHK-$id\"></div>";
+# print "<div align=\"center\"><a class=\"cdmToggleLink\"
+# href=\"javascript:toggleUnread($id)\">
+# Toggle unread</a></div>";
+
print "</div>";
}
print "Feed browser is administratively disabled.";
return;
}
+
+ print "<div id=\"infoBoxTitle\">Other feeds: Top 25</div>";
print "<div class=\"infoBoxContents\">";
- print "<h1>Feed browser</h1>";
-
- print "<p>Showing top 50 registered feeds, sorted by popularity:</p>";
+ print "<p>Showing top 25 registered feeds, sorted by popularity:</p>";
$result = db_query($link, "SELECT feed_url,count(id) AS subscribers
FROM ttrss_feeds
WHERE auth_login = '' AND auth_pass = '' AND private = false
- GROUP BY feed_url ORDER BY subscribers DESC LIMIT 50");
+ GROUP BY feed_url ORDER BY subscribers DESC LIMIT 25");
print "<ul class='browseFeedList' id='browseFeedList'>";
$title = htmlspecialchars(db_unescape_string(db_fetch_result($result,
0, "title")));
- print "<div class=\"infoBoxContents\">";
-
$icon_file = ICONS_DIR . "/$feed_id.ico";
if (file_exists($icon_file) && filesize($icon_file) > 0) {
} else {
$feed_icon = "";
}
-
- print "<h1>$feed_icon $title</h1>";
+
+ print "<div id=\"infoBoxTitle\">Feed editor</div>";
+
+ print "<div class=\"infoBoxContents\">";
+
+# print "<h1>$feed_icon $title</h1>";
print "<table width='100%'>";
- $row_class = "odd";
+# $row_class = "odd";
print "<tr class='$row_class'><td>Title:</td>";
print "<td><input id=\"iedit_title\" value=\"$title\"></td></tr>";
$feed_url = db_fetch_result($result, 0, "feed_url");
$feed_url = htmlspecialchars(db_unescape_string(db_fetch_result($result,
0, "feed_url")));
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
print "<tr class='$row_class'><td>Feed URL:</td>";
print "<td><input id=\"iedit_link\" value=\"$feed_url\"></td></tr>";
$cat_id = db_fetch_result($result, 0, "cat_id");
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
print "<tr class='$row_class'><td>Category:</td>";
print "<td>";
}
$update_interval = db_fetch_result($result, 0, "update_interval");
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
print "<tr class='$row_class'><td>Update Interval:</td>";
// print "<td><input id=\"iedit_updintl\"
print "</td>";
- $row_class = toggleEvenOdd($row_class);
- print "<tr class='$row_class'><td>Link to:</td>";
+# $row_class = toggleEvenOdd($row_class);
+
+ print "<tr class='$row_class'><td>Link to:</td><td>";
$tmp_result = db_query($link, "SELECT COUNT(id) AS count
FROM ttrss_feeds WHERE parent_feed = '$feed_id'");
$disabled = "disabled";
}
- print "<select $disabled id=\"iedit_parent_feed\">";
+ print "<select $disabled id=\"iedit_parent_feed\">";
print "<option id=\"0\">Not linked</option>";
$tmp_line["id"], $tmp_line["title"]);
}
- print "</select></td>";
- print "</td></tr>";
+ print "</select>";
+ print "</td></tr>";
$purge_interval = db_fetch_result($result, 0, "purge_interval");
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
print "<tr class='$row_class'><td>Purge Days:</td>";
// print "<td><input id=\"iedit_purgintl\"
// print "<tr><td colspan=\"2\"><b>Authentication</b></td></tr>";
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
$auth_login = db_fetch_result($result, 0, "auth_login");
print "<tr class='$row_class'><td>Login:</td>";
print "<td><input id=\"iedit_login\"
value=\"$auth_login\"></td></tr>";
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
$auth_pass = db_fetch_result($result, 0, "auth_pass");
print "<tr class='$row_class'><td>Password:</td>";
print "<td><input type=\"password\" id=\"iedit_pass\"
value=\"$auth_pass\"></td></tr>";
- $row_class = toggleEvenOdd($row_class);
+# $row_class = toggleEvenOdd($row_class);
$private = sql_bool_to_bool(db_fetch_result($result, 0, "private"));
if ($private) {
$feed_link = db_escape_string(trim($_GET["link"]));
$cat_id = db_escape_string($_GET["cid"]);
- if ($cat_id == "0" || !$cat_id) {
- $cat_qpart = "NULL";
+ if (subscribe_to_feed($link, $feed_link, $cat_id)) {
+ print "Added feed.";
} else {
- $cat_qpart = "'$cat_id'";
- }
-
- $result = db_query($link,
- "SELECT id FROM ttrss_feeds
- WHERE feed_url = '$feed_link' AND owner_uid = ".$_SESSION["uid"]);
-
- if (db_num_rows($result) == 0) {
-
- $result = db_query($link,
- "INSERT INTO ttrss_feeds (owner_uid,feed_url,title,cat_id)
- VALUES ('".$_SESSION["uid"]."', '$feed_link',
- '[Unknown]', $cat_qpart)");
-
- $result = db_query($link,
- "SELECT id FROM ttrss_feeds WHERE feed_url = '$feed_link'
- AND owner_uid = " . $_SESSION["uid"]);
-
- $feed_id = db_fetch_result($result, 0, "id");
-
- if ($feed_id) {
- update_rss_feed($link, $feed_link, $feed_id, true);
- }
- } else {
-
print "<div class=\"warning\">
Feed <b>$feed_link</b> already exists in the database.
</div>";
// onclick=\"javascript:hideParentElement(this);\" src=\"images/close.png\">";
print "<a href=\"javascript:showBlockElement('feedUpdateErrors')\">
- <b>Feeds with update errors</b> (click to expand)</a>";
+ <b>Some feeds have update errors (click for details)</b></a>";
print "<ul id=\"feedUpdateErrors\" class=\"nomarks\">";
cellspacing='0' cellpadding='0'><tr>
<td>
<input id=\"fadd_link\"
- onchange=\"javascript:addFeed()\"
- size=\"40\">
+ onchange=\"javascript:addFeed()\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
+ size=\"40\">
<input type=\"submit\" class=\"button\"
- onclick=\"javascript:addFeed()\" value=\"Add feed\">";
+ disabled=\"true\" id=\"fadd_submit_btn\"
+ onclick=\"addFeed()\" value=\"Subscribe\">";
- if (ENABLE_FEED_BROWSER) {
- print " (<a href='javascript:browseFeeds()'>Top 50</a>)";
+ if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) {
+ print " <input type=\"submit\" class=\"button\"
+ onclick=\"javascript:browseFeeds()\" value=\"Top 25\">";
}
print "</td><td align='right'>
<input id=\"feed_search\" size=\"20\"
- onchange=\"javascript:updateFeedList()\"
- value=\"$feed_search\">
+ onchange=\"javascript:updateFeedList()\" value=\"$feed_search\">
<input type=\"submit\" class=\"button\"
onclick=\"javascript:updateFeedList()\" value=\"Search\">
</td>
print "<tr><td colspan=\"6\" class=\"feedEditCat\">$edit_cat</td></tr>";
print "<tr class=\"title\">
- <td width='5%' align='center'> </td>
- <td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
+ <td width='5%'> </td>";
+
+ if (get_pref($link, 'ENABLE_FEED_ICONS')) {
+ print "<td width='3%'> </td>";
+ }
+
+ print "<td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
<td width='45%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
<td width='15%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">Updated</a></td>";
} else {
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
}
-// print "<td class='feedIcon'>$feed_icon</td>";
-
+
print "<td class='feedSelect'><input onclick='toggleSelectRow(this);'
type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
+ if (get_pref($link, 'ENABLE_FEED_ICONS')) {
+ print "<td class='feedIcon'>$feed_icon</td>";
+ }
+
$edit_title = truncate_string($edit_title, 40);
$edit_link = truncate_string($edit_link, 60);
}
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- "$feed_icon $edit_title $parent_title" . "</a></td>";
+ "$edit_title $parent_title" . "</a></td>";
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
$edit_link . "</a></td>";
print "
Selection:
- <input type=\"submit\" class=\"button\"
- onclick=\"javascript:selectedFeedDetails()\" value=\"Details\">
+ <!-- <input type=\"submit\" class=\"button\"
+ onclick=\"javascript:selectedFeedDetails()\" value=\"Details\"> -->
<input type=\"submit\" class=\"button\"
onclick=\"javascript:editSelectedFeed()\" value=\"Edit\">
<input type=\"submit\" class=\"button\"
- onclick=\"javascript:removeSelectedFeeds()\" value=\"Remove\">";
+ onclick=\"javascript:removeSelectedFeeds()\" value=\"Unsubscribe\">";
if (get_pref($link, 'ENABLE_FEED_CATS')) {
- print " ";
+ print " | ";
$result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]."
print "</select>";
print " <input type=\"submit\" class=\"button\"
- onclick=\"javascript:categorizeSelectedFeeds()\" value=\"Set category\">";
+ onclick=\"javascript:categorizeSelectedFeeds()\" value=\"Recategorize\">";
}
size=\"40\">
<input
type=\"submit\" class=\"button\"
- onclick=\"javascript:addFeedCat()\" value=\"Add category\"></div>";
+ onclick=\"javascript:addFeedCat()\" value=\"Create category\"></div>";
$result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]."
</td</tr>";
print "<tr class=\"title\">
- <td width=\"5%\"></td><td width=\"80%\">Title</td>
+ <td width=\"5%\"> </td><td width=\"80%\">Title</td>
</tr>";
$lnum = 0;
if ($quiet) return;
+ print "<div id=\"infoBoxShadow\">
+ <div id=\"infoBox\">PLACEHOLDER</div></div>";
+
$result = db_query($link, "SELECT description
FROM ttrss_filter_types ORDER BY description");
array_push($filter_types, $line["description"]);
}
- print "<div class=\"prefGenericAddBox\">
+/* print "<div class=\"prefGenericAddBox\">
<input id=\"fadd_regexp\" size=\"40\"> ";
print_select("fadd_match", "Title", $filter_types);
}
while ($line = db_fetch_assoc($result)) {
- printf("<option id='%d'>%s</option>", $line["id"], $line["title"]);
+ printf("<option id='%d'>%s</option>", $line["id"],
+ db_unescape_string($line["title"]));
}
print "</select> ";
class=\"button\" onclick=\"javascript:testFilter()\"
value=\"Test filter\"> "; */
- print "<input type=\"submit\"
+/* print "<input type=\"submit\"
class=\"button\" onclick=\"javascript:addFilter()\"
- value=\"Add filter\">";
+ value=\"Create filter\">"; */
- print "</div>";
+ print "<input type=\"submit\"
+ class=\"button\"
+ onclick=\"javascript:displayDlg('quickAddFilter', false)\"
+ value=\"Create filter\">";
+
+// print "</div>";
$result = db_query($link, "SELECT
ttrss_filters.id AS id,reg_exp,
if (!$line["description"]) $line["description"] = "[No description]";
- print "<td><input disabled=\"true\" type=\"checkbox\"
+ print "<td align='center'><input disabled=\"true\" type=\"checkbox\"
id=\"FICHK-".$line["id"]."\"></td>";
print "<td>".$line["reg_exp"]."</td>";
} else {
- print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
+ print "<td align='center'><input disabled=\"true\" type=\"checkbox\" checked></td>";
print "<td><input id=\"iedit_regexp\" value=\"".$line["reg_exp"].
"\"></td>";
$is_selected = "";
}
printf("<option $is_selected id='%d'>%s</option>",
- $tmp_line["id"], $tmp_line["title"]);
+ $tmp_line["id"], db_unescape_string($tmp_line["title"]));
}
print "</select></td>";
$expr = $_GET["expr"];
$descr = $_GET["descr"];
+ print "<div id=\"infoBoxTitle\">Test label: $descr</div>";
+
print "<div class='infoBoxContents'>";
- print "<h1>Label «$descr»</h1>";
+# print "<h1>Label «$descr»</h1>";
// print "<p><b>Expression</b>: $expr</p>";
}
print "<div class=\"prefGenericAddBox\">
- <input size=\"40\" id=\"ladd_expr\"> ";
+ <input size=\"40\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'label_create_btn')\"
+ id=\"ladd_expr\"> ";
print"<input type=\"submit\" class=\"button\"
- onclick=\"javascript:addLabel()\" value=\"Add label\"></div>";
+ disabled=\"true\" id=\"label_create_btn\"
+ onclick=\"javascript:addLabel()\" value=\"Create label\"></div>";
$result = db_query($link, "SELECT
id,sql_exp,description
print "<html><head>
<title>Tiny Tiny RSS : Help</title>
<link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
- <script type=\"text/javascript\" src=\"functions.js\"></script>
+ <script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</head><body>";
}
$tid = sprintf("%d", $_GET["tid"]);
+ print "<div id=\"infoBoxTitle\">Help</div>";
+
print "<div class='infoBoxContents'>";
if (file_exists("help/$tid.php")) {
$param = $_GET["param"];
if ($id == "quickAddFeed") {
- print "
- Feed URL: <input
- onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\"
- id=\"qafInput\">";
+
+ print "<div id=\"infoBoxTitle\">Subscribe to feed</div>";
+ print "<div class=\"infoBoxContents\">";
+
+ print "<table width='100%'>
+ <tr><td>Feed URL:</td><td>
+ <input onblur=\"javascript:enableHotkeys()\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
+ onfocus=\"javascript:disableHotkeys()\" id=\"qafInput\"></td></tr>";
if (get_pref($link, 'ENABLE_FEED_CATS')) {
+ print "<tr><td>Category:</td><td>";
+
$result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]."
ORDER BY title");
- print " <select id=\"qafCat\">";
+ print "<select id=\"qafCat\">";
print "<option id=\"0\">Uncategorized</option>";
if (db_num_rows($result) != 0) {
}
print "</select>";
+ print "</td></tr>";
}
- print " <input class=\"button\"
- type=\"submit\" onclick=\"javascript:qafAdd()\" value=\"Add feed\">
- <input class=\"button\"
- type=\"submit\" onclick=\"javascript:closeDlg()\"
- value=\"Cancel\">";
+ print "<tr><td colspan='2' align='right'>
+ <input class=\"button\"
+ id=\"fadd_submit_btn\" disabled=\"true\"
+ type=\"submit\" onclick=\"javascript:qafAdd()\" value=\"Subscribe\">
+ <input class=\"button\"
+ type=\"submit\" onclick=\"javascript:closeInfoBox()\"
+ value=\"Cancel\"></td></tr></table>";
}
if ($id == "quickDelFeed") {
<input class=\"button\"
type=\"submit\" onclick=\"javascript:qfdDelete($param)\" value=\"Remove\">
<input class=\"button\"
- type=\"submit\" onclick=\"javascript:closeDlg()\"
+ type=\"submit\" onclick=\"javascript:closeInfoBox()\"
value=\"Cancel\">";
} else {
print "Error: Feed $param not found.
<input class=\"button\"
- type=\"submit\" onclick=\"javascript:closeDlg()\"
+ type=\"submit\" onclick=\"javascript:closeInfoBox()\"
value=\"Cancel\">";
}
}
if ($id == "search") {
+ print "<div id=\"infoBoxTitle\">Search</div>";
+ print "<div class=\"infoBoxContents\">";
+
$active_feed_id = db_escape_string($_GET["param"]);
+ print "<table width='100%'><tr><td>Search:</td><td>";
+
print "<input id=\"searchbox\" class=\"extSearch\"
- onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\"
- onchange=\"javascript:search()\">
+ onblur=\"javascript:enableHotkeys()\"
+ onfocus=\"javascript:disableHotkeys()\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'search_submit_btn')\"
+ onchange=\"javascript:search()\">
+ </td></tr><tr><td>Where:</td><td>
<select id=\"searchmodebox\">
<option selected>All feeds</option>";
print "<option>This category</option>";
}
- print "</select>
+ print "</select></td></tr>
+
+ <tr><td colspan='2' align='right'>
<input type=\"submit\"
- class=\"button\" onclick=\"javascript:search()\" value=\"Search\">
+ class=\"button\" onclick=\"javascript:search()\"
+ id=\"search_submit_btn\" disabled=\"true\"
+ value=\"Search\">
<input class=\"button\"
- type=\"submit\" onclick=\"javascript:closeDlg()\"
- value=\"Close\">";
+ type=\"submit\" onclick=\"javascript:closeInfoBox()\"
+ value=\"Cancel\"></td></tr></table>";
}
if ($id == "quickAddFilter") {
+ print "<div id=\"infoBoxTitle\">Create filter</div>";
+ print "<div class=\"infoBoxContents\">";
+
$result = db_query($link, "SELECT description
FROM ttrss_filter_types ORDER BY description");
array_push($filter_types, $line["description"]);
}
- print "<table>";
+ print "<table width='100%'>";
- print "<tr><td>Match:</td><td><input id=\"fadd_regexp\" size=\"40\"> ";
+ print "<tr><td>Match:</td>
+ <td><input onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
+ id=\"fadd_regexp\" size=\"30\"> ";
print_select("fadd_match", "Title", $filter_types);
print "</td></tr><tr><td colspan=\"2\" align=\"right\">";
print "<input type=\"submit\"
+ id=\"infobox_submit\"
class=\"button\" onclick=\"javascript:qaddFilter()\"
- value=\"Add filter\"> ";
+ disabled=\"true\" value=\"Create\"> ";
print "<input class=\"button\"
- type=\"submit\" onclick=\"javascript:closeDlg()\"
- value=\"Close\">";
+ type=\"submit\" onclick=\"javascript:closeInfoBox()\"
+ value=\"Cancel\">";
print "</td></tr></table>";
+
}
+
+ print "</div>";
+
}
// update feeds of all users, may be used anonymously
print "</form>";
- print "<form action=\"backend.php\" method=\"POST\">";
+ print "<form action=\"backend.php\" method=\"POST\" name=\"changePassForm\">";
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>Authentication</h3></tr></td>";
print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">";
print "<p><input class=\"button\" type=\"submit\"
+ onclick=\"return validateNewPassword(this.form)\"
value=\"Change password\" name=\"subop\">";
print "</form>";
}
print "<div class=\"prefGenericAddBox\">
- <input id=\"uadd_box\" onchange=\"javascript:addUser()\" size=\"40\"> ";
+ <input id=\"uadd_box\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'user_add_btn')\"
+ onchange=\"javascript:addUser()\" size=\"40\"> ";
print"<input type=\"submit\" class=\"button\"
- onclick=\"javascript:addUser()\" value=\"Add user\"></div>";
+ id=\"user_add_btn\" disabled=\"true\"
+ onclick=\"javascript:addUser()\" value=\"Create user\"></div>";
$result = db_query($link, "SELECT
id,login,access_level,email,
print "<tr class=\"title\">
<td align='center' width=\"5%\"> </td>
- <td width='20%'>Username</td>
+ <td width='20%'>Login</td>
<td width='20%'>E-mail</td>
<td width='20%'>Access Level</td>
<td width='20%'>Last login</td></tr>";
print "<td><a href=\"javascript:editUser($uid);\">" .
$line["login"] . "</td>";
+ if (!$line["email"]) $line["email"] = " ";
+
print "<td><a href=\"javascript:editUser($uid);\">" .
$line["email"] . "</td>";
} else if ($uid != $edit_uid) {
+ if (!$line["email"]) $line["email"] = " ";
+
print "<td align='center'><input disabled=\"true\" type=\"checkbox\"
id=\"UMCHK-".$line["id"]."\"></td>";
$uid = sprintf("%d", $_GET["id"]);
+ print "<div id=\"infoBoxTitle\">User details</div>";
+
print "<div class='infoBoxContents'>";
$result = db_query($link, "SELECT login,
return;
}
- print "<h1>User Details</h1>";
+# print "<h1>User Details</h1>";
+
+ $login = db_fetch_result($result, 0, "login");
+
+ print "<h1>$login</h1>";
print "<table width='100%'>";
- $login = db_fetch_result($result, 0, "login");
$last_login = date(get_pref($link, 'LONG_DATE_FORMAT'),
strtotime(db_fetch_result($result, 0, "last_login")));
$access_level = db_fetch_result($result, 0, "access_level");
$stored_articles = db_fetch_result($result, 0, "stored_articles");
- print "<tr><td>Username</td><td>$login</td></tr>";
+# print "<tr><td>Username</td><td>$login</td></tr>";
print "<tr><td>Access level</td><td>$access_level</td></tr>";
print "<tr><td>Last logged in</td><td>$last_login</td></tr>";
print "<tr><td>Stored articles</td><td>$stored_articles</td></tr>";
print "<ul class=\"userFeedList\">";
+ $row_class = "odd";
+
while ($line = db_fetch_assoc($result)) {
$icon_file = ICONS_URL."/".$line["id"].".ico";
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
}
- print "<li>$feed_icon <a href=\"".$line["site_url"]."\">".$line["title"]."</a></li>";
+ print "<li class=\"$row_class\">$feed_icon <a href=\"".$line["site_url"]."\">".$line["title"]."</a></li>";
+
+ $row_class = toggleEvenOdd($row_class);
+
}
if (db_num_rows($result) < $num_feeds) {
$feed_ids = split(",", db_escape_string($_GET["id"]));
+ print "<div id=\"infoBoxTitle\">Feed details</div>";
print "<div class=\"infoBoxContents\">";
foreach ($feed_ids as $feed_id) {
return;
}
+ print "<p>This panel shows feeds subscribed by other users of this system, just in case you are interested in some of them too.</p>";
+
+ $limit = db_escape_string($_GET["limit"]);
+
+ if (!$limit) $limit = 25;
+
$result = db_query($link, "SELECT feed_url,count(id) AS subscribers
FROM ttrss_feeds
WHERE auth_login = '' AND auth_pass = '' AND private = false
- GROUP BY feed_url ORDER BY subscribers DESC LIMIT 100");
-
+ GROUP BY feed_url ORDER BY subscribers DESC LIMIT $limit");
+
+ print "<div style=\"float : right\">
+ Top <select id=\"feedBrowserLimit\">";
+
+ foreach (array(25, 50, 100) as $l) {
+ $issel = ($l == $limit) ? "selected" : "";
+ print "<option $issel>$l</option>";
+ }
+
+ print "</select>
+ <input type=\"submit\" class=\"button\"
+ onclick=\"updateBigFeedBrowser()\" value=\"Show\">
+ </div>";
+
+ print "<p>Selection:
+ <input type='submit' class='button' onclick=\"feedBrowserSubscribe()\"
+ value=\"Subscribe\">";
+
print "<ul class='nomarks' id='browseBigFeedList'>";
$feedctr = 0;
print "</ul>";
- print "<p>Selection:
- <input type='submit' class='button' onclick=\"feedBrowserSubscribe()\"
- value=\"Subscribe\"></p>";
-
print "</div>";
}
"SESSION_COOKIE_LIFETIME_REMEMBER";
}
- if (defined('DISABLE_SESSIONS') && DISABLE_SESSIONS) {
+ if (defined('DISABLE_SESSIONS')) {
return "config: you have enabled DISABLE_SESSIONS. Please disable this option.";
}