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

[livejournal] r18416: LJSUP-7758: AntiSpam S2

Committer: esavintcev
LJSUP-7758: AntiSpam S2
U   trunk/bin/upgrading/s2layers/classic/layout.s2
U   trunk/bin/upgrading/s2layers/cleansimple/layout.s2
U   trunk/bin/upgrading/s2layers/deardiary/layout.s2
U   trunk/bin/upgrading/s2layers/disjointed/layout.s2
U   trunk/bin/upgrading/s2layers/generator/layout.s2
U   trunk/bin/upgrading/s2layers/haven/layout.s2
U   trunk/bin/upgrading/s2layers/lickable/layout.s2
U   trunk/bin/upgrading/s2layers/magazine/layout.s2
U   trunk/bin/upgrading/s2layers/notepad/layout.s2
U   trunk/bin/upgrading/s2layers/punquin/layout.s2
U   trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
U   trunk/bin/upgrading/s2layers/sixhtml/layout.s2
U   trunk/bin/upgrading/s2layers/sturdygesture/layout.s2
U   trunk/bin/upgrading/s2layers/tabularindent/layout.s2
U   trunk/bin/upgrading/s2layers/variableflow/layout.s2
Modified: trunk/bin/upgrading/s2layers/classic/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/classic/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/classic/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -733,14 +733,14 @@
 function CommentInfo::print_spamlink() {
     var Page p = get_page();
     if ($p.showspam) {
-        print safe "<a href=\"$.read_url\">$*text_hidespam</a>";
+        print safe "<a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a>";
     } else {
-        print safe "<a href=\"$.read_url?mode=showspam\">$*text_showspam</a>";
+        print safe "<a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a>";
     }
 }
 
-function CommentInfo::print ()
-{
+function CommentInfo::print () {
+    var Page p = get_page();
     if ($.show_readlink or $.show_postlink) {
         print safe "<p class='comments'>$*text_left_comments";
         if ($.show_readlink) {
@@ -756,8 +756,10 @@
         if ($.show_postlink) {
             $this->print_postlink();
         }
-        print safe "$*text_btwn_comments";
-        $this->print_spamlink();
+        if ($p.view == "entry") {
+            print safe "$*text_btwn_comments";
+            $this->print_spamlink();
+        }
         print safe "$*text_right_comments</p>";
     }
 }

Modified: trunk/bin/upgrading/s2layers/cleansimple/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/cleansimple/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/cleansimple/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -243,6 +243,8 @@
   property string datetime_format {
     des = "Date and time format for comments";
   }
+  property use text_showspam;
+  property use text_hidespam;
 }
 set opt_text_left_comments = "";
 set opt_text_btwn_comments = " | ";
@@ -841,6 +843,22 @@
         }
     }
 
+
+    var string comments_showspam = "";
+    if ($e.comments.count > 0 and not $e.comments.locked) {
+        if ($p.showspam) {
+            $comments_showspam = """<a href="$e.comments.read_spam_url">$*text_hidespam ($e.comments.spam_counter)</a>""";
+        } else {
+            $comments_showspam = """<a href="$e.comments.read_spam_url">$*text_showspam ($e.comments.spam_counter)</a>""";
+        }
+    } else {
+        $comments_showspam = "";
+    }
+
+    if ($p.view == "entry") {
+        $*opt_text_right_comments = " | $comments_showspam";
+    }
+
     $e.comments->print(); "\n";
     $p->print_reply_container({"target" => "topcomment"});
     "</div></div>";
@@ -889,6 +907,7 @@
         if ($.show_postlink) {
             $this->print_postlink();
         }
+
         print safe "$*opt_text_right_comments</div>";
     }
 }

Modified: trunk/bin/upgrading/s2layers/deardiary/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/deardiary/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/deardiary/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -237,6 +237,9 @@
     property use text_post_comment_friends;
     property use text_read_comments_friends;
     property use text_website_default_name;
