Максим Червонный (fiskus_boulder) wrote in changelog,
Максим Червонный
fiskus_boulder
changelog

[ljcom] r10117: LJSUP-7758: Antispam S2

Committer: mchervonniy
LJSUP-7758: Antispam S2
U   trunk/bin/upgrading/s2layers/gradient/layout.s2
Modified: trunk/bin/upgrading/s2layers/gradient/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/gradient/layout.s2	2011-02-24 10:40:22 UTC (rev 10116)
+++ trunk/bin/upgrading/s2layers/gradient/layout.s2	2011-02-24 10:58:42 UTC (rev 10117)
@@ -362,6 +362,7 @@
    set text_tags_description = "Topics List";
    property use text_showspam;
    property use text_hidespam;
+   property use text_spam_comment;
 }
 
 propgroup header = "Header";
@@ -1630,12 +1631,16 @@
 
             foreach var string link_key ($c.link_keyseq) {
                $link = $c->get_link($link_key);
-               $url = $link.url;
-               $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
+               # $url = $link.url;
+               # $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
                if ($first_link and defined $link) {
+		  $url = $link.url;
+		  $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
                   """<a href="$url">$text</a>""";
                   $first_link = false;
                } elseif (defined $link) {
+		  $url = $link.url;
+		  $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
                   """ $*link_divider <a href="$url">$text</a>""";
                }
             }
@@ -1716,8 +1721,14 @@
 }
 
 function EntryPage::print_comments (Comment[] cs) {
+   var Page p = get_page();
    foreach var Comment c ($cs) {
-      if ($c.full) {
+      if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+         var string indent = ($c.depth - 1) * 15 + "px";
+         """<div id="$c.dom_id" class="comment" style="margin-left: $indent;"><strong>$*text_spam_comment</strong></div>""";
+      } elseif ($c.spam and not $p.showspam and (size $c.replies) < 1) {
+         # spam comment w/o children
+      } elseif ($c.full) {
          $this->print_comment($c);
       }
       else {

Tags: fiskus_boulder, ljcom, s2
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