]> git.wh0rd.org Git - tt-rss.git/commitdiff
make OPEN_LINKS_IN_NEW_WINDOW behaviour more universel (closes #79)
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 7 Jul 2006 03:56:47 +0000 (04:56 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 7 Jul 2006 03:56:47 +0000 (04:56 +0100)
backend.php

index d78d5cd28ddcc6b2eab926e1f96d76bc96fb3597..da317cc416ca8584a653bfaf4d59103336abff1b 100644 (file)
 
                if ($result) {
 
+                       $link_target = "";
+
+                       if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) {
+                               $link_target = "target=\"_new\"";
+                       }
+
                        $line = db_fetch_assoc($result);
 
                        if ($line["icon_url"]) {
                                } else {
                                        $comments_url = $line["link"];
                                }
-                               $entry_comments = "<a href=\"$comments_url\">$num_comments comments</a>";
+                               $entry_comments = "<a $link_target href=\"$comments_url\">$num_comments comments</a>";
                        } else {
                                if ($line["comments"] && $line["link"] != $line["comments"]) {
-                                       $entry_comments = "<a href=\"".$line["comments"]."\">comments</a>";
+                                       $entry_comments = "<a $link_target href=\"".$line["comments"]."\">comments</a>";
                                }                               
                        }
 
                        if ($entry_author) {
                                $entry_author = " - by $entry_author";
                        }
-
-                       print "<tr><td><a href=\"" . $line["link"] . "\">" . $line["title"] . 
+                       
+                       print "<tr><td><a $link_target href=\"" . $line["link"] . "\">" . $line["title"] . 
                                "</a>$entry_author</td>";
 
                        $parsed_updated = date(get_pref($link, 'LONG_DATE_FORMAT'),