[Slashdotjp-dev 1266] [794] * Select enable/ disable moderation for not m2able reasons when it is not

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 10月 17日 (金) 17:30:49 JST


Revision: 794
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=794
Author:   tach
Date:     2008-10-17 17:30:49 +0900 (Fri, 17 Oct 2008)

Log Message:
-----------
 * Select enable/disable moderation for not m2able reasons when it is not
   eligible

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/debian/changelog
    slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm
    slashjp/branches/2.5.0.192/sql/mysql/defaults.sql


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-10-17 06:54:38 UTC (rev 793)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-10-17 08:30:49 UTC (rev 794)
@@ -7,8 +7,10 @@
     - Add to redirect when nickname is not found but matchname is found
   * Add "reasons_base", "reasons_plused" and "reasons_minused" to constants
     - To change modreasons by moderated score
+  * Select enable/disable moderation for not m2able reasons when it is not
+    eligible
 
- -- Taku YASUI <tach****@osdn*****>  Fri, 17 Oct 2008 06:52:24 +0000
+ -- Taku YASUI <tach****@osdn*****>  Fri, 17 Oct 2008 08:28:27 +0000
 
 slash (2.5.0.192-20) unstable; urgency=low
 

Modified: slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm
===================================================================
--- slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm	2008-10-17 06:54:38 UTC (rev 793)
+++ slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm	2008-10-17 08:30:49 UTC (rev 794)
@@ -185,6 +185,20 @@
 		return 0 unless $comment->{time_unixepoch} >= time() - 3600*
 			($constants->{comments_moddable_hours}
 				|| 24*$constants->{archive_delay});
+
+		# Do not moderate by m2able reason (for slashdot.jp, 2008-10-17)
+		if ($constants->{mod_limit_not_m2able_reasons}) {
+			if ($constants->{reasons}->{$reason}->{m2able} != 1 &&
+			    $constants->{reasons}->{$reason}->{val} > 0 &&
+			    $comment->{points} >= $comment->{pointsorig}) {
+				return 0;
+			}
+			if ($constants->{reasons}->{$reason}->{m2able} != 1 &&
+			    $constants->{reasons}->{$reason}->{val} < 0 &&
+			    $comment->{points} <= $comment->{pointsorig}) {
+				return 0;
+			}
+		}
 	}
 
 	# Start putting together the data we'll need to display to

Modified: slashjp/branches/2.5.0.192/sql/mysql/defaults.sql
===================================================================
--- slashjp/branches/2.5.0.192/sql/mysql/defaults.sql	2008-10-17 06:54:38 UTC (rev 793)
+++ slashjp/branches/2.5.0.192/sql/mysql/defaults.sql	2008-10-17 08:30:49 UTC (rev 794)
@@ -1149,6 +1149,7 @@
 INSERT IGNORE INTO vars (name, value, description) VALUES ('modreasons_select_disabled','','Comma separated "modreasons.id"s disable to select when moderation');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('search_query_name','query','alternative query string form name for search.pl');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('journal_list_default_display', '50', 'Number of journals to display on a journal title list page');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mod_limit_not_m2able_reasons', '0', 'Enable moderation limit for not m2able reasons when it is not eligible');
 UPDATE vars SET value='text/html; charset=UTF-8' WHERE name='content_type_webpage';
 UPDATE vars SET value='0' WHERE name='draconian_charset';
 UPDATE vars SET value='UTF-8' WHERE name='rdfencoding';


Slashdotjp-dev メーリングリストの案内
Back to archive index