[Slashdotjp-dev 735] [247] merged from 2.5.0.183 upstream branch

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2007年 11月 9日 (金) 16:15:56 JST


Revision: 247
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=247
Author:   tach
Date:     2007-11-09 16:15:55 +0900 (Fri, 09 Nov 2007)

Log Message:
-----------
merged from 2.5.0.183 upstream branch

Modified Paths:
--------------
    slashjp/trunk/Slash/DB/MySQL/MySQL.pm
    slashjp/trunk/Slash/Slash.pm
    slashjp/trunk/Slash/Utility/Display/Display.pm
    slashjp/trunk/plugins/Admin/admin.pl
    slashjp/trunk/plugins/Admin/templates/editStory;admin;default
    slashjp/trunk/plugins/Ajax/PLUGIN
    slashjp/trunk/plugins/Ajax/htdocs/ajax.pl
    slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default
    slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default
    slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default
    slashjp/trunk/plugins/Bookmark/bookmark.pl
    slashjp/trunk/plugins/Email/email.pl
    slashjp/trunk/plugins/FireHose/mysql_dump.sql
    slashjp/trunk/plugins/FireHose/mysql_schema.sql
    slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default
    slashjp/trunk/plugins/FireHose/templates/fhadvprefpane;misc;default
    slashjp/trunk/plugins/FireHose/templates/firehose_options;misc;default
    slashjp/trunk/plugins/Journal/Journal.pm
    slashjp/trunk/plugins/Messages/DB/MySQL/MySQL.pm
    slashjp/trunk/plugins/Messages/PLUGIN
    slashjp/trunk/plugins/Tags/Tags.pm
    slashjp/trunk/sql/mysql/defaults.sql
    slashjp/trunk/sql/mysql/upgrades
    slashjp/trunk/tagboxes/Despam/Despam.pm
    slashjp/trunk/tagboxes/Despam/mysql_dump.sql
    slashjp/trunk/tagboxes/FHEditorPop/FHEditorPop.pm
    slashjp/trunk/tagboxes/FireHoseScores/FireHoseScores.pm
    slashjp/trunk/tagboxes/Top/Top.pm
    slashjp/trunk/themes/slashcode/htdocs/images/comments.js
    slashjp/trunk/themes/slashcode/templates/edit_comment;comments;default
    slashjp/trunk/themes/slashcode/templates/footer;misc;default
    slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default
    slashjp/trunk/themes/slashcode/templates/printCommentsMain;misc;default

Added Paths:
-----------
    slashjp/trunk/plugins/Ajax/templates/modal_footer;misc;default
    slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default

Property Changed:
----------------
    slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default
    slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default
    slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default


-------------- next part --------------
Modified: slashjp/trunk/Slash/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -5109,11 +5109,13 @@
 # 	{ norss => 0, trusted => 1, comment => 'we love these guys' },
 # 	{ adminuid => 78724 });
 
