summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-01-13 10:11:13 +0300
committerAndrew Dolgov <[email protected]>2010-01-13 10:11:13 +0300
commit7514749de76844348064b99654cc081bbdd3c859 (patch)
tree42f73e91565e1cb3f547c8c0b84babc32399099f /functions.php
parentf2105630c631265107b45c77627538060670906c (diff)
rewrite links to open in new window in sanitize_rss(); css tweaks
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php26
1 files changed, 6 insertions, 20 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('/<img[^>]+>/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 = "<a $link_target href=\"$comments_url\">$num_comments comments</a>";
+ $entry_comments = "<a target='_blank' href=\"$comments_url\">$num_comments comments</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
- $entry_comments = "<a $link_target href=\"".$line["comments"]."\">comments</a>";
+ $entry_comments = "<a target='_blank' href=\"".$line["comments"]."\">comments</a>";
}
}
@@ -4669,7 +4665,7 @@
print "<div class=\"postDate$rtl_class\">$parsed_updated</div>";
if ($line["link"]) {
- print "<div clear='both'><a $link_target href=\"" . $line["link"] . "\">" .
+ print "<div clear='both'><a target='_blank' href=\"" . $line["link"] . "\">" .
$line["title"] . "</a><span class='author'>$entry_author</span></div>";
} else {
print "<div clear='both'>" . $line["title"] . "$entry_author</div>";
@@ -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 "<div id=\"POSTNOTE-$id\">";
if ($line['note']) {
print format_article_note($id, $line['note']);
@@ -5278,11 +5269,6 @@
print "</span></div>";
- 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 "<div class=\"cdmExcerpt\" id=\"CEXC-$id\"
onclick=\"cdmExpandArticle($id)\"