From: Andrew Dolgov Date: Thu, 14 Aug 2014 08:07:20 +0000 (+0400) Subject: Merge branch 'master' of git://github.com/asalthobaity/Tiny-Tiny-RSS into asalthobait... X-Git-Tag: 1.14~37 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=c4794f39c94dd2c07452b945c0ed7f57c8cb167a;hp=df7419cdec54cb898a2ebd592987ae5f31230331 Merge branch 'master' of git://github.com/asalthobaity/Tiny-Tiny-RSS into asalthobaity-master --- diff --git a/classes/pref/filters.php b/classes/pref/filters.php index cfc20e41..170c1a52 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -164,7 +164,9 @@ class Pref_Filters extends Handler_Protected { while ($line = $this->dbh->fetch_assoc($result)) { $where = sql_bool_to_bool($line["cat_filter"]) ? - getCategoryTitle($line["cat_id"]) : getFeedTitle($line["feed_id"]); + getCategoryTitle($line["cat_id"]) : + ($line["feed_id"] ? + getFeedTitle($line["feed_id"]) : __("All feeds")); # $where = $line["cat_id"] . "/" . $line["feed_id"]; diff --git a/include/functions.php b/include/functions.php index c1617285..ee061eca 100644 --- a/include/functions.php +++ b/include/functions.php @@ -10,6 +10,7 @@ $fetch_last_error = false; $fetch_last_error_code = false; $fetch_last_content_type = false; + $fetch_last_error_content = false; // curl only for the time being $fetch_curl_used = false; $suppress_debugging = false; @@ -349,6 +350,7 @@ global $fetch_last_error; global $fetch_last_error_code; + global $fetch_last_error_content; global $fetch_last_content_type; global $fetch_curl_used; @@ -431,6 +433,7 @@ } else { $fetch_last_error = "HTTP Code: $http_code"; } + $fetch_last_error_content = $contents; curl_close($ch); return false; } @@ -1973,8 +1976,6 @@ 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) { diff --git a/include/rssfuncs.php b/include/rssfuncs.php index cdc490cb..f657f841 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -687,6 +687,12 @@ foreach ($pluginhost->get_hooks(PluginHost::HOOK_ARTICLE_FILTER) as $plugin) { $article = $plugin->hook_article_filter($article); + + $article["stored"] = array("title" => $article["title"], + "content" => $article["content"], + "link" => $article["link"], + "tags" => $article["tags"], + "author" => $article["author"]); } $entry_tags = $article["tags"]; @@ -697,7 +703,6 @@ $entry_plugin_data = db_escape_string($article["plugin_data"]); $entry_content = $article["content"]; // escaped below - _debug("plugin data: $entry_plugin_data", $debug_enabled); if ($cache_images && is_writable(CACHE_DIR . '/images')) diff --git a/js/tt-rss.js b/js/tt-rss.js index a66411d1..7d6f22f8 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -500,6 +500,10 @@ function init() { if (!isCdmMode()) { _widescreen_mode = !_widescreen_mode; + // reset stored sizes because geometry changed + setCookie("ttrss_ci_width", 0); + setCookie("ttrss_ci_height", 0); + switchPanelMode(_widescreen_mode); } }; @@ -555,17 +559,6 @@ function init_second_stage() { {width: getCookie("ttrss_fh_width") + "px" }); } - if (parseInt(getCookie("ttrss_ci_width")) > 0) { - if (_widescreen_mode) { - dijit.byId("content-insert").domNode.setStyle( - {width: getCookie("ttrss_ci_width") + "px" }); - - } else { - dijit.byId("content-insert").domNode.setStyle( - {height: getCookie("ttrss_ci_height") + "px" }); - } - } - dijit.byId("main").resize(); var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize', @@ -706,6 +699,10 @@ function quickMenuGo(opid) { if (!isCdmMode()) { _widescreen_mode = !_widescreen_mode; + // reset stored sizes because geometry changed + setCookie("ttrss_ci_width", 0); + setCookie("ttrss_ci_height", 0); + switchPanelMode(_widescreen_mode); } break; @@ -1077,6 +1074,11 @@ function switchPanelMode(wide) { height: 'auto', borderTopWidth: '0px' }); + if (parseInt(getCookie("ttrss_ci_width")) > 0) { + dijit.byId("content-insert").domNode.setStyle( + {width: getCookie("ttrss_ci_width") + "px" }); + } + $("headlines-frame").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").addClassName("wide"); @@ -1088,6 +1090,11 @@ function switchPanelMode(wide) { height: '50%', borderTopWidth: '0px'}); + if (parseInt(getCookie("ttrss_ci_height")) > 0) { + dijit.byId("content-insert").domNode.setStyle( + {height: getCookie("ttrss_ci_height") + "px" }); + } + $("headlines-frame").setStyle({ borderBottomWidth: '1px' }); $("headlines-frame").removeClassName("wide"); diff --git a/plugins/af_comics/filters/af_comics_darklegacy.php b/plugins/af_comics/filters/af_comics_darklegacy.php new file mode 100644 index 00000000..d87a3da2 --- /dev/null +++ b/plugins/af_comics/filters/af_comics_darklegacy.php @@ -0,0 +1,50 @@ +loadHTML($res); + + $basenode = false; + + if ($doc) { + $xpath = new DOMXPath($doc); + $basenode = $xpath->query('//div[@class="comic"]')->item(0); + + if ($basenode) { + + $article["content"] = $doc->saveXML($basenode); + $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; + } + } + } else if (isset($article["stored"]["content"])) { + $article["content"] = $article["stored"]["content"]; + } + + return true; + } + + return false; + } +} +?> diff --git a/plugins/af_comics/filters/af_comics_gocomics.php b/plugins/af_comics/filters/af_comics_gocomics.php index bd57c08f..d950dbe6 100644 --- a/plugins/af_comics/filters/af_comics_gocomics.php +++ b/plugins/af_comics/filters/af_comics_gocomics.php @@ -17,32 +17,28 @@ class Af_Comics_GoComics extends Af_ComicFilter { if ($doc) { $xpath = new DOMXPath($doc); - $entries = $xpath->query('(//img[@src])'); // we might also check for img[@class='strip'] I guess... + $entries = $xpath->query("(//img[@class='strip'])"); $matches = array(); - foreach ($entries as $entry) { - - if (preg_match("/(http:\/\/assets.amuniversal.com\/.*width.*)/i", $entry->getAttribute("src"), $matches)) { - + if ($entries->length > 1) { // if we have more than one match, then get the zoomed one, which is the second for gocomics + $entry = $entries->item(1); // get the second element (items start at 0) + if (preg_match("/(http:\/\/assets.amuniversal.com\/.*)/i", $entry->getAttribute("src"), $matches)) { $entry->setAttribute("src", $matches[0]); $basenode = $entry; - break; } } - if (!$basenode) { - // fallback on the smaller version - foreach ($entries as $entry) { - - if (preg_match("/(http:\/\/assets.amuniversal.com\/.*)/i", $entry->getAttribute("src"), $matches)) { - - $entry->setAttribute("src", $matches[0]); - $basenode = $entry; - break; - } - } - } + if (!$basenode) { + // fallback on the smaller version + foreach ($entries as $entry) { + if (preg_match("/(http:\/\/assets.amuniversal.com\/.*)/i", $entry->getAttribute("src"), $matches)) { + $entry->setAttribute("src", $matches[0]); + $basenode = $entry; + break; + } + } + } if ($basenode) { $article["content"] = $doc->saveXML($basenode); diff --git a/plugins/af_fsckportal/init.php b/plugins/af_fsckportal/init.php index 4795fd8e..4a549027 100644 --- a/plugins/af_fsckportal/init.php +++ b/plugins/af_fsckportal/init.php @@ -32,8 +32,6 @@ class Af_Fsckportal extends Plugin { $xpath = new DOMXPath($doc); $entries = $xpath->query('(//img[@src]|//a[@href])'); - $matches = array(); - foreach ($entries as $entry) { if (preg_match("/feedsportal.com/", $entry->getAttribute("src"))) { $entry->parentNode->removeChild($entry); @@ -42,7 +40,7 @@ class Af_Fsckportal extends Plugin { } } - $article["content"] = $doc->saveXML($basenode); + $article["content"] = $doc->saveXML(); $article["plugin_data"] = "fsckportal,$owner_uid:" . $article["plugin_data"]; } diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 12e591c5..4b1989f5 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -135,15 +135,6 @@ class Mail extends Plugin { print "
"; - print __('From:'); - - print ""; - - print "\">"; - - print "
"; - $addresslist = explode(",", $this->host->get($this, "addresslist")); print __('To:'); @@ -191,8 +182,8 @@ class Mail extends Plugin { $mail = new ttrssMailer(); - $mail->From = strip_tags($_REQUEST['from_email']); - $mail->FromName = strip_tags($_REQUEST['from_name']); + $mail->AddReplyTo(strip_tags($_REQUEST['from_email']), + strip_tags($_REQUEST['from_name'])); //$mail->AddAddress($_REQUEST['destination']); $addresses = explode(';', $_REQUEST['destination']); foreach($addresses as $nextaddr)