-# This method always succeeds.  It returns 1 if a row was actually
-# added to al2, 0 if there was merely an existing row that was updated.
+# This method always succeeds unless srcid is 0.  It returns
+# 1 if a row was actually added to al2, 0 if there was merely an
+# existing row that was updated.
 
 sub setAL2 {
 	my($self, $srcid, $type_hr, $options) = @_;
+	return undef if !$srcid;
 	my $adminuid = $options->{adminuid} || getCurrentUser('uid') || 0;
 	my $ts_sql = $options->{ts} ? $self->sqlQuote($options->{ts}) : 'NOW()';
 
@@ -12179,6 +12181,8 @@
 	for my $id (@journal_ids) {
 		my $globjid = $journals_hr->{$id};
 		my $fixnick = $journaldata_hr->{$id}{nickname};
+if (!defined $fixnick) { print STDERR scalar(gmtime) . " _addGlobjEssentials_journals no nick for journal $id\n"; }
+		$fixnick = fixparam($fixnick || '');
 		$data_hr->{$globjid}{url} = "$constants->{rootdir}/~$fixnick/journal/$id";
 		$data_hr->{$globjid}{title} = $journaldata_hr->{$id}{description};
 		$data_hr->{$globjid}{created_at} = $journaldata_hr->{$id}{date};
@@ -12531,6 +12535,20 @@
 	return $self->sqlSelectAllHashrefArray("*", "static_files", "stoid=$stoid_q");
 }
 
+sub getStaticFiles {
+	my($self, $stoid, $fhid) = @_;
+	my $stoid_q = $self->sqlQuote($stoid);
+	my $fhid_q = $self->sqlQuote($fhid);
+	my @where;
+	push @where, "stoid=$stoid_q";
+	push @where, "fhid=$fhid_q";
+	my $where = join ' OR ', @where;
+	print STDERR " $where \n";
+	return $self->sqlSelectAllHashrefArray("*", "static_files", $where);
+}
+
+
+
 sub getStaticFile {
 	my $answer = _genericGetCache({
 		table		=> 'static_files',

Modified: slashjp/trunk/Slash/Slash.pm
===================================================================
--- slashjp/trunk/Slash/Slash.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/Slash/Slash.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -1632,7 +1632,7 @@
 			$atstorytime = $constants->{subscribe_future_name};
 		} else {
 			$atstorytime = $user->{aton} . ' '
-				. timeCalc($story->{'time'}, $df, 0, { is_old => $is_old });
+				. timeCalc($story->{'time'}, $df, undef, { is_old => $is_old });
 		}
 		$return =~ s/\Q__TIME_TAG__\E/$atstorytime/;
 

Modified: slashjp/trunk/Slash/Utility/Display/Display.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Display/Display.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/Slash/Utility/Display/Display.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -1348,7 +1348,7 @@
 		$display .= qq| by $linkdata->{nickname}|;
 		$display .= qq| (Score:$linkdata->{points})|
 			if !$user->{noscores} && $linkdata->{points};
-		$display .= " " . timeCalc($linkdata->{date}) 
+		$display .= " " . timeCalc($linkdata->{'time'}) 
 			if $linkdata->{date};
 	}
 	#$display .= "\n";

Modified: slashjp/trunk/plugins/Admin/admin.pl
===================================================================
--- slashjp/trunk/plugins/Admin/admin.pl	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Admin/admin.pl	2007-11-09 07:15:55 UTC (rev 247)
@@ -1243,6 +1243,11 @@
 			$display_check = $form->{display} ? $constants->{markup_checked_attribute} : '';
 		}
 
+		$stoid = $slashdb->getStory($form->{stoid} || $form->{sid}, 'stoid', 1);
+		if ($stoid) {
+			handleMediaFileForStory($stoid);
+		}
+
 	} elsif ($stoid) { # Loading an existing SID
 
 		$user->{state}{editing} = 1;
@@ -1519,7 +1524,9 @@
 	if ($stoid || $form->{sid}) {
 		my $story = $slashdb->getStory($form->{sid});
 		$stoid ||= $story->{stoid};
-		$pending_file_count = $slashdb->numPendingFilesForStory($stoid); 		$story_static_files = $slashdb->getStaticFilesForStory($stoid);
+		my $fhid = $form->{fhid} || $story->{fhid};
+		$pending_file_count = $slashdb->numPendingFilesForStory($stoid); 
+		$story_static_files = $slashdb->getStaticFiles($stoid, $fhid);
 	}
 	slashDisplay('editStory', {
 		stoid			=> $stoid,

Modified: slashjp/trunk/plugins/Admin/templates/editStory;admin;default
===================================================================
--- slashjp/trunk/plugins/Admin/templates/editStory;admin;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Admin/templates/editStory;admin;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -244,11 +244,14 @@
 				<div class="notes">[% ispell_comments.introtext %]</div>
 
 				[% PROCESS editbuttons %]
-
+				[% IF newarticle %]
+					Need to save the story before you can upload files to it <br>
+				[% ELSE %]
 				<label>
 					Upload an image/audio file for this story [% IF pending_file_count %]([% pending_file_count %] awaiting processing)[% END %]
 				</label>
 				<input type="file" name="media_file">
+				[% END %]
 
 				[% IF story_static_files && story_static_files.size  %]
 					<label>
@@ -257,30 +260,34 @@
 					<table cellpadding="3" cellspacing="3">
 					<tr><td>Select <br>Thumb</td><td colspan="3"></td><td>Click to <br>add to body</td></tr>
 					[% FOREACH mfile = story_static_files %]
-					[% filename = mfile.name %]
-					[% filename = filename.replace(".*\/", ""); %]
-					<tr><td><input type="radio" name="thumb" value="[% mfile.sfid %]" [% IF storyref.thumb == mfile.sfid; constants.markup_checked_attribute; END %]></td><td>[% filename %]</td><td>[% mfile.width %]</td>
-					<td>[% mfile.height %]</td>
+					[% bigfile = mfile.name %]
+					[% IF mfile.filetype != "image" || (mfile.filetype == "image" && bigfile.match('-thumb\.')) %]
+						[% filename = mfile.name %]
+						[% filename = filename.replace(".*\/", ""); %]
+						<tr><td><input type="radio" name="thumb" value="[% mfile.sfid %]" [% IF storyref.thumb == mfile.sfid; constants.markup_checked_attribute; END %]></td><td>[% filename %]</td><td>[% mfile.width %]</td>
+						<td>[% mfile.height %]</td>
 
-<td>
-[% IF mfile.filetype == "image" %]
-[% height = mfile.height; width = mfile.width %]
-[% IF width && height %]
-	[% WHILE (height > 225 || width > 225) %]
-		[% height = height / 1.3  %]
-		[% width = width / 1.3 %]
-	[% END %]
-	[% width = width.int %]
-	[% height = height.int %]
-[% END %]
-<a href="#bodytext" onclick="appendToBodytext('\n<img src=\'[% constants.imagedir %][% mfile.name %]\' width=\'[% mfile.width %]\' height=\'[% mfile.height %]\'>')"><img src="[% constants.imagedir %][% mfile.name %]" width="[% width %]" height="[% height %]"></a>
-[% ELSE %]
-<a href="#bodytext" onclick="appendToBodytext('\n<a href=\'[% constants.imagedir %][% mfile.name %]\'>[% filename %]</a>')">Add [% filename %]</a>
-[% END %]
+						<td>
+						[% IF mfile.filetype == "image" %]
+							[% height = mfile.height; width = mfile.width %]
+							[% IF width && height %]
+								[% WHILE (height > 225 || width > 225) %]
+									[% height = height / 1.3  %]
+									[% width = width / 1.3 %]
+								[% END %]
+								[% width = width.int %]
+								[% height = height.int %]
+							[% END %]
+							[% bigfile = bigfile.replace('-thumb') %]
+							<a href="#bodytext" onclick="appendToBodytext('\n<a href=\'[% constants.imagedir %][% bigfile %]\'><img src=\'[% constants.imagedir %][% mfile.name %]\' width=\'[% mfile.width %]\' height=\'[% mfile.height %]\'></a>')"><img src="[% constants.imagedir %][% mfile.name %]" width="[% width %]" height="[% height %]"></a>
+						[% ELSE %]
+							<a href="#bodytext" onclick="appendToBodytext('\n<a href=\'[% constants.imagedir %][% mfile.name %]\'>[% filename %]</a>')">Add [% filename %]</a>
+						[% END %]
 </td>
 </tr>
 					[% END %]
-					<tr><td><input type="radio" name="thumb" value="0"></td><td>None</td><td colspan="1"></td></tr>
+					[% END %]
+					<tr><td><input type="radio" name="thumb" value="0" [% IF !storyref.thumb; constants.markup_checked_attribute; END %]></td><td>None</td><td colspan="1"></td></tr>
 					</table>
 				[% END %]
 

Modified: slashjp/trunk/plugins/Ajax/PLUGIN
===================================================================
--- slashjp/trunk/plugins/Ajax/PLUGIN	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/PLUGIN	2007-11-09 07:15:55 UTC (rev 247)
@@ -35,3 +35,5 @@
 template=templates/datewidget;misc;default
 template=templates/prefs_d2;ajax;default
 template=templates/prefs_d2_posting;ajax;default
+template=templates/prefs_messages;ajax;default
+template=templates/modal_footer;misc;default

Modified: slashjp/trunk/plugins/Ajax/htdocs/ajax.pl
===================================================================
--- slashjp/trunk/plugins/Ajax/htdocs/ajax.pl	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/htdocs/ajax.pl	2007-11-09 07:15:55 UTC (rev 247)
@@ -32,7 +32,7 @@
 		errorLog("No Ajax op '$op' found");
 		$op = 'default';
 	}
-	
+
 #	print STDERR "AJAX2 $$: $user->{uid}, $op\n";
 
 	$op = 'default' unless $ops->{$op}{function} || (
@@ -44,14 +44,14 @@
 
 	$ops->{$op}{function} ||= loadCoderef($ops->{$op}{class}, $ops->{$op}{subroutine});
 	$op = 'default' unless $ops->{$op}{function};
-	
+
 #	print STDERR "AJAX4 $$: $user->{uid}, $op\n";
 
 	$form->{op} = $op;  # save for others to use
 
 	my $reskey_name = $ops->{$op}{reskey_name} || 'ajax_base';
 	$ops->{$op}{reskey_type} ||= 'use';
-	
+
 #	print STDERR "AJAX5 $$: $user->{uid}, $op\n";
 
 	if ($reskey_name ne 'NA') {
@@ -212,7 +212,6 @@
 				}
 			}
 		}
-			
 	}
 
 
@@ -220,13 +219,13 @@
 		my $value = $update->{$tid};
 
 		# First remove tid in question from all arrays
-		@story_always_nexus 		= grep { $_ != $tid } @story_always_nexus; 
+		@story_always_nexus 		= grep { $_ != $tid } @story_always_nexus;
 		@story_full_brief_nexus 	= grep { $_ != $tid } @story_full_brief_nexus;
 		@story_brief_always_nexus 	= grep { $_ != $tid } @story_brief_always_nexus;
 		@story_full_best_nexus 		= grep { $_ != $tid } @story_full_best_nexus;
 		@story_brief_best_nexus 	= grep { $_ != $tid } @story_brief_best_nexus;
 		@story_never_nexus 		= grep { $_ != $tid } @story_never_nexus;
