Савинцев Егор 🚶 (savintsev_egor) wrote in changelog,
Савинцев Егор 🚶
savintsev_egor
changelog

[livejournal] r18390: LJSUP-7758: AntiSpam S2

Committer: esavintcev
LJSUP-7758: AntiSpam S2
U   trunk/bin/upgrading/s2layers/variableflow/layout.s2
Modified: trunk/bin/upgrading/s2layers/variableflow/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/variableflow/layout.s2	2011-02-24 04:43:53 UTC (rev 18389)
+++ trunk/bin/upgrading/s2layers/variableflow/layout.s2	2011-02-24 04:52:35 UTC (rev 18390)
@@ -281,6 +281,9 @@
     property use text_read_comments;
     property use text_post_comment_friends;
     property use text_read_comments_friends;
+    property use text_showspam;
+    property use text_hidespam;
+    property use text_spam_comment;
 }
 
 propgroup customcss {
@@ -709,12 +712,20 @@
 }
 
 function CommentInfo::print() {
+    var Page p = get_page();
     if ($.show_readlink or $.show_postlink) {
         """<ul class="entryextra">""";
         if ($.show_readlink) {
             print """<li class="entryreadlink">""";
             $this->print_readlink();
             println "</li>";
+            if ($p.view == "entry") {
+                if ($p.showspam) {
+                    """<li class="comments-hidespam"><a href=\"$.read_url\">$*text_hidespam</a></li>""";
+                } else {
+                    """<li class="comments-showspam"><a href=\"$.read_url?mode=showspam\">$*text_showspam</a></li>""";
+                }
+            }
         }
         if ($.show_postlink) {
             print """<li class="entrypostlink">""";
@@ -726,8 +737,14 @@
 }
 
 function print_comment(Comment e) {
+var Page p = get_page();
+
 """<div class="entry" id="$e.dom_id">""";
 
+if ($e.spam and not $p.showspam) {
+    """$*text_spam_comment""";
+} else {
+
     if ($*adv_horrible_userpic_markup) {
         """<table cellpadding="0" border="0" cellspacing="0" style="margin: 0;" class="uglykludgeuserpic">
         <tr valign="top">
@@ -778,7 +795,8 @@
         "</td></tr></table>";
     }
 
-    println "</div>";
+}
+println "</div>";
 
 }
 

Tags: livejournal, s2, savintsev_egor
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments