rewrite links to open in new window in sanitize_rss(); css tweaks

master
Andrew Dolgov 15 years ago
parent f2105630c6
commit 7514749de7

@ -3629,9 +3629,11 @@
} }
if (get_pref($link, "STRIP_IMAGES", $owner)) { if (get_pref($link, "STRIP_IMAGES", $owner)) {
$res = preg_replace('/<img[^>]+>/is', '', $res); $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; return $res;
@ -4612,12 +4614,6 @@
if ($result) { if ($result) {
$link_target = "";
if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) {
$link_target = "target=\"_blank\"";
}
$line = db_fetch_assoc($result); $line = db_fetch_assoc($result);
if ($line["icon_url"]) { if ($line["icon_url"]) {
@ -4635,10 +4631,10 @@
} else { } else {
$comments_url = $line["link"]; $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 { } else {
if ($line["comments"] && $line["link"] != $line["comments"]) { 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>"; print "<div class=\"postDate$rtl_class\">$parsed_updated</div>";
if ($line["link"]) { 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>"; $line["title"] . "</a><span class='author'>$entry_author</span></div>";
} else { } else {
print "<div clear='both'>" . $line["title"] . "$entry_author</div>"; print "<div clear='both'>" . $line["title"] . "$entry_author</div>";
@ -4750,11 +4746,6 @@
$article_content = sanitize_rss($link, $line["content"]); $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\">"; print "<div id=\"POSTNOTE-$id\">";
if ($line['note']) { if ($line['note']) {
print format_article_note($id, $line['note']); print format_article_note($id, $line['note']);
@ -5278,11 +5269,6 @@
print "</span></div>"; 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) { if ($show_excerpt) {
print "<div class=\"cdmExcerpt\" id=\"CEXC-$id\" print "<div class=\"cdmExcerpt\" id=\"CEXC-$id\"
onclick=\"cdmExpandArticle($id)\" onclick=\"cdmExpandArticle($id)\"

@ -921,30 +921,29 @@ span.cdmAllTagsCtr:hover div {
} }
div.cdmArticle { div.cdmArticle {
border-color : #a0a0a0; border-color : #c0c0c0;
border-width : 0px 0px 1px 0px; border-width : 1px;
border-style : solid; border-style : solid;
background-color : #f9faff; background : white;
margin : 0px; margin : 5px 5px 0px 5px;
color : #505050;
color : black; color : black;
} }
div.cdmArticleUnread { div.cdmArticleUnread {
border-color : #a0a0a0; border-color : #88b0f0;
border-width : 0px 0px 1px 0px; border-width : 1px;
border-style : solid; border-style : solid;
background-color : white; background-color : white;
margin : 0px; margin : 5px 5px 0px 5px;
color : black; color : black;
} }
div.cdmArticleSelected, div.cdmArticleUnreadSelected { div.cdmArticleSelected, div.cdmArticleUnreadSelected {
margin : 0px;
background-color : #fff7d5; background-color : #fff7d5;
border-color : #e7d796; border-color : #e7d796;
border-width : 0px 0px 1px 0px; border-width : 1px;
border-style : solid; border-style : solid;
margin : 5px 5px 0px 5px;
} }
div.cdmArticleUnread div.cdmHeader a.title, div.cdmArticleUnread div.cdmHeader a.title,
@ -955,21 +954,34 @@ div.cdmArticleUnreadSelected div.cdmHeader a.title {
div.cdmHeader { div.cdmHeader {
padding : 5px 5px 10px 5px; padding : 5px 5px 10px 5px;
color : gray; color : gray;
}
div.cdmArticleUnread div.cdmHeader {
background : url("images/footer.png") top left;
background-repeat : repeat-x;
} }
div.cdmArticleUnread div.cdmHeader span.titleWrap a { div.cdmArticleUnread div.cdmHeader span.titleWrap a {
color : black; color : black;
} }
div.cdmArticleSelected div.cdmFooter, div.cdmArticleUnreadSelected div.cdmFooter {
background : #e7d796;
}
div.cdmFooter input {
vertical-align : middle;
}
div.cdmFooter { div.cdmFooter {
font-size : 14px; font-size : 14px;
color : black; color : black;
padding : 5px; padding : 5px;
color : gray; color : gray;
border-width : 1px 0px 0px 0px; background : #f9f9f9;
border-color : #c0c0c0; /* border-width : 1px 0px 0px 0px;
border-style : dotted; border-style : solid;
border-color : #88b0f0; */
} }
div.cdmFooter span.s0 { div.cdmFooter span.s0 {
@ -994,11 +1006,7 @@ div.cdmFooter img.markedPic, div.cdmFooter img.tagsPic {
width : 16px; width : 16px;
height : 16px; height : 16px;
vertical-align : middle; vertical-align : middle;
} }
img.markedPic {
cursor : pointer;
}
div.cdmHeader div.articleUpdated { div.cdmHeader div.articleUpdated {
float : right; float : right;
@ -1050,6 +1058,10 @@ div.cdmEnclosures {
color : gray; color : gray;
} }
img.markedPic {
cursor : pointer;
}
a.warning { a.warning {
color : #f04040; color : #f04040;
} }
@ -1386,6 +1398,10 @@ div.whiteBox {
font-size : 14px; font-size : 14px;
} }
#toolbar input {
vertical-align : middle;
}
div.headlines_normal { div.headlines_normal {
position : absolute; position : absolute;
border-width : 1px 0px 0px 0px; border-width : 1px 0px 0px 0px;

Loading…
Cancel
Save