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"];
$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;
global $fetch_last_error;
global $fetch_last_error_code;
+ global $fetch_last_error_content;
global $fetch_last_content_type;
global $fetch_curl_used;
} else {
$fetch_last_error = "HTTP Code: $http_code";
}
+ $fetch_last_error_content = $contents;
curl_close($ch);
return false;
}
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) {
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"];
$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'))
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);
}
};
{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',
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;
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");
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");
--- /dev/null
+<?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;
+ }
+}
+?>
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);
$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);
}
}
- $article["content"] = $doc->saveXML($basenode);
+ $article["content"] = $doc->saveXML();
$article["plugin_data"] = "fsckportal,$owner_uid:" . $article["plugin_data"];
}
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:');
$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)