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

[livejournal] r18401: LJSUP-7758: AntiSpam S2

Committer: esavintcev
LJSUP-7758: AntiSpam S2
U   trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
Modified: trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-02-24 10:43:22 UTC (rev 18400)
+++ trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-02-24 11:02:38 UTC (rev 18401)
@@ -343,6 +343,9 @@
   set text_tagspage_header       = "Visible Tags";
   set datetime_format            = "%%yyyy%%-%%mm%%-%%dd%% %%HH%%:%%min%%";
   set date_daypage_skip_format   = "%%month%% %%dayord%%, %%yyyy%%";
+  property use text_showspam;
+  property use text_hidespam;
+  property use text_spam_comment;
 
 }
 
@@ -798,6 +801,13 @@
           $linkbar = $linkbar + """ $text""";
         }
         $linkbar = $linkbar + """</a>$btwn_comments""";
+        if ($p.view == "entry") {
+            if ($p.showspam) {
+                $linkbar = $linkbar + """<a href=\"$en.comments.read_spam_url\">$*text_hidespam</a>$btwn_comments""";
+            } else {
+                $linkbar = $linkbar + """<a href=\"$en.comments.read_spam_url\">$*text_showspam</a>$btwn_comments""";
+            }
+        }
       }
 
       if ($en.comments.maxcomments) {
@@ -1364,11 +1374,16 @@
 }
 
 function EntryPage::print_comments (Comment[] cs) {
+  var Page p = get_page();
   if (size $cs == 0) { return; }
   foreach var Comment c ($cs) {
     var int indent = ($c.depth - 1) * 25;
     "<div id=\"$c.dom_id\" style='margin-left: ${indent}px; margin-top: 5px'>\n";
-    if ($c.full) {
+    if (($c.spam) and (not $p.showspam) and (size($c.replies) > 0)) {
+      """$*text_spam_comment""";
+    } elseif (($c.spam) and (not $p.showspam)) {
+      """&nsbp;""";
+    } elseif ($c.full) {
       $this->print_comment($c);
     } else {
       $this->print_comment_partial($c);

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