-			
+
 		# Then add it to the correct array
 		if ($value == 5) {
 			push @story_always_nexus, $tid;
@@ -249,7 +248,7 @@
 	my $story_full_best_nexus	= join ",", @story_full_best_nexus;
 	my $story_brief_best_nexus	= join ",", @story_brief_best_nexus;
 	my $story_never_nexus       	= join ",", @story_never_nexus;
-				
+
 	$slashdb->setUser($user->{uid}, {
 			story_always_nexus => $story_always_nexus,
 			story_full_brief_nexus => $story_full_brief_nexus,
@@ -502,23 +501,55 @@
 }
 
 sub getModalPrefs {
-        my($slashdb, $constants, $user, $form) = @_;
+	my($slashdb, $constants, $user, $form) = @_;
 
-        return slashDisplay('prefs_' . $form->{'section'},
-                {
-                user => $user,
-                },
-                { Return => 1 }
-        );
+	if ($form->{'section'} eq 'messages') {
+		my $messages  = getObject('Slash::Messages');
+		my $deliverymodes   = $messages->getDescriptions('deliverymodes');
+		my $messagecodes    = $messages->getDescriptions('messagecodes');
+		my $bvdeliverymodes = $messages->getDescriptions('bvdeliverymodes');
+		my $bvmessagecodes  = $messages->getDescriptions('bvmessagecodes_slev');
+
+		foreach my $bvmessagecode (keys %$bvmessagecodes) {
+			$bvmessagecodes->{$bvmessagecode}->{'valid_bvdeliverymodes'} = [];
+			foreach my $bvdeliverymode (keys %$bvdeliverymodes) {
+				# skip if we have no valid delivery modes (i.e. off)
+				if (!$bvmessagecodes->{$bvmessagecode}->{'delivery_bvalue'}) {
+					delete $bvmessagecodes->{$bvmessagecode};
+					last;
+				}
+			}
+		}
+
+		my $prefs = $messages->getPrefs($user->{'uid'});
+		return
+			slashDisplay('prefs_messages', {
+				userm           => $user,
+				prefs           => $prefs,
+				messagecodes    => $messagecodes,
+				deliverymodes   => $deliverymodes,
+				bvmessagecodes  => $bvmessagecodes,
+				bvdeliverymodes => $bvdeliverymodes
+			},
+			{ Return => 1 }
+		);
+	} else {
+		return
+			slashDisplay('prefs_' . $form->{'section'}, {
+				user => $user,
+			},
+			{ Return => 1 }
+		);
+	}
 }
 
 sub saveModalPrefs {
-        my($slashdb, $constants, $user, $form) = @_;
+	my($slashdb, $constants, $user, $form) = @_;
 
-        # Ajax returns our form as key=value, so trick URI into decoding for us.
-        use URI;
-        my $url = URI->new('//e.a/?' . $form->{'data'});
-        my %params = $url->query_form;
+	# Ajax returns our form as key=value, so trick URI into decoding for us.
+	require URI;
+	my $url = URI->new('//e.a/?' . $form->{'data'});
+	my %params = $url->query_form;
 
 	# Specific to D2 display and posting prefs for the time being.
 	my $user_edits_table;
@@ -531,11 +562,13 @@
 			noscores          => ($params{'noscores'}            ? 1 : 0),
 			domaintags        => ($params{'domaintags'} != 2     ? $params{'domaintags'} : undef),
 			m2_with_comm_mod  => ($params{'m2_with_mod_on_comm'} ? 1 : undef),
-		}
+		};
 	}
-	else {
+
+	if ($params{'formname'} eq 'd2_posting') {
 		my $karma_bonus      = ($params{'karma_bonus'}      !~ /^[\-+]?\d+$/) ? "+1" : $params{'karma_bonus'};
 		my $subscriber_bonus = ($params{'subscriber_bonus'} !~ /^[\-+]?\d+$/) ? "+1" : $params{'subscriber_bonus'};
+
 		$user_edits_table = {
 			emaildisplay      => $params{'emaildisplay'} || undef,
 			karma_bonus       => ($karma_bonus ne '+1' ? $karma_bonus : undef),
@@ -551,8 +584,30 @@
 			no_spell          => ($params{'no_spell'} ? 1 : undef),
 		};
 	}
-	
-        $slashdb->setUser($params{uid}, $user_edits_table);
+
+	if ($params{'formname'} eq 'messages') {
+		my $messages  = getObject('Slash::Messages');
+		my $messagecodes = $messages->getDescriptions('messagecodes');
+		my %message_prefs;
+
+		for my $code (keys %$messagecodes) {
+			my $coderef = $messages->getMessageCode($code);
+			if ((!exists($params{"deliverymodes_$code"})) ||
+			    (!$messages->checkMessageUser($code, $slashdb->getUser($params{uid})))) {
+				$message_prefs{$code} = -1;
+			} else {
+				$message_prefs{$code} = fixint($params{"deliverymodes_$code"});
+			}
+		}
+
+		$messages->setPrefs($params{uid}, \%message_prefs);
+
+		$user_edits_table = {
+			message_threshold => $params{'message_threshold'},
+		};
+	}
+
+	$slashdb->setUser($params{uid}, $user_edits_table);
 }
 
 # comments
@@ -623,18 +678,18 @@
 #			function        => \&tagsCreateForStory,
 #			reskey_type     => 'createuse',
 #		},
-                getModalPrefs           => {
-                        function        => \&getModalPrefs,
-                        reskey_name     => 'ajax_user_static',
-                        reskey_type     => 'createuse',
-                },
-                saveModalPrefs          => {
-                        function        => \&saveModalPrefs,
-                        reskey_name     => 'ajax_user_static',
-                        reskey_type     => 'createuse',
-                },
+		getModalPrefs           => {
+			function        => \&getModalPrefs,
+			reskey_name     => 'ajax_user_static',
+			reskey_type     => 'createuse',
+		},
+		saveModalPrefs          => {
+			function        => \&saveModalPrefs,
+			reskey_name     => 'ajax_user_static',
+			reskey_type     => 'createuse',
+		},
 		default	=> {
-			function        => \&default,		
+			function        => \&default,
 		},
 	);
 

Modified: slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -34,4 +34,4 @@
 __seclev__
 10000
 __version__
-$Id: datewidget;misc;default,v 1.7 2007/05/16 19:01:42 scc Exp $
+$Id$


Property changes on: slashjp/trunk/plugins/Ajax/templates/datewidget;misc;default
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Added: slashjp/trunk/plugins/Ajax/templates/modal_footer;misc;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/modal_footer;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/templates/modal_footer;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -0,0 +1,23 @@
+__section__
+default
+__description__
+__title__
+
+__page__
+misc
+__lang__
+en_US
+__name__
+modal_footer
+__template__
+<div id="modal_cover" style="display:none" onclick="hide_modal_box()"></div>
+<div id="modal_box" style="display:none">
+        <div class="generaltitle" >
+                <div class="title"><h3><div id="preference_title"></div> <a href="#" onclick="hide_modal_box(); return false"><img src="[% gSkin.imagedir %]/images/sic_close.png" alt="Close"></a></h3></div>
+        </div>
+        <div id="modal_box_content"></div>
+</div>
+__seclev__
+500
+__version__
+$Id$


Property changes on: slashjp/trunk/plugins/Ajax/templates/modal_footer;misc;default
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Modified: slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -13,15 +13,21 @@
 
 <form id ="modal_prefs" method="post">
 
-<input type="hidden" name="formname"  value="editcomm">
-<input type="hidden" name="op" value="savecomm">
+<input type="hidden" name="formname" value="d2_display">
 <input type="hidden" name="uid" value="[% user.uid %]">
+<input type="hidden" name="refreshable" value="">
 
 <table width="100%">
 	<tr>
 	<td valign="middle">
-                &nbsp;<p>
+		[% d2_check = '';
+		IF user.discussion2 == 'slashdot';
+			d2_check = constants.markup_checked_attribute;
+		END %]
+		<label><input type="checkbox" name="discussion2"[% d2_check %] onclick="javascript:void(document.forms['modal_prefs'].refreshable.value=document.URL);">&nbsp;Enable Dynamic Discussions</label>
 
+		&nbsp;<p>
+
 		[% IF user.discussion2 && user.discussion2 == "slashdot" %]
                 	<blockquote>
 			<div>
@@ -85,4 +91,4 @@
 __seclev__
 500
 __version__
-$Id: prefs_d2;ajax;default,v 1.5 2007/10/16 22:31:22 pudge Exp $
+$Id$


Property changes on: slashjp/trunk/plugins/Ajax/templates/prefs_d2;ajax;default
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Modified: slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -137,4 +137,4 @@
 __seclev__
 500
 __version__
-$Id: $
+$Id$


