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

[livejournal] r18397: LJSUP-7758: AntiSpam S2

Committer: esavintcev
LJSUP-7758: AntiSpam S2
U   trunk/bin/upgrading/s2layers/sturdygesture/layout.s2
U   trunk/bin/upgrading/s2layers/tabularindent/layout.s2
Modified: trunk/bin/upgrading/s2layers/sturdygesture/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sturdygesture/layout.s2	2011-02-24 09:16:42 UTC (rev 18396)
+++ trunk/bin/upgrading/s2layers/sturdygesture/layout.s2	2011-02-24 09:30:53 UTC (rev 18397)
@@ -61,6 +61,9 @@
     property use linklist_support;
     property use external_stylesheet;
     property use custom_control_strip_colors;
+    property use text_showspam;
+    property use text_hidespam;
+    property use text_spam_comment;
 }
 
 propgroup colors {
@@ -707,6 +710,7 @@
 }
 
 function CommentInfo::print() {
+    var Page p = get_page();
     if ($.show_readlink or $.show_postlink) {
         if ($.show_postlink) {
             $this->print_postlink();
@@ -715,6 +719,13 @@
             " | ";
         }
         if ($.show_readlink) {
+            if ($p.view == "entry") {
+                if ($p.showspam) {
+                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam</a> | """;
+                } else {
+                    print safe """<a href=\"$.read_spam_url\">$*text_showspam</a> | """;
+                }
+            }
             $this->print_readlink();
         }
     }
@@ -760,14 +771,22 @@
 }
 
 function EntryPage::print_comments(Comment[] cs) {
+    var Page p = get_page();
     if (size $cs == 0) { return; }
     print "<div style=\"margin-left: 25px;\">";
     foreach var Comment c ($cs) {
         var int indent = ($c.depth - 1) * 25;
-        if ($c.full) {
-            $this->print_comment($c);
+        if ($c.spam and not $p.showspam) {
+            """<a name='$c.anchor'></a><div id="$c.dom_id" class="ljcmt_full"><div class="box"><div class="entry">$*text_spam_comment</div></div>""";
+            if ((size $c.replies) > 0) {
+                $this->print_comments($c.replies);
+            }
         } else {
-            $this->print_comment_partial($c);
+            if ($c.full) {
+                $this->print_comment($c);
+            } else {
+                $this->print_comment_partial($c);
+            }
         }
     }
     print "</div>";

Modified: trunk/bin/upgrading/s2layers/tabularindent/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-02-24 09:16:42 UTC (rev 18396)
+++ trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-02-24 09:30:53 UTC (rev 18397)
@@ -921,6 +921,7 @@
 
 function EntryPage::print_body () {
     var Page p = get_page();
+    var Entry e = $.entry;
         set_handler("unscreen_comment_#", [
                                            [ "style_bgcolor", "cmtbar#", "$*comment_bar_one_bgcolor", ],
                                            [ "style_color", "cmtbar#", "$*comment_bar_one_fgcolor", ],
@@ -938,9 +939,9 @@
 
         print_header("Comments:");
         if ($p.showspam) {
-            print """<p width='95%' style='text-align:center;'><a href=\"$.entry.permalink_url\">$*text_hidespam</a></p>""";
+            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_hidespam</a></p>""";
         } else {
-            print """<p width='95%' style='text-align:center;'><a href=\"$.entry.permalink_url?mode=showspam\">$*text_showspam</a></p>""";
+            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_showspam</a></p>""";
         }
         if ($.comment_pages.total_subitems > 0) {
             $.comment_pages->print();

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