[ljcom] r10103: LJSUP-7758: AntiSpam S2
Committer: esavintcev
LJSUP-7758: AntiSpam S2U trunk/bin/upgrading/s2layers/tranquilityii/layout.s2 U trunk/bin/upgrading/s2layers/unearthed/layout.s2
Modified: trunk/bin/upgrading/s2layers/tranquilityii/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/tranquilityii/layout.s2 2011-02-24 07:31:25 UTC (rev 10102)
+++ trunk/bin/upgrading/s2layers/tranquilityii/layout.s2 2011-02-24 07:48:57 UTC (rev 10103)
@@ -179,6 +179,8 @@
property string text_links_header { des = "Sidebar links header text"; }
property string text_summary_header { des = "Page summary text header"; }
property string text_links_spacer { des = "String to act as links list spacer";}
+ property use text_showspam;
+ property use text_hidespam;
}
# PROPERTIES: CUSTOM CSS
@@ -1175,6 +1177,13 @@
print "<h4>";
print safe get_permalink($e.permalink_url);
+ if ( $p.view == "entry" and $e.comments.count > 0) {
+ if ($p.showspam) {
+ """ | <a href=\"$e.permalink_url\">$*text_hidespam</a></span>""";
+ } else {
+ """ | <a href=\"$e.permalink_url?mode=showspam\">$*text_showspam</a></span>""";
+ }
+ }
if ( $p.view != "entry" and $p.view != "reply" ) {
print " | ";
$e.comments->print();
Modified: trunk/bin/upgrading/s2layers/unearthed/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/unearthed/layout.s2 2011-02-24 07:31:25 UTC (rev 10102)
+++ trunk/bin/upgrading/s2layers/unearthed/layout.s2 2011-02-24 07:48:57 UTC (rev 10103)
@@ -284,6 +284,8 @@
set text_nextyear = "Next Year";
set text_prevmonth = "Previous Month";
set text_nextmonth = "Next Month";
+ property use text_showspam;
+ property use text_hidespam;
}
propgroup customcss
{
@@ -949,6 +951,7 @@
function Page::print_entry(Entry e)
{
+ var Page p = get_page();
var string id = "entry_$e.itemid";
var string title = "$e.security_icon" + ($e.subject != "" ? " $e.subject" : " $*text_nosubject");
var string contents = "";
@@ -975,12 +978,20 @@
get_plural_phrase($e.comments.count, $.view == "friends" ?
"text_read_comments_friends" : "text_read_comments") +
"</a>";
+
$sidebar = $sidebar + "<br />";
}
if ($.view != "reply") {
$sidebar = $sidebar + """<a href="$e.comments.post_url">""" +
($.view == "friends" ? $*text_post_comment_friends : $*text_post_comment) + "</a><br />";
}
+ if (($e.comments.count > 0 or $e.comments.screened) and $.view == "entry") {
+ if ($p.showspam) {
+ $sidebar = $sidebar + """<a href=\"$e.comments.read_url\">$*text_hidespam</a><br />""";
+ } else {
+ $sidebar = $sidebar + """<a href=\"$e.comments.read_url?mode=showspam\">$*text_showspam</a><br />""";
+ }
+ }
}
$sidebar = $sidebar + """<a href="$e.permalink_url">$*text_permalink</a><br />""";
if ($.view == "entry" or $.view == "reply") {
