"padding : 5px; border-style : dashed; border-color : #e7d796;".
"margin-bottom : 1em; color : #9a8c59;";
- if (!$limit) $limit = 100;
+ if (!$limit) $limit = 60;
- if (get_pref($this->link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
- $date_sort_field = "updated";
- } else {
- $date_sort_field = "date_entered";
- }
+ $date_sort_field = "date_entered DESC, updated DESC";
if ($feed == -2)
- $date_sort_field = "last_published";
+ $date_sort_field = "last_published DESC";
else if ($feed == -1)
- $date_sort_field = "last_marked";
+ $date_sort_field = "last_marked DESC";
+
+ $qfh_ret = queryFeedHeadlines($this->link, $feed,
+ 1, $view_mode, $is_cat, $search, $search_mode,
+ $date_sort_field, $offset, $owner_uid,
+ false, 0, false, true);
+
+ $result = $qfh_ret[0];
+
+ if (db_num_rows($result) != 0) {
+ $ts = strtotime(db_fetch_result($result, 0, "date_entered"));
+
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
+ strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $ts) {
+ header('HTTP/1.0 304 Not Modified');
+ return;
+ }
+
+ $last_modified = gmdate("D, d M Y H:i:s", $ts) . " GMT";
+ header("Last-Modified: $last_modified", true);
+ }
$qfh_ret = queryFeedHeadlines($this->link, $feed,
$limit, $view_mode, $is_cat, $search, $search_mode,
- "$date_sort_field DESC", $offset, $owner_uid,
+ $date_sort_field, $offset, $owner_uid,
false, 0, false, true);
+
$result = $qfh_ret[0];
$feed_title = htmlspecialchars($qfh_ret[1]);
$feed_site_url = $qfh_ret[2];
$tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
- while ($line = db_fetch_assoc($result)) {
+ while ($line = db_fetch_assoc($result)) {
+
$tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
if ($line['note']) {
$content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
$content;
-}
+ $tpl->setVariable('ARTICLE_NOTE', htmlspecialchars($line['note']), true);
+ }
$tpl->setVariable('ARTICLE_CONTENT', $content, true);
include "rssfuncs.php";
// Update all feeds needing a update.
update_daemon_common($this->link, 0, true, false);
+
+ // Update feedbrowser
+ update_feedbrowser_cache($this->link);
+
+ // Purge orphans and cleanup tags
+ purge_orphans($this->link);
+
+ cleanup_tags($this->link, 14, 50000);
+
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_UPDATE_TASK, "hook_update_task", $op);
+
}
function sharepopup() {
}
header('Content-Type: text/html; charset=utf-8');
- print "<html>
- <head>
- <title>Tiny Tiny RSS</title>
- <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
- <script type=\"text/javascript\" src=\"lib/prototype.js\"></script>
- <script type=\"text/javascript\" src=\"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls\"></script>
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
- </head>
- <body id='sharepopup'>";
+ print "<html><head><title>Tiny Tiny RSS</title>";
+
+ print stylesheet_tag("utility.css");
+ print javascript_tag("lib/prototype.js");
+ print javascript_tag("lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls");
+ print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
+ </head><body id='sharepopup'>";
$action = $_REQUEST["action"];
}
function login() {
-
$_SESSION["prefs_cache"] = array();
if (!SINGLE_USER_MODE) {
$password = $_POST["password"];
$remember_me = $_POST["remember_me"];
+ if ($remember_me) {
+ session_set_cookie_params(SESSION_COOKIE_LIFETIME);
+ } else {
+ session_set_cookie_params(0);
+ }
+
+ @session_start();
+
if (authenticate_user($this->link, $login, $password)) {
$_POST["password"] = "";
function forgotpass() {
header('Content-Type: text/html; charset=utf-8');
- print "<html>
- <head>
- <title>Tiny Tiny RSS</title>
- <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
- <script type=\"text/javascript\" src=\"lib/prototype.js\"></script>
- <script type=\"text/javascript\" src=\"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls\"></script>
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
- </head>
- <body id='forgotpass'>";
+ print "<html><head><title>Tiny Tiny RSS</title>";
+
+ print stylesheet_tag("utility.css");
+ print javascript_tag("lib/prototype.js");
+
+ print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
+ </head><body id='forgotpass'>";
print '<div class="floatingLogo"><img src="images/logo_small.png"></div>';
- print "<h1>".__("Reset password")."</h1>";
+ print "<h1>".__("Password recovery")."</h1>";
print "<div class='content'>";
@$method = $_POST['method'];
if (!$method) {
- $secretkey = uniqid();
- $_SESSION["secretkey"] = $secretkey;
+ print_notice(__("You will need to provide valid account name and email. New password will be sent on your email address."));
print "<form method='POST' action='public.php'>";
- print "<input type='hidden' name='secretkey' value='$secretkey'>";
print "<input type='hidden' name='method' value='do'>";
print "<input type='hidden' name='op' value='forgotpass'>";
print "</form>";
} else if ($method == 'do') {
- $secretkey = $_POST["secretkey"];
$login = db_escape_string($this->link, $_POST["login"]);
$email = db_escape_string($this->link, $_POST["email"]);
$test = db_escape_string($this->link, $_POST["test"]);
if (($test != 4 && $test != 'four') || !$email || !$login) {
print_error(__('Some of the required form parameters are missing or incorrect.'));
- print "<p><a href=\"public.php?op=forgotpass\">".__("Go back")."</a></p>";
+ print "<form method=\"GET\" action=\"public.php\">
+ <input type=\"hidden\" name=\"op\" value=\"forgotpass\">
+ <input type=\"submit\" value=\"".__("Go back")."\">
+ </form>";
- } else if ($_SESSION["secretkey"] == $secretkey) {
+ } else {
$result = db_query($this->link, "SELECT id FROM ttrss_users
WHERE login = '$login' AND email = '$email'");
Pref_Users::resetUserPassword($this->link, $id, false);
- print "<p>".__("Completed.")."</p>";
+ print "<p>";
+
+ print "<p>"."Completed."."</p>";
+
+ print "<form method=\"GET\" action=\"index.php\">
+ <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
+ </form>";
} else {
print_error(__("Sorry, login and email combination not found."));
- print "<p><a href=\"public.php?op=forgotpass\">".__("Go back")."</a></p>";
- }
- } else {
- print_error(__("Form secret key incorrect. Please enable cookies and try again."));
- print "<p><a href=\"public.php?op=forgotpass\">".__("Go back")."</a></p>";
+ print "<form method=\"GET\" action=\"public.php\">
+ <input type=\"hidden\" name=\"op\" value=\"forgotpass\">
+ <input type=\"submit\" value=\"".__("Go back")."\">
+ </form>";
+ }
}
}