Property changes on: slashjp/trunk/plugins/Ajax/templates/prefs_d2_posting;ajax;default
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Added: slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -0,0 +1,99 @@
+__section__
+default
+__description__
+* messagecodes   = hashref of message codes
+* displaymodes   = hashref of delivery modes
+__title__
+
+__page__
+ajax
+__lang__
+en_US
+__name__
+prefs_messages
+__template__
+<div id="users-blocks">
+	<div class="generalbody">
+		[%
+		   usernick = user.nickname | strip_literal;
+
+		   modenone = Slash.MSG_MODE_NONE;
+		   modemail = Slash.MSG_MODE_EMAIL;
+		   modeweb  = Slash.MSG_MODE_WEB;
+		%]
+
+		From this page you can configure various messages that [% constants.sitename %] can optionally send to you. The primary options are [% deliverymodes.$modenone %] (Disabled), [% deliverymodes.$modemail %], [% deliverymodes.$modeweb %], [% IF constants.im_screenname %]AIM,[% END %] and Mobile Text. Not all options are available for all message types.  [% deliverymodes.$modeweb %] messages <b>will be deleted</b> after <b>[% constants.message_web_expire || 31 %] days</b>.[% IF constants.im_screenname %] If you plan on receiving AIM messages, please add [% constants.im_screenname %] to your buddylist.[% END %]
+
+	&nbsp;<p>
+
+	<form id ="modal_prefs" method="post">
+	[%
+	messages = Slash.getObject('Slash::Messages');
+	%]
+	<table cellspacing="10">
+	[%
+	FOREACH type = bvmessagecodes.keys.sort;
+		code = bvmessagecodes.$type.code;
+		UNLESS messages.checkMessageUser(code, user) && bvmessagecodes.$type.seclev < 100;
+			NEXT;
+		END
+	%]
+		<tr>
+		<td><b>[% type %]</td></b>
+		<td><select name="deliverymodes_[% code %]">
+		[% FOREACH valid_code = bvmessagecodes.$type.valid_bvdeliverymodes.sort %]
+			<option value="[% valid_code %]"[% IF prefs.${code} == valid_code %] selected[% END %]>[% bvdeliverymodes.$valid_code.name %]</option>
+		[% END %]
+		</select>
+		</td>
+		[% IF type == 'Comment Reply' %]
+			<tr>
+			<td style="padding-left: 15px;">
+			[% thresh = user.message_threshold.defined ? user.message_threshold : constants.message_threshold;
+			Slash.createSelect('message_threshold', Slash.db.getDescriptions('threshcodes'), thresh, 1) %]
+			</td>
+			<td style="padding-left: 15px;">
+			<b>Minimum Threshold</b>
+			</td>
+			</tr>
+		[% END %]
+		</tr>
+	[% END %]
+	</table>
+
+	[% IF user.seclev >= 100 %]
+		<h3>Admin Options</h3>
+
+		<table cellspacing="10">
+        	[%
+        	FOREACH type = bvmessagecodes.keys.sort;
+                	code = bvmessagecodes.$type.code;
+                	UNLESS messages.checkMessageUser(code, user) && bvmessagecodes.$type.seclev >= 100;
+                        	NEXT;
+                	END
+        	%]
+                	<tr>
+                	<td><b>[% type %]</td></b>
+                	<td><select name="deliverymodes_[% code %]">
+                	[% FOREACH valid_code = bvmessagecodes.$type.valid_bvdeliverymodes.sort %]
+                        	<option value="[% valid_code %]"[% IF prefs.${code} == valid_code %] selected[% END %]>[% bvdeliverymodes.$valid_code.name %]</option>
+                	[% END %]
+                	</select>
+                	</td>
+                	</tr>
+        	[% END %]
+        	</table>
+	[% END %]
+
+	&nbsp;<p>
+
+	<input type="hidden" name="uid" value="[% user.uid %]">
+	<input type="hidden" name="formname" value="messages">
+	<input type="button" value="Save" onclick="saveModalPrefs()">
+	</form>
+	</div>
+</div>
+__seclev__
+500
+__version__
+$Id$


Property changes on: slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Modified: slashjp/trunk/plugins/Bookmark/bookmark.pl
===================================================================
--- slashjp/trunk/plugins/Bookmark/bookmark.pl	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Bookmark/bookmark.pl	2007-11-09 07:15:55 UTC (rev 247)
@@ -110,8 +110,8 @@
 		url_id 		=> $url_id,
 		uid    		=> $user->{uid},
 		title		=> strip_notags($form->{title}),
-		srcid_32	=> get_srcid_sql_in($user->{srcids}{32}),
-		srcid_24	=> get_srcid_sql_in($user->{srcids}{24}),
+		-srcid_32	=> get_srcid_sql_in($user->{srcids}{32}),
+		-srcid_24	=> get_srcid_sql_in($user->{srcids}{24}),
 	};
 
 	my $bookmark_id;

Modified: slashjp/trunk/plugins/Email/email.pl
===================================================================
--- slashjp/trunk/plugins/Email/email.pl	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Email/email.pl	2007-11-09 07:15:55 UTC (rev 247)
@@ -178,7 +178,7 @@
 	}
 
 	# XXXSRCID might want to do this on a reader db
-	if ($slashdb->checkAL2($user->{srcids}, 'nopost')) {
+	if ($slashdb->checkAL2($user->{srcids}, [qw( nopost spammer )])) {
 		print getData('readonly');
 		return;
 	}

Modified: slashjp/trunk/plugins/FireHose/mysql_dump.sql
===================================================================
--- slashjp/trunk/plugins/FireHose/mysql_dump.sql	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/FireHose/mysql_dump.sql	2007-11-09 07:15:55 UTC (rev 247)
@@ -27,6 +27,7 @@
 INSERT INTO vars (name, value, description) VALUES ('firehose_story_ignore_skids', '', 'list of skids that you want to not want created or shown as firehose entries.  Delimit skids with |');
 INSERT INTO vars (name, value, description) VALUES ('firehose_color_slices', '30|30|0.2|0.2|0.2|0.2|0.2|0.0', 'Number or percent of remaining stories at each color level separated by | 30|0.5|0.5 would mean 30 stories at the level of highest popularity and 50% at each of remainining stories at the next 2 levels');
 INSERT INTO vars (name, value, description) VALUES ('firehose_slice_points', '290,240 220,200 185,175 155,138 102,93 30,25 0,-20 -60,-999999', 'Seven pairs of numbers: the entry score and minimum score for each color slice (last min should be large negative)');
+INSERT INTO vars (name, value, description) VALUES ('firehose_spam_score', '-50', 'Popularity score assigned to all firehose items with is_spam=yes');
 INSERT INTO vars (name, value, description) VALUES ('firehose_color_labels', 'red|orange|yellow|green|blue|purple|violet|black', 'Firehose color labels');
 INSERT INTO vars (name, value, description) VALUES ('firehose_anonval_param', '', 'String needed to be passed in anonval form param to validate requests, set to a string to enforce this validation');
 

Modified: slashjp/trunk/plugins/FireHose/mysql_schema.sql
===================================================================
--- slashjp/trunk/plugins/FireHose/mysql_schema.sql	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/FireHose/mysql_schema.sql	2007-11-09 07:15:55 UTC (rev 247)
@@ -10,13 +10,13 @@
 	type ENUM("submission","journal","bookmark","feed","story","vendor","misc") default 'submission',
 	createtime datetime NOT NULL default '0000-00-00 00:00:00',
 	popularity float NOT NULL default '0',
-	popularity2 float NOT NULL default '0',
 	editorpop float NOT NULL default '0',
 	activity float NOT NULL default '0',
 	accepted enum('no','yes') default 'no',
 	rejected enum('no','yes') default 'no',
 	public enum('no','yes') default 'no',
 	attention_needed enum('no','yes') default 'no',
+	is_spam enum('no', 'yes') default 'no',
 	primaryskid smallint(5) default '0',
 	tid smallint(6) default '0',
 	srcid mediumint(8) unsigned NOT NULL default '0',
@@ -40,8 +40,7 @@
 	PRIMARY KEY (id),
 	UNIQUE globjid (globjid),
 	KEY createtime (createtime),
-	KEY popularity (popularity),
-	KEY popularity2 (popularity2)
+	KEY popularity (popularity)
 ) TYPE=InnoDB;
 
 # The table giving an Object's Generally Accepted Story Publication Time

Modified: slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -32,7 +32,6 @@
     	story = Slash.db.getStory(item.srcid);
 	future = story.is_future;
     END;
-
     IF mode == "fulltitle";
     	IF !bodycontent_include;
 	    	bodycontent = 0;
