}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
+ //$owner_uid = $article["owner_uid"];
return false;
}
-}
-?>
+}
\ No newline at end of file
abstract class Af_ComicFilter {
public abstract function supported();
public abstract function process(&$article);
-}
-?>
+}
\ No newline at end of file
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
-
if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
if (strpos($article["title"], "News:") === FALSE) {
$doc = new DOMDocument();
- @$doc->loadHTML(fetch_file_contents($article["link"]));
-
- $basenode = false;
- if ($doc) {
+ if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//img[contains(@src, "/comics/cad-")])')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
-
if (strpos($article["guid"], "loadingartist.com") !== FALSE) {
// lol at people who block clients by user agent
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
$doc = new DOMDocument();
- @$doc->loadHTML($res);
-
- $basenode = false;
- if ($doc) {
+ if (@$doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
-
if (strpos($article["guid"], "bunicomic.com") !== FALSE ||
strpos($article["guid"], "buttersafe.com") !== FALSE ||
strpos($article["guid"], "extrafabulouscomics.com") !== FALSE ||
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
$doc = new DOMDocument();
- @$doc->loadHTML($res);
-
- $basenode = false;
- if ($doc) {
+ if (@$doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//div[@id="comic"]')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) {
$res = $fetch_last_error_content;
$doc = new DOMDocument();
- @$doc->loadHTML($res);
- $basenode = false;
-
- if ($doc) {
+ if (@$doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
$doc = new DOMDocument();
@$doc->loadHTML($res);
- $basenode = false;
-
if ($doc) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//img[contains(@class, "img-comic")]')->item(0);
- /* $entries = $xpath->query('(//img[@src])'); // we might also check for img[@class='strip'] I guess...
-
- $matches = array();
-
- foreach ($entries as $entry) {
-
- if (preg_match("/dyn\/str_strip\/.*strip\.gif$/", $entry->getAttribute("src"), $matches)) {
-
- $entry->setAttribute("src",
- rewrite_relative_url("http://dilbert.com/",
- $matches[0]));
-
- $basenode = $entry;
- break;
- }
- } */
-
if ($basenode) {
$article["content"] = $doc->saveXML($basenode);
}
return false;
}
-}
-?>
+}
\ No newline at end of file
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "explosm.net/comics") !== FALSE) {
$doc = new DOMDocument();
- @$doc->loadHTML(fetch_file_contents($article["link"]));
- $basenode = false;
-
- if ($doc) {
+ if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//img[@id="main-comic"])')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
function process(&$article) {
if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "Comic:") !== FALSE) {
- if ($debug_enabled) {
+ /*if ($debug_enabled) {
_debug("af_pennyarcade: Processing comic");
- }
+ }*/
$doc = new DOMDocument();
- $doc->loadHTML(fetch_file_contents($article["link"]));
-
- $basenode = false;
- if ($doc) {
+ if ($doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//div[@id="comicFrame"])')->item(0);
}
if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "News Post:") !== FALSE) {
- if ($debug_enabled) {
+ /*if ($debug_enabled) {
_debug("af_pennyarcade: Processing news post");
- }
+ }*/
$doc = new DOMDocument();
- $doc->loadHTML(fetch_file_contents($article["link"]));
- if ($doc) {
+ if ($doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//div[@class="post"])');
return false;
}
-}
-?>
+}
\ No newline at end of file
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
$doc = new DOMDocument();
- @$doc->loadHTML($res);
- if ($doc) {
+ if (@$doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//section[@class="comic-art"]')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
if (!$res) return $article;
$doc = new DOMDocument();
- @$doc->loadHTML(fetch_file_contents($article["link"]));
-
- $basenode = false;
- if ($doc) {
+ if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
if (strpos($article["link"], "threewordphrase.com") !== FALSE) {
$doc = new DOMDocument();
- @$doc->loadHTML(fetch_file_contents($article["link"]));
- $basenode = false;
-
- if ($doc) {
+ if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
$xpath = new DOMXpath($doc);
$basenode = $xpath->query("//td/center/img")->item(0);
return false;
}
-}
-?>
+}
\ No newline at end of file
return false;
}
-}
-?>
+}
\ No newline at end of file
}
function hook_article_filter($article) {
- $owner_uid = $article["owner_uid"];
-
foreach ($this->filters as $f) {
if ($f->process($article))
break;
}
return $article;
-
}
// GoComics dropped feed support so it needs to be handled when fetching the feed.
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last_article_timestamp, $auth_login, $auth_pass) {
if ($auth_login || $auth_pass)
return $feed_data;
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_LanguageDetect/
* @todo allow users to generate their own language models
+ *
+ * @SuppressWarnings(PHPMD)
*/
class Text_LanguageDetect
{
}
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-?>
* @copyright 2011 Christian Weiske <cweiske@php.net>
* @license http://www.debian.org/misc/bsd.license BSD
* @link http://www.loc.gov/standards/iso639-2/php/code_list.php
+ *
+ * @SuppressWarnings(PHPMD)
*/
class Text_LanguageDetect_ISO639
{
return self::$code3ToName[$code];
}
}
-
-?>
\ No newline at end of file
}
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-?>
return $tmp;
}
-}
-?>
+}
\ No newline at end of file
$this->host->set($this, "enabled_feeds", $enabled_feeds);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_article_filter_action($article, $action) {
return $this->process_article($article);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
- @$result = curl_exec($ch);
+ @curl_exec($ch);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
if (strpos($content_type, "text/html") === FALSE)
}
}
-?>
echo __("Configuration saved");
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
private function inline_stuff($article, &$doc, $xpath, $debug = false) {
$entries = $xpath->query('(//a[@href]|//img[@src])');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("open_basedir"));
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- @$result = curl_exec($ch);
+ @curl_exec($ch);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
}
return $content_type;
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
private function readability($article, $url, $doc, $xpath, $debug = false) {
if (!defined('NO_CURL') && function_exists("curl_init") && $this->host->get($this, "enable_readability") &&
return $article;
}
}
-?>
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
$host->add_hook($host::HOOK_RENDER_ENCLOSURE, $this);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_render_enclosure($entry, $hide_images) {
$matches = array();
}
}
-?>
if (function_exists("imagecreate") && !isset($_REQUEST["text"])) {
$img = imagecreate(450, 75);
- $bg = imagecolorallocate($img, 255, 255, 255);
+ /*$bg =*/ imagecolorallocate($img, 255, 255, 255);
$textcolor = imagecolorallocate($img, 255, 0, 0);
imagerectangle($img, 0, 0, 450-1, 75-1, $textcolor);
return $url;
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_render_article_cdm($article, $api_mode = false) {
$need_saving = false;
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return "";
}
-
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function authenticate($login, $password) {
$try_login = db_escape_string($_SERVER["REMOTE_USER"]);
if (!$try_login) $try_login = db_escape_string($_SERVER["PHP_AUTH_USER"]);
if (!$try_login) $try_login = $this->get_login_by_ssl_certificate();
-# if (!$try_login) $try_login = "test_qqq";
if ($try_login) {
$user_id = $this->base->auto_create_user($try_login, $password);
}
}
-
-?>
function api_version() {
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
true);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function csrf_ignore($method) {
return false;
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function before($method) {
return true;
}
}
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+ */
function hook_house_keeping() {
$files = glob($this->cache_dir . "/*.{png,mp4}", GLOB_BRACE);
}
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes, $article_id) {
$xpath = new DOMXpath($doc);
}
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function cache_article_images($content, $site_url, $owner_uid, $article_id) {
libxml_use_internal_errors(true);
return 2;
}
}
-?>
"fox");
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_article_button($line) {
if (!get_pref("COMBINED_DISPLAY_MODE")) {
$rv = "<img src=\"plugins/close_button/button.png\"
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return in_array($method, array("exportget"));
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function before($method) {
return $_SESSION["uid"] != false;
}
return true;
}
+ /**
+ * @SuppressWarnings(unused)
+ */
function exportget() {
$exportname = CACHE_DIR . "/export/" .
sha1($_SESSION['uid'] . $_SESSION['login']) . ".xml";
return 2;
}
-}
-?>
+}
\ No newline at end of file
$host->add_hook($host::HOOK_UPDATE_TASK, $this);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_update_task($args) {
_debug("Get linked feeds...");
$this->get_linked_feeds();
return file_get_contents(dirname(__FILE__) . "/instances.js");
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_prefs_tabs($args) {
if ($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) {
?><div id="instanceConfigTab" dojoType="dijit.layout.ContentPane"
return array_search($method, $csrf_ignored) !== false;
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function before($method) {
if ($_SESSION["uid"]) {
if ($_SESSION["access_level"] < 10) {
}
function add() {
- $id = db_escape_string($_REQUEST["id"]);
+ //$id = db_escape_string($_REQUEST["id"]);
$access_url = db_escape_string($_REQUEST["access_url"]);
$access_key = db_escape_string($_REQUEST["access_key"]);
}
}
-?>
return 2;
}
-}
-?>
+}
\ No newline at end of file
require_once "lib/MiniTemplator.class.php";
$tpl = new MiniTemplator;
- $tpl_t = new MiniTemplator;
$tpl->readTemplateFromFile("templates/email_article_template.txt");
$tpl->setVariable('USER_NAME', $_SESSION["name"], true);
- $tpl->setVariable('USER_EMAIL', $user_email, true);
+ //$tpl->setVariable('USER_EMAIL', $user_email, true);
$tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"], true);
}
}
-?>
$host->add_hook($host::HOOK_SANITIZE, $this);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) {
$xpath = new DOMXpath($doc);
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
function api_version() {
return 2;
}
-}
-?>
+}
\ No newline at end of file
return pack ( "N", $t2 );
}
+ /**
+ * @SuppressWarnings(unused)
+ */
+
/// add query to multi-query batch
/// returns index into results array from RunQueries() call
function AddQuery ( $query, $index="*", $comment="" )
function shareArticle() {
$param = db_escape_string($_REQUEST['param']);
- $result = db_query("SELECT uuid, ref_id FROM ttrss_user_entries WHERE int_id = '$param'
+ $result = db_query("SELECT uuid FROM ttrss_user_entries WHERE int_id = '$param'
AND owner_uid = " . $_SESSION['uid']);
if (db_num_rows($result) == 0) {
} else {
$uuid = db_fetch_result($result, 0, "uuid");
- $ref_id = db_fetch_result($result, 0, "ref_id");
if (!$uuid) {
$uuid = db_escape_string(uniqid_short());
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
-}
-?>
+}
\ No newline at end of file
return 2;
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function get_unread($feed_id) {
$result = db_query("select count(int_id) AS count from ttrss_user_entries where owner_uid = ".$_SESSION["uid"]." and unread = true and uuid != ''");
return db_fetch_result($result, 0, "count");
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function get_total($feed_id) {
$result = db_query("select count(int_id) AS count from ttrss_user_entries where owner_uid = ".$_SESSION["uid"]." and uuid != ''");
//function queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false, $override_strategy = false, $override_vfeed = false) {
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function get_headlines($feed_id, $options) {
/*$qfh_ret = queryFeedHeadlines(-4,
$options['limit'],
return $qfh_ret;
}
-}
-?>
+}
\ No newline at end of file
<!-- phpmd author is a bit weird i guess -->
+ <rule ref="rulesets/cleancode.xml">
+ <exclude name="BooleanArgumentFlag" />
+ <exclude name="ElseExpression" />
+ </rule>
+
<rule ref="rulesets/unusedcode.xml" />
</ruleset>