+    property use text_showspam;
+    property use text_hidespam;
+    property use text_spam_comment;
 }
 
 propgroup customcss {
@@ -826,6 +829,7 @@
 
 
 function Entry::lay_print_cmdlinks() {
+    var Page p = get_page();
     if ($.comments.show_readlink or $.comments.show_postlink) {
         """<ul class="entrycmdlinks">""";
         if ($.comments.show_readlink) {
@@ -834,6 +838,20 @@
         if ($.comments.show_postlink) {
             "<li>"; $.comments->print_postlink(); "</li>";
         }
+        var string comments_showspam = "";
+        if ($.comments.count > 0 and not $.comments.locked) {
+            if ($p.showspam) {
+                $comments_showspam = """<a href="$.comments.read_spam_url">$*text_hidespam ($.comments.spam_counter)</a>""";
+            } else {
+                $comments_showspam = """<a href="$.comments.read_spam_url">$*text_showspam ($.comments.spam_counter)</a>""";
+            }
+        } else {
+            $comments_showspam = "";
+        }
+
+        if ($p.view == "entry") {
+            print safe " <li> $comments_showspam </li>";
+        }
         println """</ul>""";
     }
 }
@@ -935,7 +953,16 @@
 }
 
 function EntryPage::print_comment(Comment c) {
-    if ($c.full) {
+    var Page p = get_page();
+	if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+	    """<div class="entry ljcmt_full" id="$c.dom_id">
+                <div class="entrycontent">
+                    <strong>$*text_spam_comment</strong>
+                </div>
+            </div>""";
+	} elseif ($c.spam and not $p.showspam and (size $c.replies) < 1) {
+            # spam comment w/o children
+    } elseif ($c.full) {
         #$this->lay_print_entrylite($c);
             """<div class="entry ljcmt_full" id="$c.dom_id">""";
             """<div class="entryheader">

Modified: trunk/bin/upgrading/s2layers/disjointed/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/disjointed/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/disjointed/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -305,6 +305,8 @@
     set datetime_format            = "%%hh%%:%%min%%%%a%%m %%dd%%/%%mm%%/%%yyyy%%";
     set time_monthpage_format      = "%%hh%%:%%min%% %%a%%m";
     set date_daypage_format        = "%%month%% %%dayord%%, %%yyyy%%";
+    property use text_showspam;
+    property use text_hidespam;
 }
 
 propgroup customcss {
@@ -1138,6 +1140,17 @@
       }
     }
 
+
+    var string comments_showspam = "";
+    if ($en.comments.count > 0 and not $en.comments.locked) {
+        if ($p.showspam) {
+            $comments_showspam = """<a href=\"$en.comments.read_spam_url\">$*text_hidespam ($en.comments.spam_counter)</a> """;
+        } else {
+            $comments_showspam = """<a href=\"$en.comments.read_spam_url\">$*text_showspam ($en.comments.spam_counter)</a> """;
+        }
+    }
+    if ($p.view == "entry") { $linkbar = $linkbar + $comments_showspam + " &ndash "; }
+
     if ($en.comments.maxcomments) {
       $linkbar = $linkbar + "$*text_max_comments$btwn_comments";
     } else {

Modified: trunk/bin/upgrading/s2layers/generator/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/generator/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/generator/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -262,6 +262,8 @@
     property string date_daypage_format {
         des = "Date format for the day page";
     }
+    property use text_showspam;
+    property use text_hidespam;
 }
 propgroup customcss {
     property use include_default_stylesheet;
@@ -890,16 +892,26 @@
     }
     $p->print_reply_container({"target" => "topcomment", "class" => "quickreply"});
 
+    var string comments_showspam = "";
+    if ($e.comments.count > 0 and not $e.comments.locked) {
+        if ($p.showspam) {
+            $comments_showspam = """<a href=\"$e.comments.read_spam_url\">$*text_hidespam ($e.comments.spam_counter)</a></span> """;
+        } else {
+            $comments_showspam = """<a href=\"$e.comments.read_spam_url\">$*text_showspam ($e.comments.spam_counter)</a></span> """;
+        }
+    }
 """</td></tr>
 <tr bgcolor="$*weak_back"><td align='left' class='comments' valign='top'>
-<a href="$e.permalink_url">$*text_permalink</a></td>""";
+    <a href="$e.permalink_url">$*text_permalink</a>""";
+    if ($p.view == "entry") { print " | $comments_showspam";}
+"""</td>""";
     if ($p.view != "entry" and $p.view != "reply") {
         "<td align='right' class='comments'>"; $e.comments->print();
     } elseif ($e.comments.enabled) {
         "<td align='right' class='comments'>";
-if (not $e.comments.locked) {
-		$p->print_reply_link({"linktext" => $*text_comment_reply, "target" => "topcomment"});
-}
+        if (not $e.comments.locked) {
+            $p->print_reply_link({"linktext" => $*text_comment_reply, "target" => "topcomment"});
+        }
     } else {
         "<td>";
     }

Modified: trunk/bin/upgrading/s2layers/haven/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/haven/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/haven/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -320,6 +320,8 @@
     set text_sidebar_blurb = "Blurb";
     set text_sidebar_links = "Links";
     set text_sidebar_summary = "Page Summary";
+    property use text_showspam;
+    property use text_hidespam;
 }
 propgroup sidebar
 {
@@ -1211,6 +1213,16 @@
     } else {
         println "&nbsp;";
     }
+    var string comments_showspam = "";
+    if ($e.comments.count > 0 and not $e.comments.locked) {
+        if ($p.showspam) {
+            $comments_showspam = """<a href=\"$e.comments.read_spam_url\">$*text_hidespam ($e.comments.spam_counter)</a></span> """;
+        } else {
+            $comments_showspam = """<a href=\"$e.comments.read_spam_url\">$*text_showspam ($e.comments.spam_counter)</a></span> """;
+        }
+    }
+    if ($p.view == "entry") {print safe "$comments_showspam | ";}
+
     println "</div></div>";
 }
 