@@ -48,7 +47,6 @@
     IF nostorylinkwrapper;
         storylinkwrapper = 0;
     END;
-    adminmode = 0;
     IF user.is_admin;
     	adminmode = 1;
         IF options.firehose_usermode.defined;
@@ -60,6 +58,7 @@
 	END;
     END;
 %]
+[% hasimage = item.tid || (item.thumb && item.type == "story") || (adminmode && item.type == "submission") %]
 [% IF item.url_id;
 	url = Slash.db.getUrl(item.url_id);
 END %]
@@ -75,7 +74,6 @@
 	[% IF bodywrapper;
 		Slash.getData('byline', { adminmode => adminmode, item => item, the_user => the_user }, 'firehose');
 	%]
-	[% hasimage = item.tid || (item.thumb && item.type == "story") || (adminmode && item.type == "submission") %]
 	<div class="[% IF bodycontent && mode == "fulltitle" %]hide[% ELSIF bodycontent %]body[% ELSE %]empty[% END %]" id="fhbody-[% item.id %]"  [% IF !hasimage  %]style="min-height: auto !important; "[% END %]>
 	[% END %]
 		[% IF hasimage %]

Modified: slashjp/trunk/plugins/FireHose/templates/fhadvprefpane;misc;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/fhadvprefpane;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/FireHose/templates/fhadvprefpane;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -79,7 +79,7 @@
 </tr>
 <tr>
 	<td>
-		[% IF options.orderby == "popularity" || options.orderby == "editorpop" || options.orderby == "popularity2" %]
+		[% IF options.orderby == "popularity" || options.orderby == "editorpop" %]
 			<span id="advpopularity" onclick="firehose_set_options('orderby','createtime')"><a href="#">Popularity</a></span>
 		[% ELSE  %]
 			<span id="advtime" onclick="firehose_set_options('orderby','popularity')"><a href="#">Time</a></span>

Modified: slashjp/trunk/plugins/FireHose/templates/firehose_options;misc;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/firehose_options;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/FireHose/templates/firehose_options;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -28,7 +28,7 @@
 	<span id="play"[% IF !paused %] class="hide"[% END %]><a href="#" onclick="firehose_play(); return false" title="Currently paused">Play</a></span>
 	<span id="pause" [% IF paused %] class="hide"[% END %]><a href="#" onclick="firehose_pause(); return false" title="Currently playing">Pause</a></span>
 
-	[% IF options.orderby == "popularity" || options.orderby == "editorpop" || options.orderby == "popularity2" %]
+	[% IF options.orderby == "popularity" || options.orderby == "editorpop" %]
 	<span id="popularity"><a href="[% gSkin.rootdir %]/firehose.pl?orderby=createtime" title="Toggle sort popularity/time - Currently popularity" onclick="firehose_set_options('orderby','createtime'); return false;">Popularity</a></span>
 	[% ELSE %]
 	<span id="time"><a href="[% gSkin.rootdir %]/firehose.pl?orderby=popularity" title="Toggle sort popularity/time - Currently Time" onclick="firehose_set_options('orderby','popularity'); return false;">Time</a></span>

Modified: slashjp/trunk/plugins/Journal/Journal.pm
===================================================================
--- slashjp/trunk/plugins/Journal/Journal.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Journal/Journal.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -199,8 +199,8 @@
 		-date		=> 'NOW()',
 		posttype	=> $posttype,
 		promotetype	=> $promotetype,
-		srcid_24	=> get_srcid_sql_in($user->{srcids}{24}),
-		srcid_32	=> get_srcid_sql_in($user->{srcids}{32}),
+		-srcid_24	=> get_srcid_sql_in($user->{srcids}{24}),
+		-srcid_32	=> get_srcid_sql_in($user->{srcids}{32}),
 	});
 
 	my($id) = $self->getLastInsertId({ table => 'journals', prime => 'id' });

Modified: slashjp/trunk/plugins/Messages/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/plugins/Messages/DB/MySQL/MySQL.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Messages/DB/MySQL/MySQL.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -42,6 +42,8 @@
 		=> sub { $_[0]->sqlSelectAllHashref('code', 'code,name,bitvalue', 'message_deliverymodes') },
 	'bvmessagecodes'
 		=> sub { $_[0]->sqlSelectAllHashref('type', 'code,type,delivery_bvalue', 'message_codes', "code >= 0") },
+        'bvmessagecodes_slev'
+                => sub { $_[0]->sqlSelectAllHashref('type', 'code,type,seclev,delivery_bvalue', 'message_codes', "code >= 0") },
 );
 
 sub getDescriptions {

Modified: slashjp/trunk/plugins/Messages/PLUGIN
===================================================================
--- slashjp/trunk/plugins/Messages/PLUGIN	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Messages/PLUGIN	2007-11-09 07:15:55 UTC (rev 247)
@@ -14,7 +14,7 @@
 template=templates/data;messages;default
 template=templates/display;messages;default
 template=templates/display_prefs;messages;default
-template=templates/edit;messages;default
+#template=templates/edit;messages;default
 template=templates/emailsponsor;messages;default
 template=templates/footer;messages;default
 template=templates/html_invalid;misc;default

Modified: slashjp/trunk/plugins/Tags/Tags.pm
===================================================================
--- slashjp/trunk/plugins/Tags/Tags.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/plugins/Tags/Tags.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -1567,7 +1567,7 @@
 }
 
 sub listTagnamesRecent {
-	my($self, $options) = @_;
+	my($self, $clout_type, $options) = @_;
 	my $constants = getCurrentStatic();
 	my $seconds =         $options->{seconds}         || (3600*6);
 	my $include_private = $options->{include_private} || 0;

Modified: slashjp/trunk/sql/mysql/defaults.sql
===================================================================
--- slashjp/trunk/sql/mysql/defaults.sql	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/sql/mysql/defaults.sql	2007-11-09 07:15:55 UTC (rev 247)
@@ -831,7 +831,7 @@
 INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats_lastid', '0', 'accesslogid to start searching at');
 INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats_weeks', '8', 'number of weeks back to compare current stats to');
 INSERT INTO vars (name, value, description) VALUES ('currentqid',1,'The Current Question on the homepage pollbooth');
-INSERT INTO vars (name, value, description) VALUES ('cvs_tag_currentcode','T_2_5_0_182','The current cvs tag that the code was updated to - this does not affect site behavior but may be useful for your records');
+INSERT INTO vars (name, value, description) VALUES ('cvs_tag_currentcode','T_2_5_0_183','The current cvs tag that the code was updated to - this does not affect site behavior but may be useful for your records');
 INSERT INTO vars (name, value, description) VALUES ('datadir','/usr/local/slash/www.example.com','What is the root of the install for Slash');
 INSERT INTO vars (name, value, description) VALUES ('db_auto_increment_increment','1','If your master DB uses auto_increment_increment, i.e. multiple master replication, echo its value into this var');
 INSERT INTO vars (name, value, description) VALUES ('dbsparklines_disp','0','Display dbsparklines in the currentAdminUsers box?');

Modified: slashjp/trunk/sql/mysql/upgrades
===================================================================
--- slashjp/trunk/sql/mysql/upgrades	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/sql/mysql/upgrades	2007-11-09 07:15:55 UTC (rev 247)
@@ -4867,13 +4867,16 @@
 DELETE FROM vars WHERE name='firehose_userpop_col';
 UPDATE firehose SET popularity=popularity2;
 ALTER TABLE firehose DROP COLUMN popularity2;
-INSERT INTO clout_types (clid, name, class) VALUES (1, 'describe', 'Slash::Clout::Describe');
-INSERT INTO clout_types (clid, name, class) VALUES (2, 'vote',     'Slash::Clout::Vote');
-INSERT INTO clout_types (clid, name, class) VALUES (3, 'moderate', 'Slash::Clout::Moderate');
+
+# For plugins/Tags
 INSERT INTO users_clout (clout_id, uid, clid, clout) SELECT NULL, uid, 1, value+0 FROM users_param WHERE name='tagpeerval';
 INSERT INTO users_clout (clout_id, uid, clid, clout) SELECT NULL, uid, 2, value+0 FROM users_param WHERE name='tagpeerval2';
 DELETE FROM users_param WHERE name IN ('tagpeerval', 'tagpeerval2');
 
+INSERT INTO clout_types (clid, name, class) VALUES (1, 'describe', 'Slash::Clout::Describe');
+INSERT INTO clout_types (clid, name, class) VALUES (2, 'vote',     'Slash::Clout::Vote');
+INSERT INTO clout_types (clid, name, class) VALUES (3, 'moderate', 'Slash::Clout::Moderate');
+
 # 2007-09-26
 UPDATE vars SET value = 'T_2_5_0_176' WHERE name = 'cvs_tag_currentcode';
 
@@ -4994,11 +4997,44 @@
 # For tagboxes/Top
 INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_top_excludetagnames', 'yes no binspam dupe notthebest offtopic stupid slownewsday interesting funny insightful', 'Minimum score a tag must have to make it into the top tags for a story or firehose item');
 
-
 # 2007-11-01
 UPDATE vars SET value = 'T_2_5_0_182' WHERE name = 'cvs_tag_currentcode';
 
+# SLASHDOT LAST UPDATED HERE
+
+# for plugins/Falk
+ALTER TABLE ad_settings ADD COLUMN always TINYINT UNSIGNED NOT NULL DEFAULT 0;
+
+# don't remove this if you want it ... but remove it if you don't!
+# 18 = "Invalid HTML Input" (see the Messages dump to add back)
+DELETE FROM message_codes WHERE code = 18;
+
 # SLASHCODE/USEPERL LAST UPDATED HERE
 
-# SLASHDOT LAST UPDATED HERE
+# Redundant for many sites, but this is here because an earlier error
+# in the upgrades file may have left your site without them if you
+# didn't have the FireHose plugin installed.
+INSERT IGNORE INTO clout_types (clid, name, class) VALUES (1, 'describe', 'Slash::Clout::Describe');
+INSERT IGNORE INTO clout_types (clid, name, class) VALUES (2, 'vote',     'Slash::Clout::Vote');
+INSERT IGNORE INTO clout_types (clid, name, class) VALUES (3, 'moderate', 'Slash::Clout::Moderate');
 
+# For plugins/Tags
+# Also redundant, but if you have Tags and no FireHose you may
+# need this.
+INSERT IGNORE INTO users_clout (clout_id, uid, clid, clout) SELECT NULL, uid, 1, value+0 FROM users_param WHERE name='tagpeerval';
+INSERT IGNORE INTO users_clout (clout_id, uid, clid, clout) SELECT NULL, uid, 2, value+0 FROM users_param WHERE name='tagpeerval2';
+DELETE FROM users_param WHERE name IN ('tagpeerval', 'tagpeerval2');
+
+# for plugins/FireHose
+ALTER TABLE firehose ADD COLUMN is_spam enum('no', 'yes') DEFAULT 'no' AFTER attention_needed;
+# This may throw an error but that's OK - just fixing an earlier bug
+# in this upgrades file
+ALTER TABLE firehose DROP COLUMN popularity2;
+
+# for tagboxes/Despam
+INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_binspamsallowed_ip', '3', 'Number of binspam tags allowed before action is taken for an IP');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_decloutdaysback', '7', 'Number of days to look back to declout upvoters');
+
+# 2007-11-08
+UPDATE vars SET value = 'T_2_5_0_183' WHERE name = 'cvs_tag_currentcode';
+

