Merge branch 'master' of http://github.com/gothfox/Tiny-Tiny-RSS
updating from github]
This commit is contained in:
commit
e4e9ac1fc2
|
@ -203,7 +203,7 @@ class API extends Handler {
|
||||||
$override_order = false;
|
$override_order = false;
|
||||||
switch ($_REQUEST["order_by"]) {
|
switch ($_REQUEST["order_by"]) {
|
||||||
case "date_reverse":
|
case "date_reverse":
|
||||||
$override_order = "date_entered, updated";
|
$override_order = "score DESC, date_entered, updated";
|
||||||
break;
|
break;
|
||||||
case "feed_dates":
|
case "feed_dates":
|
||||||
$override_order = "updated DESC";
|
$override_order = "updated DESC";
|
||||||
|
|
|
@ -377,9 +377,9 @@ class Feeds extends Handler_Protected {
|
||||||
title=\"$score\">";
|
title=\"$score\">";
|
||||||
|
|
||||||
if ($score > 500) {
|
if ($score > 500) {
|
||||||
$hlc_suffix = "H";
|
$hlc_suffix = "high";
|
||||||
} else if ($score < -100) {
|
} else if ($score < -100) {
|
||||||
$hlc_suffix = "L";
|
$hlc_suffix = "low";
|
||||||
} else {
|
} else {
|
||||||
$hlc_suffix = "";
|
$hlc_suffix = "";
|
||||||
}
|
}
|
||||||
|
@ -448,8 +448,8 @@ class Feeds extends Handler_Protected {
|
||||||
$reply['content'] .= "</div>";
|
$reply['content'] .= "</div>";
|
||||||
|
|
||||||
$reply['content'] .= "<div onclick='return hlClicked(event, $id)'
|
$reply['content'] .= "<div onclick='return hlClicked(event, $id)'
|
||||||
class=\"hlTitle\"><span class='hlContent$hlc_suffix'>";
|
class=\"hlTitle\"><span class='hlContent $hlc_suffix'>";
|
||||||
$reply['content'] .= "<a id=\"RTITLE-$id\" class=\"title\"
|
$reply['content'] .= "<a id=\"RTITLE-$id\" class=\"title $hlc_suffix\"
|
||||||
href=\"" . htmlspecialchars($line["link"]) . "\"
|
href=\"" . htmlspecialchars($line["link"]) . "\"
|
||||||
onclick=\"\">" .
|
onclick=\"\">" .
|
||||||
truncate_string($line["title"], 200);
|
truncate_string($line["title"], 200);
|
||||||
|
@ -539,7 +539,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$expanded_class = $expand_cdm ? "expanded" : "expandable";
|
$expanded_class = $expand_cdm ? "expanded" : "expandable";
|
||||||
|
|
||||||
$reply['content'] .= "<div class=\"cdm $expanded_class $class\"
|
$reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
|
||||||
id=\"RROW-$id\" $mouseover_attrs>";
|
id=\"RROW-$id\" $mouseover_attrs>";
|
||||||
|
|
||||||
$reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
|
$reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
|
||||||
|
@ -556,8 +556,8 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['content'] .= "<span id=\"RTITLE-$id\"
|
$reply['content'] .= "<span id=\"RTITLE-$id\"
|
||||||
onclick=\"return cdmClicked(event, $id);\"
|
onclick=\"return cdmClicked(event, $id);\"
|
||||||
class=\"titleWrap$hlc_suffix\">
|
class=\"titleWrap $hlc_suffix\">
|
||||||
<a class=\"title\"
|
<a class=\"title $hlc_suffix\"
|
||||||
target=\"_blank\" href=\"".
|
target=\"_blank\" href=\"".
|
||||||
htmlspecialchars($line["link"])."\">".
|
htmlspecialchars($line["link"])."\">".
|
||||||
$line["title"] .
|
$line["title"] .
|
||||||
|
@ -863,7 +863,7 @@ class Feeds extends Handler_Protected {
|
||||||
$override_order = "ttrss_entries.title";
|
$override_order = "ttrss_entries.title";
|
||||||
break;
|
break;
|
||||||
case "date_reverse":
|
case "date_reverse":
|
||||||
$override_order = "date_entered, updated";
|
$override_order = "score DESC, date_entered, updated";
|
||||||
break;
|
break;
|
||||||
case "feed_dates":
|
case "feed_dates":
|
||||||
$override_order = "updated DESC";
|
$override_order = "updated DESC";
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
|
private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
|
||||||
$limit, $offset, $search, $search_mode,
|
$limit, $offset, $search, $search_mode,
|
||||||
$view_mode = false, $format = 'atom', $order = false) {
|
$view_mode = false, $format = 'atom', $order = false, $orig_guid = false) {
|
||||||
|
|
||||||
require_once "lib/MiniTemplator.class.php";
|
require_once "lib/MiniTemplator.class.php";
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ class Handler_Public extends Handler {
|
||||||
$last_error = $qfh_ret[3];
|
$last_error = $qfh_ret[3];
|
||||||
|
|
||||||
$feed_self_url = get_self_url_prefix() .
|
$feed_self_url = get_self_url_prefix() .
|
||||||
"/public.php?op=rss&id=-2&key=" .
|
"/public.php?op=rss&id=$feed&key=" .
|
||||||
get_feed_access_key(-2, false, $owner_uid);
|
get_feed_access_key($feed, false, $owner_uid);
|
||||||
|
|
||||||
if (!$feed_site_url) $feed_site_url = get_self_url_prefix();
|
if (!$feed_site_url) $feed_site_url = get_self_url_prefix();
|
||||||
|
|
||||||
|
@ -88,7 +88,10 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
while ($line = $this->dbh->fetch_assoc($result)) {
|
while ($line = $this->dbh->fetch_assoc($result)) {
|
||||||
|
|
||||||
$tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
|
$tpl->setVariable('ARTICLE_ID',
|
||||||
|
htmlspecialchars($orig_guid ? $line['link'] :
|
||||||
|
get_self_url_prefix() .
|
||||||
|
"/public.php?url=" . urlencode($line['link'])), true);
|
||||||
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
|
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
|
||||||
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
|
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
|
||||||
$tpl->setVariable('ARTICLE_EXCERPT',
|
$tpl->setVariable('ARTICLE_EXCERPT',
|
||||||
|
@ -111,6 +114,9 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
$tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
|
$tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
|
||||||
|
|
||||||
|
$tpl->setVariable('ARTICLE_SOURCE_LINK', htmlspecialchars($line['site_url']), true);
|
||||||
|
$tpl->setVariable('ARTICLE_SOURCE_TITLE', htmlspecialchars($line['feed_title']), true);
|
||||||
|
|
||||||
$tags = get_article_tags($line["id"], $owner_uid);
|
$tags = get_article_tags($line["id"], $owner_uid);
|
||||||
|
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
|
@ -342,7 +348,7 @@ class Handler_Public extends Handler {
|
||||||
function rss() {
|
function rss() {
|
||||||
$feed = $this->dbh->escape_string($_REQUEST["id"]);
|
$feed = $this->dbh->escape_string($_REQUEST["id"]);
|
||||||
$key = $this->dbh->escape_string($_REQUEST["key"]);
|
$key = $this->dbh->escape_string($_REQUEST["key"]);
|
||||||
$is_cat = $_REQUEST["is_cat"] != false;
|
$is_cat = sql_bool_to_bool($_REQUEST["is_cat"]);
|
||||||
$limit = (int)$this->dbh->escape_string($_REQUEST["limit"]);
|
$limit = (int)$this->dbh->escape_string($_REQUEST["limit"]);
|
||||||
$offset = (int)$this->dbh->escape_string($_REQUEST["offset"]);
|
$offset = (int)$this->dbh->escape_string($_REQUEST["offset"]);
|
||||||
|
|
||||||
|
@ -352,6 +358,7 @@ class Handler_Public extends Handler {
|
||||||
$order = $this->dbh->escape_string($_REQUEST["order"]);
|
$order = $this->dbh->escape_string($_REQUEST["order"]);
|
||||||
|
|
||||||
$format = $this->dbh->escape_string($_REQUEST['format']);
|
$format = $this->dbh->escape_string($_REQUEST['format']);
|
||||||
|
$orig_guid = !sql_bool_to_bool($_REQUEST["no_orig_guid"]);
|
||||||
|
|
||||||
if (!$format) $format = 'atom';
|
if (!$format) $format = 'atom';
|
||||||
|
|
||||||
|
@ -371,7 +378,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
if ($owner_id) {
|
if ($owner_id) {
|
||||||
$this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
|
$this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
|
||||||
$offset, $search, $search_mode, $view_mode, $format, $order);
|
$offset, $search, $search_mode, $view_mode, $format, $order, $orig_guid);
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.1 403 Forbidden');
|
header('HTTP/1.1 403 Forbidden');
|
||||||
}
|
}
|
||||||
|
@ -543,6 +550,7 @@ class Handler_Public extends Handler {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_SESSION["login_error_msg"] = __("Incorrect username or password");
|
$_SESSION["login_error_msg"] = __("Incorrect username or password");
|
||||||
|
user_error("Failed login attempt from {$_SERVER['REMOTE_ADDR']}", E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['return']) {
|
if ($_REQUEST['return']) {
|
||||||
|
|
19
css/cdm.css
19
css/cdm.css
|
@ -265,3 +265,22 @@ div#floatingTitle span.author,
|
||||||
div#floatingTitle img.tinyFeedIcon {
|
div#floatingTitle img.tinyFeedIcon {
|
||||||
display : none;
|
display : none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cdm.high .cdmHeader a.title.high, .cdm.high .cdmHeader .cdmExcerpt,
|
||||||
|
.cdm.high .cdmHeader span.author {
|
||||||
|
color : #00aa00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cdm.Unread.high .cdmHeader a.title.high, .cdm.Unread.high .cdmHeader .cdmExcerpt,
|
||||||
|
.cdm.Unread.high .cdmHeader span.author {
|
||||||
|
color : #00dd00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cdm .cdmHeader a.title.low, .cdm.low .cdmHeader .cdmExcerpt,
|
||||||
|
.cdm.Unread .cdmHeader a.title.low, .cdm.Unread.low .cdmHeader .cdmExcerpt,
|
||||||
|
.cdm.low .cdmHeader span.author {
|
||||||
|
color : #909090;
|
||||||
|
text-decoration : line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -606,20 +606,15 @@ div#headlines-frame.wide .hlTitle {
|
||||||
white-space : normal;
|
white-space : normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hlContentH a, .hlContentH span {
|
.hl a.title.high, span.hlContent.high .contentPreview {
|
||||||
color : #00cc00;
|
color : #00aa00;
|
||||||
|
}
|
||||||
|
.hl.Unread a.title.high, .hl.Unread span.hlContent.high .contentPreview {
|
||||||
|
color : #00dd00;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hlContentL a, .hlContentL span {
|
.hl a.title.low, span.hlContent.low .contentPreview,
|
||||||
color : #909090;
|
.hl.Unread a.title.low, .hl.Unread span.hlContent.low .contentPreview {
|
||||||
text-decoration : line-through;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.titleWrapH, span.titleWrapH a {
|
|
||||||
color : #00cc00;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.titleWrapL, span.titleWrapL a {
|
|
||||||
color : #909090;
|
color : #909090;
|
||||||
text-decoration : line-through;
|
text-decoration : line-through;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3788,7 +3788,7 @@
|
||||||
* @return string Absolute URL
|
* @return string Absolute URL
|
||||||
*/
|
*/
|
||||||
function rewrite_relative_url($url, $rel_url) {
|
function rewrite_relative_url($url, $rel_url) {
|
||||||
if (strpos($rel_url, "magnet:") === 0) {
|
if (strpos($rel_url, ":") !== false) {
|
||||||
return $rel_url;
|
return $rel_url;
|
||||||
} else if (strpos($rel_url, "://") !== false) {
|
} else if (strpos($rel_url, "://") !== false) {
|
||||||
return $rel_url;
|
return $rel_url;
|
||||||
|
@ -3958,6 +3958,7 @@
|
||||||
$reg_qpart = "REGEXP";
|
$reg_qpart = "REGEXP";
|
||||||
|
|
||||||
foreach ($filter["rules"] AS $rule) {
|
foreach ($filter["rules"] AS $rule) {
|
||||||
|
$rule['reg_exp'] = str_replace('/', '\/', $rule["reg_exp"]);
|
||||||
$regexp_valid = preg_match('/' . $rule['reg_exp'] . '/',
|
$regexp_valid = preg_match('/' . $rule['reg_exp'] . '/',
|
||||||
$rule['reg_exp']) !== FALSE;
|
$rule['reg_exp']) !== FALSE;
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,17 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SESSION["ref_schema_version"] != session_get_schema_version(true))
|
if ($_SESSION["ref_schema_version"] != session_get_schema_version(true)) {
|
||||||
|
$_SESSION["login_error_msg"] =
|
||||||
|
__("Session failed to validate (schema version changed)");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"])
|
if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"]) {
|
||||||
|
$_SESSION["login_error_msg"] =
|
||||||
|
__("Session failed to validate (user agent changed)");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_SESSION["uid"]) {
|
if ($_SESSION["uid"]) {
|
||||||
$result = Db::get()->query(
|
$result = Db::get()->query(
|
||||||
|
@ -74,11 +80,19 @@
|
||||||
|
|
||||||
// user not found
|
// user not found
|
||||||
if (Db::get()->num_rows($result) == 0) {
|
if (Db::get()->num_rows($result) == 0) {
|
||||||
|
|
||||||
|
$_SESSION["login_error_msg"] =
|
||||||
|
__("Session failed to validate (user not found)");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$pwd_hash = Db::get()->fetch_result($result, 0, "pwd_hash");
|
$pwd_hash = Db::get()->fetch_result($result, 0, "pwd_hash");
|
||||||
|
|
||||||
if ($pwd_hash != $_SESSION["pwd_hash"]) {
|
if ($pwd_hash != $_SESSION["pwd_hash"]) {
|
||||||
|
|
||||||
|
$_SESSION["login_error_msg"] =
|
||||||
|
__("Session failed to validate (password changed)");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -847,11 +847,16 @@ function hotkey_handler(e) {
|
||||||
|
|
||||||
var keycode = false;
|
var keycode = false;
|
||||||
var shift_key = false;
|
var shift_key = false;
|
||||||
|
var ctrl_key = false;
|
||||||
|
var alt_key = false;
|
||||||
|
var meta_key = false;
|
||||||
|
|
||||||
var cmdline = $('cmdline');
|
var cmdline = $('cmdline');
|
||||||
|
|
||||||
shift_key = e.shiftKey;
|
shift_key = e.shiftKey;
|
||||||
ctrl_key = e.ctrlKey;
|
ctrl_key = e.ctrlKey;
|
||||||
|
alt_key = e.altKey;
|
||||||
|
meta_key = e.metaKey;
|
||||||
|
|
||||||
if (window.event) {
|
if (window.event) {
|
||||||
keycode = window.event.keyCode;
|
keycode = window.event.keyCode;
|
||||||
|
@ -893,6 +898,8 @@ function hotkey_handler(e) {
|
||||||
// ensure ^*char notation
|
// ensure ^*char notation
|
||||||
if (shift_key) hotkey = "*" + hotkey;
|
if (shift_key) hotkey = "*" + hotkey;
|
||||||
if (ctrl_key) hotkey = "^" + hotkey;
|
if (ctrl_key) hotkey = "^" + hotkey;
|
||||||
|
if (alt_key) hotkey = "+" + hotkey;
|
||||||
|
if (meta_key) hotkey = "%" + hotkey;
|
||||||
|
|
||||||
hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
|
hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
|
||||||
hotkey_prefix = false;
|
hotkey_prefix = false;
|
||||||
|
|
|
@ -114,6 +114,7 @@ class GoogleReaderImport extends Plugin {
|
||||||
$guid = db_escape_string(mb_substr($item['id'], 0, 250));
|
$guid = db_escape_string(mb_substr($item['id'], 0, 250));
|
||||||
$title = db_escape_string($item['title']);
|
$title = db_escape_string($item['title']);
|
||||||
$updated = date('Y-m-d h:i:s', $item['updated']);
|
$updated = date('Y-m-d h:i:s', $item['updated']);
|
||||||
|
$last_marked = date('Y-m-d h:i:s', mb_substr($item['crawlTimeMsec'], 0, 10));
|
||||||
$link = '';
|
$link = '';
|
||||||
$content = '';
|
$content = '';
|
||||||
$author = db_escape_string($item['author']);
|
$author = db_escape_string($item['author']);
|
||||||
|
@ -165,7 +166,7 @@ class GoogleReaderImport extends Plugin {
|
||||||
|
|
||||||
$imported += (int) $this->create_article($owner_uid, $guid, $title,
|
$imported += (int) $this->create_article($owner_uid, $guid, $title,
|
||||||
$link, $updated, $content, $author, $sql_set_marked, $tags,
|
$link, $updated, $content, $author, $sql_set_marked, $tags,
|
||||||
$orig_feed_data);
|
$orig_feed_data, $last_marked);
|
||||||
|
|
||||||
if ($file && $processed % 25 == 0) {
|
if ($file && $processed % 25 == 0) {
|
||||||
_debug("processed $processed articles...");
|
_debug("processed $processed articles...");
|
||||||
|
@ -196,7 +197,7 @@ class GoogleReaderImport extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// expects ESCAPED data
|
// expects ESCAPED data
|
||||||
private function create_article($owner_uid, $guid, $title, $link, $updated, $content, $author, $marked, $tags, $orig_feed_data) {
|
private function create_article($owner_uid, $guid, $title, $link, $updated, $content, $author, $marked, $tags, $orig_feed_data, $last_marked) {
|
||||||
|
|
||||||
if (!$guid) $guid = sha1($link);
|
if (!$guid) $guid = sha1($link);
|
||||||
|
|
||||||
|
@ -299,7 +300,7 @@ class GoogleReaderImport extends Plugin {
|
||||||
(ref_id, uuid, feed_id, orig_feed_id, owner_uid, marked, tag_cache, label_cache,
|
(ref_id, uuid, feed_id, orig_feed_id, owner_uid, marked, tag_cache, label_cache,
|
||||||
last_read, note, unread, last_marked)
|
last_read, note, unread, last_marked)
|
||||||
VALUES
|
VALUES
|
||||||
('$ref_id', '', NULL, $orig_feed_id, $owner_uid, $marked, '', '', NOW(), '', false, NOW())");
|
('$ref_id', '', NULL, $orig_feed_id, $owner_uid, $marked, '', '', '$last_marked', '', false, '$last_marked')");
|
||||||
|
|
||||||
$result = db_query("SELECT int_id FROM ttrss_user_entries, ttrss_entries
|
$result = db_query("SELECT int_id FROM ttrss_user_entries, ttrss_entries
|
||||||
WHERE owner_uid = $owner_uid AND ref_id = id AND ref_id = $ref_id");
|
WHERE owner_uid = $owner_uid AND ref_id = id AND ref_id = $ref_id");
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
<content type="html"><![CDATA[${ARTICLE_CONTENT}]]></content>
|
<content type="html"><![CDATA[${ARTICLE_CONTENT}]]></content>
|
||||||
<updated>${ARTICLE_UPDATED_ATOM}</updated>
|
<updated>${ARTICLE_UPDATED_ATOM}</updated>
|
||||||
<author><name>${ARTICLE_AUTHOR}</name></author>
|
<author><name>${ARTICLE_AUTHOR}</name></author>
|
||||||
|
<source>
|
||||||
|
<link rel="self" href="${ARTICLE_SOURCE_LINK}"/>
|
||||||
|
<title>${ARTICLE_SOURCE_TITLE}</title></source>
|
||||||
<!-- $BeginBlock category -->
|
<!-- $BeginBlock category -->
|
||||||
<category term="${ARTICLE_CATEGORY}"/>
|
<category term="${ARTICLE_CATEGORY}"/>
|
||||||
<!-- $EndBlock category -->
|
<!-- $EndBlock category -->
|
||||||
|
|
Loading…
Reference in New Issue