From 7514749de76844348064b99654cc081bbdd3c859 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 13 Jan 2010 10:11:13 +0300 Subject: [PATCH] rewrite links to open in new window in sanitize_rss(); css tweaks --- functions.php | 26 ++++++------------------- tt-rss.css | 54 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/functions.php b/functions.php index a5583e729..54385a4a7 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 "