Modified: slashjp/trunk/tagboxes/Despam/Despam.pm
===================================================================
--- slashjp/trunk/tagboxes/Despam/Despam.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/tagboxes/Despam/Despam.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -135,13 +135,8 @@
 	my $tagsdb = getObject('Slash::Tags');
 	my $tagboxdb = getObject('Slash::Tagbox');
 	my $firehose_db = getObject('Slash::FireHose');
+	my $slashdb = getCurrentDB();
 
-	my $affected_id_q = $self->sqlQuote($affected_id);
-	my $fhid = $self->sqlSelect('id', 'firehose', "globjid = $affected_id_q");
-	warn "Slash::Tagbox::Despam->run bad data, fhid='$fhid' db='$firehose_db'" if !$fhid || !$firehose_db;
-	my $fhitem = $firehose_db->getFireHose($fhid);
-	my $submitter_uid = $fhitem->{uid};
-
 	my $admins = $tagsdb->getAdmins();
 	my $admin_in_str = join(',',
 		sort { $a <=> $b }
@@ -149,21 +144,63 @@
 		keys %$admins);
 	return unless $admin_in_str;
 
-	my $slashdb = getCurrentStatic();
-	my $binspam_count = $slashdb->sqlCount(
-		'tags, firehose',
-		"tags.uid IN ($admin_in_str)
-		 AND tags.inactivated IS NULL
-		 AND tags.tagnameid = $self->{spamid}
-		 AND tags.globjid = firehose.globjid
-		 AND firehose.uid = $submitter_uid");
-	if ($binspam_count > $constants->{tagbox_despam_binspamsallowed}) {
-		main::tagboxLog(sprintf("%s->run marking uid %d for %d admin binspam tags, latest %d (%d)",
-			ref($self), $submitter_uid, $binspam_count, $fhid, $affected_id));
-		$self->despam_uid($submitter_uid, $binspam_count);
+	my $affected_id_q = $self->sqlQuote($affected_id);
+	my $fhid = $self->sqlSelect('id', 'firehose', "globjid = $affected_id_q");
+	warn "Slash::Tagbox::Despam->run bad data, fhid='$fhid' db='$firehose_db'" if !$fhid || !$firehose_db;
+	my $fhitem = $firehose_db->getFireHose($fhid);
+	my $submitter_uid = $fhitem->{uid};
+	my $submitter_srcid = $fhitem->{srcid_32};
+
+	main::tagboxLog(sprintf("%s->run marking fhid %d as is_spam", ref($self), $fhid));
+	$slashdb->sqlUpdate('firehose', { is_spam => 'yes' }, "id=$fhid");
+
+	if (isAnon($submitter_uid)) {
+		# Non-logged-in user, check by IP (srcid_32)
+		if ($submitter_srcid) {
+			my $binspam_count = $slashdb->sqlCount(
+				'tags, firehose',
+				"tags.uid IN ($admin_in_str)
+				 AND tags.inactivated IS NULL
+				 AND tags.tagnameid = $self->{spamid}
+				 AND tags.globjid = firehose.globjid
+				 AND firehose.srcid_32 = $submitter_srcid");
+			if ($binspam_count > $constants->{tagbox_despam_binspamsallowed_ip}) {
+				main::tagboxLog(sprintf("%s->run marking srcid %s for %d admin binspam tags, based on %d (%d)",
+				ref($self), $submitter_srcid, $binspam_count, $fhid, $affected_id));
+				$self->despam_srcid($fhitem, $binspam_count);
+			}
+		}
+	} else {
+		# Logged-in user, check by uid
+		my $binspam_count = $slashdb->sqlCount(
+			'tags, firehose',
+			"tags.uid IN ($admin_in_str)
+			 AND tags.inactivated IS NULL
+			 AND tags.tagnameid = $self->{spamid}
+			 AND tags.globjid = firehose.globjid
+			 AND firehose.uid = $submitter_uid");
+		if ($binspam_count > $constants->{tagbox_despam_binspamsallowed}) {
+			main::tagboxLog(sprintf("%s->run marking uid %d for %d admin binspam tags, based on %d (%d)",
+				ref($self), $submitter_uid, $binspam_count, $fhid, $affected_id));
+			$self->despam_uid($fhitem, $binspam_count);
+		}
 	}
 }
 
+sub despam_srcid {
+	my($self, $srcid, $count) = @_;
+	my $slashdb = getCurrentDB();
+	my $constants = getCurrentStatic();
+
+	my $al2_hr = $slashdb->getAL2($srcid);
+	if ($count > $constants->{tagbox_despam_binspamsallowed_ip}) {
+		main::tagboxLog("marking $srcid as spammer for $count");
+		if (!$al2_hr->{spammer}) {
+			$slashdb->setAL2($srcid, { spammer => 1, comment => "Despam $count" });
+		}
+	}
+}
+
 sub despam_uid {
 	my($self, $uid, $count) = @_;
 	my $constants = getCurrentStatic();
@@ -172,49 +209,59 @@
 	my $tagboxdb = getObject('Slash::Tagbox');
 
 	# First, set the user's 'spammer' AL2.
-	$slashdb->setAL2($uid, { spammer => 1, comment => "Despam $count" });
+	my $adminuid = $constants->{tagbox_despam_al2adminuid};
+	my $al2_hr = $slashdb->getAL2($uid);
+	if (!$al2_hr->{spammer}) {
+		$slashdb->setAL2($uid, { spammer => 1, comment => "Despam $count" },
+			{ adminuid => $adminuid });
+	}
 
 	# Next, set the user's clout manually to 0.
 	$slashdb->setUser($uid, { tag_clout => 0 });
 
+        # Next, mark as spam everything the user's submitted.
+	$slashdb->sqlUpdate('firehose', { is_spam => 'yes' },
+		"accepted != 'no' AND uid=$uid");
+
 	# Next, if $count is high enough, set the 'spammer' AL2 for all
 	# the IPID's the user has submitted from.
-	my $days = defined($constants->{tagbox_despam_ipdayslookback})
-		? $constants->{tagbox_despam_ipdayslookback} : 60;
-	my %srcid_used = ( );
-	if ($days) {
-		my $sub_ipid_ar = $reader->sqlSelectColArrayref(
-			'DISTINCT ipid',
-			'submissions',
-			"uid=$uid AND time >= DATE_SUB(NOW(), INTERVAL $days DAY)");
-		my $journal_srcid_ar = $reader->sqlSelectColArrayref(
-			'DISTINCT ' . get_srcid_sql_out('srcid_32'),
-			'journals',
-			"uid=$uid AND date >= DATE_SUB(NOW(), INTERVAL $days DAY)");
-		my $book_srcid_ar = $reader->sqlSelectColArrayref(
-			'DISTINCT ' . get_srcid_sql_out('srcid_32'),
-			'bookmarks',
-			"uid=$uid AND time >= DATE_SUB(NOW(), INTERVAL $days DAY)");
-		for my $ipid (@$sub_ipid_ar) {
-			my $srcid = convert_srcid(ipid => $ipid);
-			$srcid_used{$srcid} = 1;
+	if ($count > $constants->{tagbox_despam_binspamsallowed_ip}) {
+		my $days = defined($constants->{tagbox_despam_ipdayslookback})
+			? $constants->{tagbox_despam_ipdayslookback} : 60;
+		my %srcid_used = ( );
+		if ($days) {
+			my $sub_ipid_ar = $reader->sqlSelectColArrayref(
+				'DISTINCT ipid',
+				'submissions',
+				"uid=$uid AND time >= DATE_SUB(NOW(), INTERVAL $days DAY) AND ipid != ''");
+			my $journal_srcid_ar = $reader->sqlSelectColArrayref(
+				'DISTINCT ' . get_srcid_sql_out('srcid_32'),
+				'journals',
+				"uid=$uid AND date >= DATE_SUB(NOW(), INTERVAL $days DAY) AND srcid_32 != 0");
+			my $book_srcid_ar = $reader->sqlSelectColArrayref(
+				'DISTINCT ' . get_srcid_sql_out('srcid_32'),
+				'bookmarks',
+				"uid=$uid AND createdtime >= DATE_SUB(NOW(), INTERVAL $days DAY) AND srcid_32 != 0");
+			for my $ipid (@$sub_ipid_ar) {
+				my $srcid = convert_srcid(ipid => $ipid);
+				$srcid_used{$srcid} = 1;
+			}
+			for my $srcid (@$journal_srcid_ar) {
+				$srcid_used{$srcid} = 1;
+			}
+			for my $srcid (@$book_srcid_ar) {
+				$srcid_used{$srcid} = 1;
+			}
+			my @srcids = sort grep { $_ } keys %srcid_used;
+			for my $srcid (@srcids) {
+				$al2_hr = $slashdb->getAL2($srcid);
+				if (!$al2_hr->{spammer}) {
+					$slashdb->setAL2($srcid, { spammer => 1, comment => "Despam $count for $uid" });
+				}
+			}
 		}
-		for my $srcid (@$journal_srcid_ar) {
-			$srcid_used{$srcid} = 1;
-		}
-		for my $srcid (@$book_srcid_ar) {
-			$srcid_used{$srcid} = 1;
-		}
-		my @srcids = sort keys %srcid_used;
-		for my $srcid (@srcids) {
-			$slashdb->setAL2($srcid, { spammer => 1, comment => "Despam $count" });
-		}
 	}
 
-	# Next, reject everything the user's submitted.
-	$slashdb->sqlUpdate('firehose', { rejected => 'yes' },
-		"accepted != 'no' AND uid=$uid");
-
 	# Next, declout everyone who's upvoted any of the user's
 	# recent submissions (except bookmarks, because those are
 	# generic enough).
@@ -230,7 +277,7 @@
 	my $max_clout = defined($constants->{tagbox_despam_upvotermaxclout})
 		? $constants->{tagbox_despam_upvotermaxclout} : '0.85';
 	for my $upvoter (@$upvoter_ar) {
-print STDERR "Despam setting user $upvoter clout to $max_clout\n";
+		main::tagboxLog("setting user $upvoter clout to max $max_clout for upvoting user $uid");
 		$slashdb->setUser($upvoter, {
 			-tag_clout => "MAX(tag_clout, $max_clout)"
 		});
@@ -257,7 +304,6 @@
 			});
 		}
 	}
-	sleep 10;
 }
 
 1;

Modified: slashjp/trunk/tagboxes/Despam/mysql_dump.sql
===================================================================
--- slashjp/trunk/tagboxes/Despam/mysql_dump.sql	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/tagboxes/Despam/mysql_dump.sql	2007-11-09 07:15:55 UTC (rev 247)
@@ -1,5 +1,8 @@
 # $Id: $
 INSERT INTO tagboxes (tbid, name, affected_type, clid, weight, last_run_completed, last_tagid_logged, last_tdid_logged, last_tuid_logged) VALUES (NULL, 'Despam', 'globj', 1, 1, '2000-01-01 00:00:00', 0, 0, 0);
 INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_binspamsallowed', '1', 'Number of binspam tags allowed before action is taken');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_binspamsallowed_ip', '3', 'Number of binspam tags allowed before action is taken for an IP');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_decloutdaysback', '7', 'Number of days to look back to declout upvoters');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_ipdayslookback', '60', 'Number of days to look back in tables to mark IPs, 0 disables IP marking');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_upvotermaxclout', '0.85', 'Maximum tag_clout for any user who upvotes a submission from a spammer user');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('tagbox_despam_al2adminuid', '1', 'Admin uid when setting AL2');

