summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/pref/filters.php4
-rw-r--r--include/functions.php5
-rw-r--r--include/rssfuncs.php7
-rw-r--r--js/tt-rss.js29
-rw-r--r--plugins/af_comics/filters/af_comics_darklegacy.php50
-rw-r--r--plugins/af_comics/filters/af_comics_gocomics.php32
-rw-r--r--plugins/af_fsckportal/init.php4
-rw-r--r--plugins/mail/init.php13
8 files changed, 97 insertions, 47 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index cfc20e419..170c1a527 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 c16172856..ee061eca7 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 cdc490cb0..f657f8413 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 a66411d11..7d6f22f87 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 000000000..d87a3da22
--- /dev/null
+++ b/plugins/af_comics/filters/af_comics_darklegacy.php
@@ -0,0 +1,50 @@
+<?php
+class Af_Comics_DarkLegacy extends Af_ComicFilter {
+
+ function supported() {
+ return array("Dark Legacy Comics");
+ }
+
+ function process(&$article) {
+ $owner_uid = $article["owner_uid"];
+
+ if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) {
+ if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
+
+ print "DLC!" . $article["link"] . "\n";
+
+ $res = fetch_file_contents($article["link"], false, false, false,
+ false, false, 0,
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
+
+ global $fetch_last_error_content;
+
+ if (!$res && $fetch_last_error_content)
+ $res = $fetch_last_error_content;
+
+ $doc = new DOMDocument();
+ @$doc->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 bd57c08ff..d950dbe6b 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 4795fd8ef..4a5490274 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 12e591c54..4b1989f5f 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -135,15 +135,6 @@ class Mail extends Plugin {
print "<table width='100%'><tr><td>";
- print __('From:');
-
- print "</td><td>";
-
- print "<input dojoType=\"dijit.form.TextBox\" disabled=\"1\" style=\"width : 30em;\"
- value=\"$user_name <$user_email>\">";
-
- print "</td></tr><tr><td>";
-
$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)