]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
properly handle OPEN_LINKS_IN_NEW_WINDOW in CDM
[tt-rss.git] / functions.php
index 5515781a8c832c12317c36f7e4b2256c762e1f01..da48affaae96804fbbf23cc22fe65b1be0a4e7ff 100644 (file)
                
                        if ($feed_site_url) {
                                if (!$bottom) {
-                                       $target = "target=\"_blank\"";
+                                       $target = "target=\"_new\"";
                                }
                                print "<a $target href=\"$feed_site_url\">$feed_title</a>";
                        } else {
                                        
                                        print "<a class=\"title\" 
                                                onclick=\"javascript:toggleUnread($id, 0)\"
-                                               target=\"new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
+                                               target=\"_new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
 
                                        print $entry_author;
 
 
                                        print "</div>";
 
+                                       if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) {
+                                               $line["content_preview"] = preg_replace("/href=/i", 
+                                                       "target=\"_new\" href=", $line["content_preview"]);
+                                       }
+
                                        print "<div class=\"cdmContent\">" . $line["content_preview"] . "</div><br clear=\"all\">";
 
                                        print "<div class=\"cdmFooter\"><span class='s0'>";