Modified: slashjp/trunk/tagboxes/FHEditorPop/FHEditorPop.pm
===================================================================
--- slashjp/trunk/tagboxes/FHEditorPop/FHEditorPop.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/tagboxes/FHEditorPop/FHEditorPop.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -145,6 +145,8 @@
 	my $tagboxdb = getObject('Slash::Tagbox');
 	my $firehose = getObject('Slash::FireHose');
 
+	my $fhitem = $firehose->getFireHose($affected_id);
+
 	# All firehose entries start out with popularity 1.
 	my $popularity = 1;
 
@@ -214,6 +216,14 @@
 		$popularity += $extra_pop;
 	}
 
+	# If this is spam, its score goes way down.
+	if ($fhitem->{is_spam} eq 'yes') {
+		my $max = defined($constants->{firehose_spam_score})
+			? $constants->{firehose_spam_score}
+			: -50;
+		$popularity = $max if $popularity > $max;
+	}
+
 	# Set the corresponding firehose row to have this popularity.
 	my $affected_id_q = $self->sqlQuote($affected_id);
 	my $fhid = $self->sqlSelect('id', 'firehose', "globjid = $affected_id_q");

Modified: slashjp/trunk/tagboxes/FireHoseScores/FireHoseScores.pm
===================================================================
--- slashjp/trunk/tagboxes/FireHoseScores/FireHoseScores.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/tagboxes/FireHoseScores/FireHoseScores.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -235,6 +235,14 @@
 		$popularity += $extra_pop;
 	}
 