Modified: trunk/bin/upgrading/s2layers/lickable/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/lickable/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/lickable/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -344,6 +344,9 @@
     property use text_post_comment_friends;
     property use text_read_comments_friends;
     property use text_website_default_name;
+    property use text_showspam;
+    property use text_hidespam;
+    property use text_spam_comment;
 }
 propgroup customcss {
     property use include_default_stylesheet;
@@ -1098,6 +1101,7 @@
 }
 
 function Entry::lay_print_cmdlinks() {
+    var Page p = get_page();
     if ($.comments.show_readlink or $.comments.show_postlink) {
         """<ul class="entrycmdlinks">""";
         if ($.comments.show_readlink) {
@@ -1106,6 +1110,15 @@
         if ($.comments.show_postlink) {
             "<li>"; $.comments->print_postlink(); "</li>";
         }
+        var string comments_showspam = "";
+        if ($.comments.count > 0 and not $.comments.locked) {
+            if ($p.showspam) {
+                $comments_showspam = """<a href=\"$.comments.read_spam_url\">$*text_hidespam ($.comments.spam_counter)</a></span> """;
+            } else {
+                $comments_showspam = """<a href=\"$.comments.read_spam_url\">$*text_showspam ($.comments.spam_counter)</a></span> """;
+            }
+        }
+        if ($p.view == "entry") {print safe "<li>$comments_showspam</li>";}
         println """</ul>""";
      ### $p->print_reply_container({"target" => "topcomment"});
     }
@@ -1201,7 +1214,12 @@
     $this->lay_print_entrylite($e);
 }
 function EntryPage::print_comment(Comment c) {
-    if ($c.full) {
+    var Page p = get_page();
+    if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+        """<strong>$*text_spam_comment</strong>""";
+    } elseif ($c.spam and not $p.showspam and (size $c.replies) < 1) {
+        # spam comment w/o children
+    } elseif ($c.full) {
         $this->lay_print_entrylite($c);
     }
     else {

Modified: trunk/bin/upgrading/s2layers/magazine/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/magazine/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/magazine/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -662,9 +662,9 @@
                     print safe "$*text_btwn_comments";
                 }
                 if ($p.showspam) {
-                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam</a>""";
+                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a>""";
                 } else {
-                    print safe """<a href=\"$.read_spam_url\">$*text_showspam</a>""";
+                    print safe """<a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a>""";
                 }
             }
         }

Modified: trunk/bin/upgrading/s2layers/notepad/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/notepad/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/notepad/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -601,9 +601,9 @@
                     print safe "$*text_btwn_comments";
                 }
                 if ($p.showspam) {
-                     print safe """<a href=\"$.read_spam_url\">$*text_hidespam</a>""";
+                     print safe """<a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a>""";
                 } else {
-                     print safe """<a href=\"$.read_spam_url\">$*text_showspam</a>""";
+                     print safe """<a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a>""";
                 }
             }
         }

