From: Andrew Dolgov Date: Wed, 13 Jan 2010 07:11:13 +0000 (+0300) Subject: rewrite links to open in new window in sanitize_rss(); css tweaks X-Git-Tag: 1.4.0~73 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7514749de76844348064b99654cc081bbdd3c859;p=tt-rss.git rewrite links to open in new window in sanitize_rss(); css tweaks --- diff --git a/functions.php b/functions.php index a5583e72..54385a4a 100644 --- a/functions.php +++ b/functions.php @@ -3629,9 +3629,11 @@ } if (get_pref($link, "STRIP_IMAGES", $owner)) { - $res = preg_replace('/]+>/is', '', $res); + } + if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { + $res = preg_replace("/href=/i", "target=\"_blank\" href=", $res); } return $res; @@ -4612,12 +4614,6 @@ if ($result) { - $link_target = ""; - - if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { - $link_target = "target=\"_blank\""; - } - $line = db_fetch_assoc($result); if ($line["icon_url"]) { @@ -4635,10 +4631,10 @@ } else { $comments_url = $line["link"]; } - $entry_comments = "$num_comments comments"; + $entry_comments = "$num_comments comments"; } else { if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "comments"; + $entry_comments = "comments"; } } @@ -4669,7 +4665,7 @@ print "
$parsed_updated
"; if ($line["link"]) { - print "
" . + print "
" . $line["title"] . "$entry_author
"; } else { print "
" . $line["title"] . "$entry_author
"; @@ -4750,11 +4746,6 @@ $article_content = sanitize_rss($link, $line["content"]); - if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { - $article_content = preg_replace("/href=/i", "target=\"_blank\" href=", - $article_content); - } - print "
"; if ($line['note']) { print format_article_note($id, $line['note']); @@ -5278,11 +5269,6 @@ print "
"; - if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { - $line["content_preview"] = preg_replace("/href=/i", - "target=\"_blank\" href=", $line["content_preview"]); - } - if ($show_excerpt) { print "