$op = $_REQUEST["op"];
- define('SCHEMA_VERSION', 7);
+ define('SCHEMA_VERSION', 8);
require_once "sanity_check.php";
require_once "config.php";
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"];
$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
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"]);
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%'>";
print "</td>";
# $row_class = toggleEvenOdd($row_class);
- print "<tr class='$row_class'><td>Link to:</td>";
+
+ 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);
// 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 && !SINGLE_USER_MODE) {
- print " (<a href='javascript:browseFeeds()'>Top 50</a>)";
+ 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>
class=\"prefFeedList\" id=\"prefFeedList\">";
print "<tr><td class=\"selectPrompt\" colspan=\"8\">
Select:
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFeedList',
- 'FEEDR-', 'FRCHK-', true)\">All</a>,
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFeedList',
- 'FEEDR-', 'FRCHK-', false)\">None</a>
+ <a href=\"javascript:selectPrefRows('feed', true)\">All</a>,
+ <a href=\"javascript:selectPrefRows('feed', false)\">None</a>
</td</tr>";
if (!get_pref($link, 'ENABLE_FEED_CATS')) {
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);'
+
+ print "<td class='feedSelect'><input onclick='toggleSelectPrefRow(this, \"feed\");'
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>";
-/* if (get_pref($link, 'ENABLE_FEED_CATS')) {
- print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $edit_cat . "</a></td>";
- } */
-
-/* print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $update_intervals[$line["update_interval"]] . "</a></td>";
-
- print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $purge_intervals[$line["purge_interval"]] . "</a></td>"; */
-
print "<td align='right'><a href=\"javascript:editFeed($feed_id);\">" .
"$last_updated</a></td>";
print "</table>";
- print "<p>";
+ print "<p><span id=\"feedOpToolbar\">";
if ($subop == "edit") {
print "Edit feed:
print "
Selection:
- <input type=\"submit\" class=\"button\"
- onclick=\"javascript:selectedFeedDetails()\" value=\"Details\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:editSelectedFeed()\" value=\"Edit\">
- <input type=\"submit\" class=\"button\"
- onclick=\"javascript:removeSelectedFeeds()\" value=\"Remove\">";
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
+ 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"]."
ORDER BY title");
- print "<select id=\"sfeed_set_fcat\">";
+ print "<select id=\"sfeed_set_fcat\" disabled=\"true\">";
print "<option id=\"0\">Uncategorized</option>";
if (db_num_rows($result) != 0) {
print "</select>";
- print " <input type=\"submit\" class=\"button\"
- onclick=\"javascript:categorizeSelectedFeeds()\" value=\"Set category\">";
+ print " <input type=\"submit\" class=\"button\" disabled=\"true\"
+ onclick=\"javascript:categorizeSelectedFeeds()\" value=\"Recategorize\">";
}
- print "
+ print "</span>
All feeds: <input type=\"submit\"
class=\"button\" onclick=\"gotoExportOpml()\"
value=\"Export OPML\">";
print "<div class=\"prefGenericAddBox\">
<input id=\"fadd_cat\"
onchange=\"javascript:addFeedCat()\"
+ onkeyup=\"toggleSubmitNotEmpty(this, 'catadd_submit_btn')\"
size=\"40\">
<input
- type=\"submit\" class=\"button\"
- onclick=\"javascript:addFeedCat()\" value=\"Add category\"></div>";
+ type=\"submit\" class=\"button\" disabled=\"true\" id=\"catadd_submit_btn\"
+ onclick=\"javascript:addFeedCat()\" value=\"Create category\"></div>";
$result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]."
print "<tr><td class=\"selectPrompt\" colspan=\"8\">
Select:
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFeedCatList',
- 'FCATR-', 'FCCHK-', true)\">All</a>,
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFeedCatList',
- 'FCATR-', 'FCCHK-', false)\">None</a>
+ <a href=\"javascript:selectPrefRows('fcat', true)\">All</a>,
+ <a href=\"javascript:selectPrefRows('fcat', false)\">None</a>
</td</tr>";
print "<tr class=\"title\">
if (!$edit_cat_id || $subop != "editCat") {
- print "<td align='center'><input onclick='toggleSelectRow(this);'
- type=\"checkbox\" id=\"FCCHK-".$line["id"]."\"></td>";
+ print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"fcat\");'
+ type=\"checkbox\" id=\"FCCHK-".$line["id"]."\"></td>";
print "<td><a href=\"javascript:editFeedCat($cat_id);\">" .
$edit_title . "</a></td>";
print "</table>";
- print "<p>";
+ print "<p id=\"catOpToolbar\">";
if ($subop == "editCat") {
print "Edit category:
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\"
onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\"
onclick=\"javascript:feedCatEditSave()\" value=\"Save\">";
} else {
print "
Selection:
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">";
}
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);
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,
print "<tr><td class=\"selectPrompt\" colspan=\"8\">
Select:
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFilterList',
- 'FILRR-', 'FICHK-', true)\">All</a>,
- <a href=\"javascript:selectTableRowsByIdPrefix('prefFilterList',
- 'FILRR-', 'FICHK-', false)\">None</a>
+ <a href=\"javascript:selectPrefRows('filter', true)\">All</a>,
+ <a href=\"javascript:selectPrefRows('filter', false)\">None</a>
</td</tr>";
print "<tr class=\"title\">
if (!$edit_filter_id || $subop != "edit") {
- print "<td align='center'><input onclick='toggleSelectRow(this);'
+ print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"filter\");'
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
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>";
print "</table>";
- print "<p>";
+ print "<p id=\"filterOpToolbar\">";
if ($subop == "edit") {
print "Edit filter:
print "
Selection:
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:editSelectedFilter()\" value=\"Edit\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">";
}
$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 "<tr><td class=\"selectPrompt\" colspan=\"8\">
Select:
- <a href=\"javascript:selectTableRowsByIdPrefix('prefLabelList',
- 'LILRR-', 'LICHK-', true)\">All</a>,
- <a href=\"javascript:selectTableRowsByIdPrefix('prefLabelList',
- 'LILRR-', 'LICHK-', false)\">None</a>
+ <a href=\"javascript:selectPrefRows('label', true)\">All</a>,
+ <a href=\"javascript:selectPrefRows('label', false)\">None</a>
</td</tr>";
print "<tr class=\"title\">
if (!$line["description"]) $line["description"] = "[No caption]";
- print "<td align='center'><input onclick='toggleSelectRow(this);'
+ print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"label\");'
type=\"checkbox\" id=\"LICHK-".$line["id"]."\"></td>";
print "<td><a href=\"javascript:editLabel($label_id);\">" .
"\"></td>";
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
- "\"></td>";
-
+ "\"></td>";
}
print "</table>";
- print "<p>";
+ print "<p id=\"labelOpToolbar\">";
if ($subop == "edit") {
print "Edit label:
<input type=\"submit\" class=\"button\"
onclick=\"javascript:labelEditCancel()\" value=\"Cancel\">";
- } else {
-
+ } else {
print "
Selection:
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:editSelectedLabel()\" value=\"Edit\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">";
}
} else {
$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>";
$tmp_user_pwd = make_password(8);
$pwd_hash = 'SHA1:' . sha1($tmp_user_pwd);
- db_query($link, "INSERT INTO ttrss_users
- (login,pwd_hash,access_level,last_login)
- VALUES ('$login', '$pwd_hash', 0, NOW())");
-
-
$result = db_query($link, "SELECT id FROM ttrss_users WHERE
- login = '$login' AND pwd_hash = '$pwd_hash'");
-
- if (db_num_rows($result) == 1) {
-
- $new_uid = db_fetch_result($result, 0, "id");
+ login = '$login'");
- print "<div class=\"notice\">Added user <b>".$_GET["login"].
- "</b> with password <b>$tmp_user_pwd</b>.</div>";
-
- initialize_user($link, $new_uid);
+ if (db_num_rows($result) == 0) {
+ db_query($link, "INSERT INTO ttrss_users
+ (login,pwd_hash,access_level,last_login)
+ VALUES ('$login', '$pwd_hash', 0, NOW())");
+
+
+ $result = db_query($link, "SELECT id FROM ttrss_users WHERE
+ login = '$login' AND pwd_hash = '$pwd_hash'");
+
+ if (db_num_rows($result) == 1) {
+
+ $new_uid = db_fetch_result($result, 0, "id");
+
+ print "<div class=\"notice\">Added user <b>".$_GET["login"].
+ "</b> with password <b>$tmp_user_pwd</b>.</div>";
+
+ initialize_user($link, $new_uid);
+
+ } else {
+
+ print "<div class=\"warning\">Could not create user <b>".
+ $_GET["login"]."</b></div>";
+
+ }
} else {
-
- print "<div class=\"warning\">Error while adding user <b>".
- $_GET["login"].".</b></div>";
-
+ print "<div class=\"warning\">User <b>".
+ $_GET["login"]."</b> already exists.</div>";
}
}
} else if ($subop == "resetPass") {
}
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><td class=\"selectPrompt\" colspan=\"8\">
Select:
- <a href=\"javascript:selectTableRowsByIdPrefix('prefUserList',
- 'UMRR-', 'UMCHK-', true)\">All</a>,
- <a href=\"javascript:selectTableRowsByIdPrefix('prefUserList',
- 'UMRR-', 'UMCHK-', false)\">None</a>
+ <a href=\"javascript:selectPrefRows('user', true)\">All</a>,
+ <a href=\"javascript:selectPrefRows('user', false)\">None</a>
</td</tr>";
print "<tr class=\"title\">
$access_level_names = array(0 => "User", 10 => "Administrator");
-/* if ($uid == $_SESSION["uid"]) {
-
- print "<td align='center'><input disabled=\"true\" type=\"checkbox\"
- id=\"UMCHK-".$line["id"]."\"></td>";
-
- print "<td>".$line["login"]."</td>";
- print "<td>".$line["email"]."</td>";
- print "<td>".$line["access_level"]."</td>";
+ if (!$edit_uid || $subop != "edit") {
- } else */ if (!$edit_uid || $subop != "edit") {
-
- print "<td align='center'><input onclick='toggleSelectRow(this);'
+ print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"user\");'
type=\"checkbox\" id=\"UMCHK-$uid\"></td>";
print "<td><a href=\"javascript:editUser($uid);\">" .
print "<td><input id=\"iedit_email\" value=\"".$line["email"].
"\"></td>";
-// print "<td><input id=\"iedit_ulevel\" value=\"".$line["access_level"].
-// "\"></td>";
-
print "<td>";
print "<select id=\"iedit_ulevel\">";
foreach (array_keys($access_level_names) as $al) {
print "</table>";
- print "<p>";
+ print "<p id='userOpToolbar'>";
if ($subop == "edit") {
print "Edit user:
print "
Selection:
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:selectedUserDetails()\" value=\"User details\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:editSelectedUser()\" value=\"Edit\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:removeSelectedUsers()\" value=\"Remove\">
- <input type=\"submit\" class=\"button\"
+ <input type=\"submit\" class=\"button\" disabled=\"true\"
onclick=\"javascript:resetSelectedUserPass()\" value=\"Reset password\">";
}
$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) {
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()\"