]> git.wh0rd.org - tt-rss.git/blobdiff - classes/article.php
rework some styles related to three panel mode
[tt-rss.git] / classes / article.php
index c8ee5b93171976572e91316dd4b04f65d080198c..09bd6d7dc4e843afaaa84ff911d9968aa1c0b13c 100755 (executable)
@@ -126,7 +126,7 @@ class Article extends Handler_Protected {
                if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) return false;
 
                $pdo = Db::pdo();
-               
+
                $pdo->beginTransaction();
 
                // only check for our user data here, others might have shared this with different content etc
@@ -309,7 +309,7 @@ class Article extends Handler_Protected {
 
                                if ($tag != '') {
                                        $sth = $this->pdo->prepare("INSERT INTO ttrss_tags
-                                                               (post_int_id, owner_uid, tag_name) 
+                                                               (post_int_id, owner_uid, tag_name)
                                                                VALUES (?, ?, ?)");
 
                                        $sth->execute([$int_id, $_SESSION['uid'], $tag]);
@@ -372,8 +372,7 @@ class Article extends Handler_Protected {
                $ids = explode(",", clean($_REQUEST["ids"]));
                $label_id = clean($_REQUEST["lid"]);
 
-               $label = db_escape_string(Labels::find_caption($label_id,
-               $_SESSION["uid"]));
+               $label = Labels::find_caption($label_id, $_SESSION["uid"]);
 
                $reply["info-for-headlines"] = array();
 
@@ -610,6 +609,8 @@ class Article extends Handler_Protected {
                                $line = $p->hook_render_article($line);
                        }
 
+                       $line['content'] = rewrite_cached_urls($line['content']);
+
                        $num_comments = (int) $line["num_comments"];
                        $entry_comments = "";
 
@@ -640,7 +641,7 @@ class Article extends Handler_Protected {
                                                stylesheet_tag("css/default.css")."
                                                <link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
                                                <link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">";
-                               
+
                                $rv['content'] .= "<meta property=\"og:title\" content=\"".htmlspecialchars($line["title"])."\"/>\n";
                                $rv['content'] .= "<meta property=\"og:site_name\" content=\"".htmlspecialchars($line["feed_title"])."\"/>\n";
                                $rv['content'] .= "<meta property=\"og:description\" content=\"".
@@ -677,9 +678,9 @@ class Article extends Handler_Protected {
                                $rv['content'] .= "<body class=\"claro ttrss_utility ttrss_zoom\">";
                        }
 
-                       $rv['content'] .= "<div class=\"postReply\" id=\"POST-$id\">";
+                       $rv['content'] .= "<div class=\"post\" id=\"POST-$id\">";
 
-                       $rv['content'] .= "<div class=\"postHeader\" id=\"POSTHDR-$id\">";
+                       $rv['content'] .= "<div class=\"header\">";
 
                        $entry_author = $line["author"];
 
@@ -691,25 +692,25 @@ class Article extends Handler_Protected {
                                $owner_uid, true);
 
                        if (!$zoom_mode)
-                               $rv['content'] .= "<div class=\"postDate\">$parsed_updated</div>";
+                               $rv['content'] .= "<div class=\"date\">$parsed_updated</div>";
 
                        if ($line["link"]) {
-                               $rv['content'] .= "<div class='postTitle'><a target='_blank' rel='noopener noreferrer'
+                               $rv['content'] .= "<div class='title'><a target='_blank' rel='noopener noreferrer'
                                        title=\"".htmlspecialchars($line['title'])."\"
                                        href=\"" .
                                        htmlspecialchars($line["link"]) . "\">" .
                                        $line["title"] . "</a>" .
                                        "<span class='author'>$entry_author</span></div>";
                        } else {
-                               $rv['content'] .= "<div class='postTitle'>" . $line["title"] . "$entry_author</div>";
+                               $rv['content'] .= "<div class='title'>" . $line["title"] . "$entry_author</div>";
                        }
 
                        if ($zoom_mode) {
                                $feed_title = htmlspecialchars($line["feed_title"]);
 
-                               $rv['content'] .= "<div class=\"postFeedTitle\">$feed_title</div>";
+                               $rv['content'] .= "<div class=\"feed-title\">$feed_title</div>";
 
-                               $rv['content'] .= "<div class=\"postDate\">$parsed_updated</div>";
+                               $rv['content'] .= "<div class=\"date\">$parsed_updated</div>";
                        }
 
                        $tags_str = Article::format_tags_string($line["tags"], $id);
@@ -785,7 +786,7 @@ class Article extends Handler_Protected {
 
                        if (!$line['lang']) $line['lang'] = 'en';
 
-                       $rv['content'] .= "<div class=\"postContent\" lang=\"".$line['lang']."\">";
+                       $rv['content'] .= "<div class=\"content\" lang=\"".$line['lang']."\">";
 
                        $rv['content'] .= $line["content"];
 
@@ -827,7 +828,7 @@ class Article extends Handler_Protected {
                $pdo = Db::pdo();
 
                $sth = $pdo->prepare("SELECT DISTINCT tag_name,
-                       owner_uid as owner FROM ttrss_tags 
+                       owner_uid as owner FROM ttrss_tags
                        WHERE post_int_id = (SELECT int_id FROM ttrss_user_entries WHERE
                        ref_id = ? AND owner_uid = ? LIMIT 1) ORDER BY tag_name");
 
@@ -935,24 +936,24 @@ class Article extends Handler_Protected {
                return $rv;
        }
 
-       static function purge_orphans($do_output = false) {
+       static function purge_orphans() {
 
-               // purge orphaned posts in main content table
+        // purge orphaned posts in main content table
 
-               if (DB_TYPE == "mysql")
-                       $limit_qpart = "LIMIT 5000";
-               else
-                       $limit_qpart = "";
+        if (DB_TYPE == "mysql")
+            $limit_qpart = "LIMIT 5000";
+        else
+            $limit_qpart = "";
 
-               $pdo = Db::pdo();
-               $res = $pdo->query("DELETE FROM ttrss_entries WHERE
+        $pdo = Db::pdo();
+        $res = $pdo->query("DELETE FROM ttrss_entries WHERE
                        NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id) $limit_qpart");
 
-               if ($do_output) {
-                       $rows = $res->rowCount();
-                       _debug("Purged $rows orphaned posts.");
-               }
-       }
+        if (Debug::enabled()) {
+            $rows = $res->rowCount();
+            Debug::log("Purged $rows orphaned posts.");
+        }
+    }
 
        static function catchupArticlesById($ids, $cmode, $owner_uid = false) {