Commit 120c9477 authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.13+dfsg

parent d75fcbfb
......@@ -107,7 +107,7 @@ class Article extends Handler_Protected {
// only check for our user data here, others might have shared this with different content etc
$result = db_query("SELECT id FROM ttrss_entries, ttrss_user_entries WHERE
link = '$url' AND ref_id = id AND owner_uid = '$owner_uid' LIMIT 1");
guid = '$guid' AND ref_id = id AND owner_uid = '$owner_uid' LIMIT 1");
if (db_num_rows($result) != 0) {
$ref_id = db_fetch_result($result, 0, "id");
......
......@@ -4,5 +4,7 @@ class FeedEnclosure {
public $type;
public $length;
public $title;
public $height;
public $width;
}
?>
......@@ -145,6 +145,8 @@ class FeedItem_Atom extends FeedItem_Common {
$enc->type = $enclosure->getAttribute("type");
$enc->link = $enclosure->getAttribute("url");
$enc->length = $enclosure->getAttribute("length");
$enc->height = $enclosure->getAttribute("height");
$enc->width = $enclosure->getAttribute("width");
$desc = $this->xpath->query("media:description", $enclosure)->item(0);
if ($desc) $enc->title = strip_tags($desc->nodeValue);
......@@ -164,6 +166,8 @@ class FeedItem_Atom extends FeedItem_Common {
$enc->type = $content->getAttribute("type");
$enc->link = $content->getAttribute("url");
$enc->length = $content->getAttribute("length");
$enc->height = $content->getAttribute("height");
$enc->width = $content->getAttribute("width");
$desc = $this->xpath->query("media:description", $content)->item(0);
if ($desc) {
......@@ -184,6 +188,8 @@ class FeedItem_Atom extends FeedItem_Common {
$enc->type = "image/generic";
$enc->link = $enclosure->getAttribute("url");
$enc->height = $enclosure->getAttribute("height");
$enc->width = $enclosure->getAttribute("width");
array_push($encs, $enc);
}
......
......@@ -113,6 +113,8 @@ class FeedItem_RSS extends FeedItem_Common {
$enc->type = $enclosure->getAttribute("type");
$enc->link = $enclosure->getAttribute("url");
$enc->length = $enclosure->getAttribute("length");
$enc->height = $enclosure->getAttribute("height");
$enc->width = $enclosure->getAttribute("width");
array_push($encs, $enc);
}
......@@ -125,6 +127,8 @@ class FeedItem_RSS extends FeedItem_Common {
$enc->type = $enclosure->getAttribute("type");
$enc->link = $enclosure->getAttribute("url");
$enc->length = $enclosure->getAttribute("length");
$enc->height = $enclosure->getAttribute("height");
$enc->width = $enclosure->getAttribute("width");
$desc = $this->xpath->query("media:description", $enclosure)->item(0);
if ($desc) $enc->title = strip_tags($desc->nodeValue);
......@@ -144,6 +148,8 @@ class FeedItem_RSS extends FeedItem_Common {
$enc->type = $content->getAttribute("type");
$enc->link = $content->getAttribute("url");
$enc->length = $content->getAttribute("length");
$enc->height = $content->getAttribute("height");
$enc->width = $content->getAttribute("width");
$desc = $this->xpath->query("media:description", $content)->item(0);
if ($desc) {
......@@ -164,6 +170,8 @@ class FeedItem_RSS extends FeedItem_Common {
$enc->type = "image/generic";
$enc->link = $enclosure->getAttribute("url");
$enc->height = $enclosure->getAttribute("height");
$enc->width = $enclosure->getAttribute("width");
array_push($encs, $enc);
}
......
......@@ -66,7 +66,7 @@ class Feeds extends Handler_Protected {
if ($error) {
$error = htmlspecialchars($error);
$reply .= "&nbsp;<img title=\"$error\" src='images/error.png' alt='error' class=\"noborder\" style=\"vertical-align : middle\">";
$reply .= "&nbsp;<img title=\"$error\" src='images/error.png' alt='error' class=\"noborder\">";
}
} else {
......@@ -498,7 +498,7 @@ class Feeds extends Handler_Protected {
$reply['content'] .= "<span onclick=\"viewfeed($feed_id)\"
style=\"cursor : pointer\"
title=\"".htmlspecialchars($line['feed_title'])."\">
$feed_icon_img<span>";
$feed_icon_img</span>";
}
$reply['content'] .= "</div>";
......@@ -1147,7 +1147,7 @@ class Feeds extends Handler_Protected {
print "<div class=\"dlgButtons\">";
if (!SPHINX_ENABLED) {
if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">
<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">".__("Search syntax")."</a>
</div>";
......
......@@ -108,7 +108,8 @@ class Handler_Public extends Handler {
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
$tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true);
$content = sanitize($line["content"], false, $owner_uid);
$content = sanitize($line["content"], false, $owner_uid,
$feed_site_url);
if ($line['note']) {
$content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
......
......@@ -39,6 +39,9 @@ class PluginHost {
const HOOK_FETCH_FEED = 22;
const HOOK_QUERY_HEADLINES = 23;
const HOOK_HOUSE_KEEPING = 24;
const HOOK_SEARCH = 25;
const HOOK_FORMAT_ENCLOSURES = 26;
const HOOK_SUBSCRIBE_FEED = 27;
const KIND_ALL = 1;
const KIND_SYSTEM = 2;
......
......@@ -55,6 +55,7 @@ class Pref_Feeds extends Handler_Protected {
$cat['unread'] = 0;
$cat['child_unread'] = 0;
$cat['auxcounter'] = 0;
$cat['parent_id'] = $cat_id;
$cat['items'] = $this->get_category_items($line['id']);
......@@ -1259,13 +1260,18 @@ class Pref_Feeds extends Handler_Protected {
$interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)";
}
$result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE
// could be performance-intensive and prevent feeds pref-panel from showing
if (!defined('_DISABLE_INACTIVE_FEEDS') || !_DISABLE_INACTIVE_FEEDS) {
$result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE
(SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
ttrss_entries.id = ref_id AND
ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart AND
ttrss_feeds.owner_uid = ".$_SESSION["uid"]);
$num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive");
$num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive");
} else {
$num_inactive = 0;
}
if ($num_inactive > 0) {
$inactive_button = "<button dojoType=\"dijit.form.Button\"
......
......@@ -147,6 +147,38 @@ class Pref_Filters extends Handler_Protected {
}
private function getfilterrules_concise($filter_id) {
$result = $this->dbh->query("SELECT reg_exp,
inverse,
feed_id,
cat_id,
cat_filter,
ttrss_filter_types.description AS field
FROM
ttrss_filters2_rules, ttrss_filter_types
WHERE
filter_id = '$filter_id' AND filter_type = ttrss_filter_types.id");
$rv = "";
while ($line = $this->dbh->fetch_assoc($result)) {
$where = sql_bool_to_bool($line["cat_filter"]) ?
getCategoryTitle($line["cat_id"]) : getFeedTitle($line["feed_id"]);
# $where = $line["cat_id"] . "/" . $line["feed_id"];
$inverse = sql_bool_to_bool($line["inverse"]) ? "inverse" : "";
$rv .= "<span class='$inverse'>" . T_sprintf("%s on %s in %s %s",
strip_tags($line["reg_exp"]),
$line["field"],
$where,
sql_bool_to_bool($line["inverse"]) ? __("(inverse)") : "") . "</span>";
}
return $rv;
}
function getfiltertree() {
$root = array();
......@@ -210,6 +242,7 @@ class Pref_Filters extends Handler_Protected {
$filter['param'] = $name[1];
$filter['checkbox'] = false;
$filter['enabled'] = sql_bool_to_bool($line["enabled"]);
$filter['rules'] = $this->getfilterrules_concise($line['id']);
if (!$filter_search || $match_ok) {
array_push($folder['items'], $filter);
......@@ -416,8 +449,11 @@ class Pref_Filters extends Handler_Protected {
WHERE id = ".(int)$rule["filter_type"]);
$filter_type = $this->dbh->fetch_result($result, 0, "description");
return T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]),
$filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "");
$inverse = isset($rule["inverse"]) ? "inverse" : "";
return "<span class='filterRule $inverse'>" .
T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]),
$filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "") . "</span>";
}
function printRuleName() {
......
......@@ -181,7 +181,8 @@ class Pref_Prefs extends Handler_Protected {
global $access_level_names;
$prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES",
"SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT");
"SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT",
"FEEDS_SORT_BY_UNREAD");
/* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */
......
......@@ -104,13 +104,9 @@
// Enable client PubSubHubbub support in tt-rss. When disabled, tt-rss
// won't try to subscribe to PUSH feed updates.
// *********************
// *** Sphinx search ***
// *********************
define('SPHINX_ENABLED', false);
// Enable fulltext search using Sphinx (http://www.sphinxsearch.com)
// Please see http://tt-rss.org/wiki/SphinxSearch for more information.
// ****************************
// *** Sphinx search plugin ***
// ****************************
define('SPHINX_SERVER', 'localhost:9312');
// Hostname:port combination for the Sphinx server.
......
......@@ -15,6 +15,28 @@
margin-right : 1em;
}
.claro .dijitTree .filterRules {
display : block;
color : #ccc;
font-size : 10px;
margin-left : 100px;
}
.claro .dijitTree .filterRules span {
display : block;
color : green;
}
#filterDlg_Matches span.filterRule {
color : green;
}
.claro .dijitTree .filterRules span.inverse,
#filterDlg_Matches span.filterRule.inverse {
color : red;
}
.claro .dijitTree .labelParam {
float : right;
margin-right : 1em;
......
......@@ -590,6 +590,10 @@ div#headlines-frame.wide .hlTitle {
white-space : normal;
}
div#headlines-frame.wide .hl .hlFeed {
display : none;
}
.hl a.title.high, span.hlContent.high .contentPreview {
color : #00aa00;
}
......@@ -795,6 +799,7 @@ div.fatalError textarea {
overflow : hidden;
background : #f5f5f5;
box-shadow : inset -1px 0px 2px -1px rgba(0,0,0,0.1);
-webkit-overflow-scrolling : touch;
}
#headlines-wrap-inner {
......@@ -808,6 +813,7 @@ div.fatalError textarea {
border-width : 0px;
border-color : #ddd;
margin-top : 0px;
-webkit-overflow-scrolling : touch;
}
#headlines-toolbar_splitter, #toolbar_splitter {
......@@ -858,6 +864,7 @@ div.fatalError textarea {
line-height: 1.5;
font-size : 15px;
overflow : auto;
-webkit-overflow-scrolling : touch;
}
#feedTree .dijitTreeRow .dijitTreeLabel.Unread {
......
<?php
define('EXPECTED_CONFIG_VERSION', 26);
define('SCHEMA_VERSION', 124);
define('SCHEMA_VERSION', 126);
define('LABEL_BASE_INDEX', -1024);
define('PLUGIN_FEED_BASE_INDEX', -128);
......@@ -63,10 +63,13 @@
function get_translations() {
$tr = array(
"auto" => "Detect automatically",
"da_DA" => "Dansk",
"ca_CA" => "Català",
"cs_CZ" => "Česky",
"en_US" => "English",
"es_ES" => "Español",
"el_GR" => "Ελληνικά",
"es_ES" => "Español (España)",
"es_LA" => "Español",
"de_DE" => "Deutsch",
"fr_FR" => "Français",
"hu_HU" => "Magyar (Hungarian)",
......@@ -78,6 +81,7 @@
"pl_PL" => "Polski",
"ru_RU" => "Русский",
"pt_BR" => "Portuguese/Brazil",
"pt_PT" => "Portuguese/Portugal",
"zh_CN" => "Simplified Chinese",
"zh_TW" => "Traditional Chinese",
"sv_SE" => "Svenska",
......@@ -380,7 +384,7 @@
curl_setopt($ch, CURLOPT_USERAGENT, $useragent ? $useragent :
SELF_USER_AGENT);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_REFERER, $url);
//curl_setopt($ch, CURLOPT_REFERER, $url);
if (!ini_get("safe_mode") && !ini_get("open_basedir")) {
curl_setopt($ch, CURLOPT_COOKIEJAR, "/dev/null");
......@@ -1199,7 +1203,7 @@
SET unread = false, last_read = NOW() WHERE ref_id IN
(SELECT id FROM
(SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
AND owner_uid = $owner_uid AND unread = true AND $date_qpart AND $match_part) as tmp)");
AND owner_uid = $owner_uid AND score >= 0 AND unread = true AND $date_qpart AND $match_part) as tmp)");
}
if ($feed == -4) {
......@@ -1686,6 +1690,10 @@
return array("code" => 5, "message" => $fetch_last_error);
}
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
}
if (is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents);
......@@ -1964,6 +1972,8 @@
function getFeedTitle($id, $cat = false) {
if ($cat) {
return getCategoryTitle($id);
} else if ($id == 0) {
return __("All feeds");
} else if ($id == -1) {
return __("Starred articles");
} else if ($id == -2) {
......
......@@ -397,20 +397,16 @@
$search_words = array();
if ($search) {
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH) as $plugin) {
list($search_query_part, $search_words) = $plugin->hook_search($search);
break;
}
if (SPHINX_ENABLED) {
$ids = join(",", @sphinx_search($search, 0, 500));
if ($ids)
$search_query_part = "ref_id IN ($ids) AND ";
else
$search_query_part = "ref_id = -1 AND ";
} else {
// fall back in case of no plugins
if (!$search_query_part) {
list($search_query_part, $search_words) = search_to_sql($search);
$search_query_part .= " AND ";
}
$search_query_part .= " AND ";
} else {
$search_query_part = "";
}
......@@ -430,8 +426,10 @@
// Try to check if SQL regexp implementation chokes on a valid regexp
$result = db_query("SELECT true AS true_val FROM ttrss_entries,
ttrss_user_entries, ttrss_feeds
$result = db_query("SELECT true AS true_val
FROM ttrss_entries
JOIN ttrss_user_entries ON ttrss_entries.id = ttrss_user_entries.ref_id
JOIN ttrss_feeds ON ttrss_feeds.id = ttrss_user_entries.feed_id
WHERE $filter_query_part LIMIT 1", false);
if ($result) {
......@@ -1749,7 +1747,7 @@
return $rv;
}
function save_email_address($email) {
/* function save_email_address($email) {
// FIXME: implement persistent storage of emails
if (!$_SESSION['stored_emails'])
......@@ -1757,7 +1755,7 @@
if (!in_array($email, $_SESSION['stored_emails']))
array_push($_SESSION['stored_emails'], $email);
}
} */
function get_feed_access_key($feed_id, $is_cat, $owner_uid = false) {
......@@ -1850,8 +1848,17 @@
$result = get_article_enclosures($id);
$rv = '';
if (count($result) > 0) {
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FORMAT_ENCLOSURES) as $plugin) {
$retval = $plugin->hook_format_enclosures($rv, $result, $id, $always_display_enclosures, $article_content, $hide_images);
if (is_array($retval)) {
$rv = $retval[0];
$result = $retval[1];
} else {
$rv = $retval;
}
}
if ($rv === '' && !empty($result)) {
$entries_html = array();
$entries = array();
$entries_inline = array();
......@@ -1861,6 +1868,8 @@
$url = $line["content_url"];
$ctype = $line["content_type"];
$title = $line["title"];
$width = $line["width"];
$height = $line["height"];
if (!$ctype) $ctype = __("unknown type");
......@@ -1884,6 +1893,8 @@
$entry["filename"] = $filename;
$entry["url"] = $url;
$entry["title"] = $title;
$entry["width"] = $width;
$entry["height"] = $height;
array_push($entries, $entry);
}
......@@ -1898,9 +1909,15 @@
preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
if (!$hide_images) {
$encsize = '';
if ($entry['height'] > 0)
$encsize .= ' height="' . intval($entry['width']) . '"';
if ($entry['width'] > 0)
$encsize .= ' width="' . intval($entry['height']) . '"';
$rv .= "<p><img
alt=\"".htmlspecialchars($entry["filename"])."\"
src=\"" .htmlspecialchars($entry["url"]) . "\"/></p>";
src=\"" .htmlspecialchars($entry["url"]) . "\"
" . $encsize . " /></p>";
} else {
$rv .= "<p><a target=\"_blank\"
href=\"".htmlspecialchars($entry["url"])."\"
......@@ -1994,39 +2011,6 @@
}
}
function sphinx_search($query, $offset = 0, $limit = 30) {
require_once 'lib/sphinxapi.php';
$sphinxClient = new SphinxClient();
$sphinxpair = explode(":", SPHINX_SERVER, 2);
$sphinxClient->SetServer($sphinxpair[0], (int)$sphinxpair[1]);
$sphinxClient->SetConnectTimeout(1);
$sphinxClient->SetFieldWeights(array('title' => 70, 'content' => 30,
'feed_title' => 20));
$sphinxClient->SetMatchMode(SPH_MATCH_EXTENDED2);
$sphinxClient->SetRankingMode(SPH_RANK_PROXIMITY_BM25);
$sphinxClient->SetLimits($offset, $limit, 1000);
$sphinxClient->SetArrayResult(false);
$sphinxClient->SetFilter('owner_uid', array($_SESSION['uid']));
$result = $sphinxClient->Query($query, SPHINX_INDEX);
$ids = array();
if (is_array($result['matches'])) {
foreach (array_keys($result['matches']) as $int_id) {
$ref_id = $result['matches'][$int_id]['attrs']['ref_id'];
array_push($ids, $ref_id);
}
}
return $ids;
}
function cleanup_tags($days = 14, $limit = 1000) {
if (DB_TYPE == "pgsql") {
......@@ -2246,6 +2230,7 @@
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 Firefox/5.0');
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_REFERER, $url);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($curl, CURLOPT_AUTOREFERER, true);
......
......@@ -2,6 +2,7 @@
define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30);
define_default('DAEMON_FEED_LIMIT', 500);
define_default('DAEMON_SLEEP_INTERVAL', 120);
define_default('_MIN_CACHE_IMAGE_SIZE', 1024);
function update_feedbrowser_cache() {
......@@ -268,7 +269,7 @@
$force_refetch = isset($_REQUEST["force_refetch"]);
foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) {
$feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed);
$feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last_article_timestamp, $auth_login, $auth_pass);
}
// try cache
......@@ -278,7 +279,7 @@
!$auth_login && !$auth_pass &&
filemtime($cache_filename) > time() - 30) {
_debug("using local cache.", $debug_enabled);
_debug("using local cache [$cache_filename].", $debug_enabled);
@$feed_data = file_get_contents($cache_filename);
......@@ -988,7 +989,7 @@
if (is_array($encs)) {
foreach ($encs as $e) {
$e_item = array(
$e->link, $e->type, $e->length, $e->title);
$e->link, $e->type, $e->length, $e->title, $e->width, $e->height);
array_push($enclosures, $e_item);
}
}
......@@ -1008,14 +1009,16 @@
$enc_type = db_escape_string($enc[1]);
$enc_dur = db_escape_string($enc[2]);
$enc_title = db_escape_string($enc[3]);
$enc_width = intval($enc[4]);
$enc_height = intval($enc[5]);
$result = db_query("SELECT id FROM ttrss_enclosures
WHERE content_url = '$enc_url' AND post_id = '$entry_ref_id'");
if (db_num_rows($result) == 0) {
db_query("INSERT INTO ttrss_enclosures
(content_url, content_type, title, duration, post_id) VALUES
('$enc_url', '$enc_type', '$enc_title', '$enc_dur', '$entry_ref_id')");
(content_url, content_type, title, duration, post_id, width, height) VALUES
('$enc_url', '$enc_type', '$enc_title', '$enc_dur', '$entry_ref_id', $enc_width, $enc_height)");
}
}
......@@ -1173,7 +1176,7 @@
if (!file_exists($local_filename)) {
$file_content = fetch_file_contents($src);
if ($file_content && strlen($file_content) > 1024) {
if ($file_content && strlen($file_content) > _MIN_CACHE_IMAGE_SIZE) {
file_put_contents($local_filename, $file_content);
}
}
......
......@@ -146,11 +146,6 @@
array_push($errors, "PHP support for CURL is required for PubSubHubbub.");
}
if (SPHINX_ENABLED && class_exists("SphinxClient")) {
array_push($errors, "Your PHP has a separate systemwide Sphinx client installed which conflicts with the client library used by tt-rss. Either remove the system library or disable Sphinx support.");
}
if (!class_exists("DOMDocument")) {
array_push($errors, "PHP support for DOMDocument is required, but was not found.");
}
......
<?php # This file has been generated at: Fri Sep 27 13:42:37 MSK 2013
define('GENERATED_CONFIG_CHECK', 26);
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'FEED_CRYPT_KEY', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_SERVER', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_SERVER', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'SMTP_SECURE', 'CHECK_FOR_NEW_VERSION', 'DETECT_ARTICLE_LANGUAGE', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION'); ?>
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'FEED_CRYPT_KEY', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_SERVER', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'SMTP_SECURE', 'CHECK_FOR_NEW_VERSION', 'DETECT_ARTICLE_LANGUAGE', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION'); ?>
<?php
define('VERSION_STATIC', '1.12');
define('VERSION_STATIC', '1.13');
function get_version() {
date_default_timezone_set('UTC');
......
......@@ -58,12 +58,12 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
if (is_cat) {
treeItem = this.store._itemsByIdentity['CAT:' + feed];
items = this.store._arrayOfTopLevelItems;
} else {
treeItem = this.store._itemsByIdentity['FEED:' + feed];
items = this.store._arrayOfAllItems;
}
items = this.store._arrayOfAllItems;
for (var i = 0; i < items.length; i++) {
if (items[i] == treeItem) {
......@@ -71,14 +71,18 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
}
}
for (var j = 0; j < i; j++) {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
}
}
}
}
......@@ -539,7 +543,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
}
items = this.model.store._arrayOfAllItems;
var item = items[0];
var item = items[0] == treeItem ? items[items.length-1] : items[0];
for (var i = 0; i < items.length; i++) {
if (items[i] == treeItem) {
......
......@@ -24,6 +24,7 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, {
var enabled = this.model.store.getValue(args.item, 'enabled');
var param = this.model.store.getValue(args.item, 'param');
var rules = this.model.store.getValue(args.item, 'rules');
if (param) {
param = dojo.doc.createElement('span');
......@@ -32,6 +33,13 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, {
dojo.place(param, tnode.rowNode, 'first');
}
if (rules) {
param = dojo.doc.createElement('span');
param.className = 'filterRules';
param.innerHTML = rules;
dojo.place(param, tnode.rowNode, 'next');
}
if (this.model.store.getValue(args.item, 'id') != 'root') {
var img = dojo.doc.createElement('img');
img.src ='images/filter.png';
......
......@@ -8,6 +8,7 @@ var post_under_pointer = false;
var last_requested_article = false;
var catchup_id_batch = [];
var catchup_go_next = false;
var catchup_timeout_id = false;