+	# If this is spam, its score goes way down.
+	if ($fhitem->{is_spam} eq 'yes') {
+		my $max = defined($constants->{firehose_spam_score})
+			? $constants->{firehose_spam_score}
+			: -50;
+		$popularity = $max if $popularity > $max;
+	}
+
 	# Set the corresponding firehose row to have this popularity.
 	if ($options->{return_only}) {
 		return $popularity;

Modified: slashjp/trunk/tagboxes/Top/Top.pm
===================================================================
--- slashjp/trunk/tagboxes/Top/Top.pm	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/tagboxes/Top/Top.pm	2007-11-09 07:15:55 UTC (rev 247)
@@ -231,8 +231,8 @@
 				} keys %scores;
 			$#top = 4 if $#top > 4;
 			$firehose->setFireHose($fhid, { toptags => join(' ', @top) });
+			main::tagboxLog("Top->run $affected_id with " . scalar(@$tag_ar) . " tags, setFireHose $fhid to '@top' >= $minscore1");
 		}
-		main::tagboxLog("Top->run $affected_id with " . scalar(@$tag_ar) . " tags, setFireHose $fhid to '@top' >= $minscore1");
 	}
 
 	if ($type eq 'stories') {

Modified: slashjp/trunk/themes/slashcode/htdocs/images/comments.js
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/images/comments.js	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/themes/slashcode/htdocs/images/comments.js	2007-11-09 07:15:55 UTC (rev 247)
@@ -13,7 +13,8 @@
 var update_comments = {};
 var root_comments_hash = {};
 var last_updated_comments = [];
-var last_updated_comments_index = -1;
+var last_updated_comments_index = 0;
+var last_updated_comments_started = 0;
 var current_cid = 0;
 var more_comments_num;
 var behaviors = {
@@ -1037,6 +1038,8 @@
 			document.body.onkeydown = keyHandler;
 	}
 
+	setCurrentComment(last_updated_comments[i]);
+
 	if (more_comments_num)
 		updateMoreNum(more_comments_num);
 	updateTotals();
@@ -1699,41 +1702,42 @@
 		if (c) {
 			var key = String.fromCharCode(c);
 			if (key == 'J' || key == 'K' || key == 'W' || key == 'S') {
-				if (last_updated_comments.length) {
-					var i = last_updated_comments_index;
-					var l = last_updated_comments.length - 1;
-					var update = 0;
-					if (key == 'J' || key == 'S') {
+				var i = last_updated_comments_index;
+				var l = last_updated_comments.length - 1;
+				var update = 0;
+				if (key == 'J' || key == 'S') {
+					update = 1;
+					if (i <= 0) {
+						// this did go back to end; nothing, for now
+						//i = l;
+					} else
+						i = i - 1;
+				} else if (key == 'K' || key == 'W') {
+					if (i >= l) {
+						if (ajaxCommentsWait())
+							return;
+						update = 2;
+						ajaxFetchComments(0, 1, '', 1);
+					} else {
 						update = 1;
-						if (i <= 0) {
-							// this did go back to end; nothing, for now
-							//i = l;
-						} else
-							i = i - 1;
-					} else if (key == 'K' || key == 'W') {
-						if (i >= l) {
-							if (ajaxCommentsWait())
-								return;
-							update = 2;
-							ajaxFetchComments(0, 1, '', 1);
-						} else {
-							update = 1;
+						if (!i && !last_updated_comments_started && !commentIsInWindow(last_updated_comments[i]))
+							last_updated_comments_started = 1; // only come here once
+						else
 							i = i + 1;
-						}
 					}
+				}
 
-					if (update) {
-						doModifiers(e);
-						var this_shift_down = shift_down;
-						resetModifiers();
-						if (this_shift_down && current_cid) { // if shift, collapse previously selected
-							setFocusComment('-' + current_cid, 1);
-						}
-						if (update == 1) {
-							last_updated_comments_index = i;
-							setFocusComment(last_updated_comments[i], 1);
-						}
+				if (update) {
+					doModifiers(e);
+					var this_shift_down = shift_down;
+					resetModifiers();
+					if (this_shift_down && current_cid) { // if shift, collapse previously selected
+						setFocusComment('-' + current_cid, 1);
 					}
+					if (update == 1) {
+						last_updated_comments_index = i;
+						setFocusComment(last_updated_comments[i], 1);
+					}
 				}
 			}
 		}

Modified: slashjp/trunk/themes/slashcode/templates/edit_comment;comments;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/edit_comment;comments;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/themes/slashcode/templates/edit_comment;comments;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -256,13 +256,6 @@
 	</div>
 </div>
 
-<div id="modal_cover" style="display:none" onclick="hide_modal_box()"></div>
-<div id="modal_box" style="display:none">
-        <div class="generaltitle" >
-                <div class="title"><h3><div id="preference_title"></div> <a href="#" onclick="hide_modal_box(); return false"><img src="[% gSkin.imagedir %]/images/sic_close.png" alt="Close"></a></h3></div>
-        </div>
-        <div id="modal_box_content"></div>
-</div>
 __seclev__
 1000
 __version__

Modified: slashjp/trunk/themes/slashcode/templates/footer;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/footer;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/themes/slashcode/templates/footer;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -66,6 +66,7 @@
 			[% Slash.currentAdminUsers() %]
 		[% END %]
 	</div>
+[% INCLUDE modal_footer %]
 </body>
 </html>
 

Modified: slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -23,8 +23,13 @@
 	{ link = "/users.pl?op=edithome",	label = "Homepage",	sel_label = "home" },
 	{ link = "/users.pl?op=editcomm",	label = "Comments",	sel_label = "comments" }
 ];
-IF constants.plugin.Messages; tabs.push(
-	{ link = "/my/messages",		label = "Messages",	sel_label = "messages" },
+IF constants.plugin.Messages;
+        messages_link = "/my/messages";
+        IF constants.modal_prefs_active;
+                messages_link = messages_link _ "\" onclick=\"getModalPrefs('messages', 'Messages')\; return false";
+        END;
+        tabs.push(
+        { link = messages_link,                 label = "Messages",     sel_label = "messages" },
 ); END;
 IF constants.plugin.Journal; tabs.push(
 	{ link = "/journal.pl?op=editprefs",	label = "Journal",	sel_label = "journal" },

Modified: slashjp/trunk/themes/slashcode/templates/printCommentsMain;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/printCommentsMain;misc;default	2007-11-09 07:07:18 UTC (rev 246)
+++ slashjp/trunk/themes/slashcode/templates/printCommentsMain;misc;default	2007-11-09 07:15:55 UTC (rev 247)
@@ -291,14 +291,6 @@
 </div>
 <a name="topcomment"></a>
 
-<div id="modal_cover" style="display:none" onclick="hide_modal_box()"></div>
-<div id="modal_box" style="display:none">
-        <div class="generaltitle" >
-                <div class="title"><h3><div id="preference_title"></div> <a href="#" onclick="hide_modal_box(); return false"><img src="[% gSkin.imagedir %]/images/sic_close.png" alt="Close"></a></h3></div>
-        </div>
-        <div id="modal_box_content">Content here</div>
-</div>
-
 __seclev__
 10000
 __version__


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る