Modified: trunk/bin/upgrading/s2layers/punquin/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/punquin/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/punquin/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -674,9 +674,9 @@
                     print safe "$*text_btwn_comments";
                 }
                 if ($p.showspam) {
-                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam</a> """;
+                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a> """;
                 } else {
-                    print safe """<a href=\"$.read_spam_url\">$*text_showspam</a>""";
+                    print safe """<a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a>""";
                 }
             }
         }

Modified: trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -803,9 +803,9 @@
         $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""";
+                $linkbar = $linkbar + """<a href=\"$en.comments.read_spam_url\">$*text_hidespam ($en.comments.spam_counter)</a>$btwn_comments""";
             } else {
-                $linkbar = $linkbar + """<a href=\"$en.comments.read_spam_url\">$*text_showspam</a>$btwn_comments""";
+                $linkbar = $linkbar + """<a href=\"$en.comments.read_spam_url\">$*text_showspam ($en.comments.spam_counter)</a>$btwn_comments""";
             }
         }
       }

Modified: trunk/bin/upgrading/s2layers/sixhtml/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sixhtml/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/sixhtml/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -1180,9 +1180,9 @@
             " $sep "; $e.comments->print_readlink();
             if ($p.view == "entry") {
                 if ($p.showspam) {
-                    print safe """ $sep <a href=\"$e.comments.read_spam_url\">$*text_hidespam</a>""";
+                    print safe """ $sep <a href=\"$e.comments.read_spam_url\">$*text_hidespam ($e.comments.spam_counter)</a>""";
                 } else {
-                    print safe """ $sep <a href=\"$e.comments.read_spam_url\">$*text_showspam</a>""";
+                    print safe """ $sep <a href=\"$e.comments.read_spam_url\">$*text_showspam ($e.comments.spam_counter)</a>""";
                 }
             }
          }

Modified: trunk/bin/upgrading/s2layers/sturdygesture/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sturdygesture/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/sturdygesture/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -721,9 +721,9 @@
         if ($.show_readlink) {
             if ($p.view == "entry") {
                 if ($p.showspam) {
-                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam</a> | """;
+                    print safe """<a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a> | """;
                 } else {
-                    print safe """<a href=\"$.read_spam_url\">$*text_showspam</a> | """;
+                    print safe """<a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a> | """;
                 }
             }
             $this->print_readlink();

Modified: trunk/bin/upgrading/s2layers/tabularindent/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -939,9 +939,9 @@
 
         print_header("Comments:");
         if ($p.showspam) {
-            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_hidespam</a></p>""";
+            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_hidespam ($e.comments.spam_counter)</a></p>""";
         } else {
-            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_showspam</a></p>""";
+            print """<p width='95%' style='text-align:center;'><a href=\"$e.comments.read_spam_url\">$*text_showspam ($e.comments.spam_counter)</a></p>""";
         }
         if ($.comment_pages.total_subitems > 0) {
             $.comment_pages->print();

Modified: trunk/bin/upgrading/s2layers/variableflow/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/variableflow/layout.s2	2011-02-28 05:09:30 UTC (rev 18415)
+++ trunk/bin/upgrading/s2layers/variableflow/layout.s2	2011-02-28 05:19:52 UTC (rev 18416)
@@ -1,5 +1,3 @@
-
-
 layerinfo "type" = "layout";
 layerinfo "name" = "Variable Flow";
 layerinfo "author_name" = "Martin Atkins";
@@ -721,9 +719,9 @@
             println "</li>";
             if ($p.view == "entry") {
                 if ($p.showspam) {
-                    """<li class="comments-hidespam"><a href=\"$.read_spam_url\">$*text_hidespam</a></li>""";
+                    """<li class="comments-hidespam"><a href=\"$.read_spam_url\">$*text_hidespam ($.spam_counter)</a></li>""";
                 } else {
-                    """<li class="comments-showspam"><a href=\"$.read_spam_url\">$*text_showspam</a></li>""";
+                    """<li class="comments-showspam"><a href=\"$.read_spam_url\">$*text_showspam ($.spam_counter)</a></li>""";
                 }
             }
         }

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