[Slashdotjp-dev 733] [244] merged from T_2_5_0_183

Zurück zum Archiv-Index

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


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

Log Message:
-----------
merged from T_2_5_0_183

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

Added Paths:
-----------
    slashjp/branches/upstream/current/plugins/Ajax/templates/modal_footer;misc;default
    slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_messages;ajax;default


-------------- next part --------------
Modified: slashjp/branches/upstream/current/Slash/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/branches/upstream/current/Slash/DB/MySQL/MySQL.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/Slash/DB/MySQL/MySQL.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: MySQL.pm,v 1.991 2007/11/01 20:35:18 jamiemccarthy Exp $
+# $Id: MySQL.pm,v 1.993 2007/11/07 23:15:22 jamiemccarthy Exp $
 
 package Slash::DB::MySQL;
 use strict;
@@ -20,7 +20,7 @@
 use base 'Slash::DB::Utility';
 use Slash::Constants ':messages';
 
-($VERSION) = ' $Revision: 1.991 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.993 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 # Fry: How can I live my life if I can't tell good from evil?
 
@@ -5075,11 +5075,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()';
 
@@ -12140,6 +12142,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};
@@ -12492,6 +12496,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/branches/upstream/current/Slash/Slash.pm
===================================================================
--- slashjp/branches/upstream/current/Slash/Slash.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/Slash/Slash.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Slash.pm,v 1.340 2007/11/01 19:32:23 jamiemccarthy Exp $
+# $Id: Slash.pm,v 1.341 2007/11/02 14:26:40 jamiemccarthy Exp $
 
 package Slash;
 
@@ -1629,7 +1629,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/branches/upstream/current/Slash/Utility/Display/Display.pm
===================================================================
--- slashjp/branches/upstream/current/Slash/Utility/Display/Display.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/Slash/Utility/Display/Display.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Display.pm,v 1.124 2007/10/23 23:20:15 pudge Exp $
+# $Id: Display.pm,v 1.125 2007/11/08 08:52:57 pudge Exp $
 
 package Slash::Utility::Display;
 
@@ -33,7 +33,7 @@
 use base 'Exporter';
 use vars qw($VERSION @EXPORT);
 
-($VERSION) = ' $Revision: 1.124 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.125 $ ' =~ /\$Revision:\s+([^\s]+)/;
 @EXPORT	   = qw(
 	cleanSlashTags
 	createMenu
@@ -1347,7 +1347,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";
@@ -1728,4 +1728,4 @@
 
 =head1 VERSION
 
-$Id: Display.pm,v 1.124 2007/10/23 23:20:15 pudge Exp $
+$Id: Display.pm,v 1.125 2007/11/08 08:52:57 pudge Exp $

Modified: slashjp/branches/upstream/current/plugins/Admin/admin.pl
===================================================================
--- slashjp/branches/upstream/current/plugins/Admin/admin.pl	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Admin/admin.pl	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: admin.pl,v 1.324 2007/10/30 20:21:09 tvroom Exp $
+# $Id: admin.pl,v 1.326 2007/11/08 08:54:00 pudge Exp $
 
 use strict;
 use File::Temp 'tempfile';
@@ -1241,6 +1241,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;
@@ -1517,7 +1522,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/branches/upstream/current/plugins/Admin/templates/editStory;admin;default
===================================================================
--- slashjp/branches/upstream/current/plugins/Admin/templates/editStory;admin;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Admin/templates/editStory;admin;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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 %]
 
@@ -308,4 +315,4 @@
 __seclev__
 10000
 __version__
-$Id: editStory;admin;default,v 1.79 2007/10/30 20:21:09 tvroom Exp $
+$Id: editStory;admin;default,v 1.80 2007/11/07 16:35:37 tvroom Exp $

Modified: slashjp/branches/upstream/current/plugins/Ajax/PLUGIN
===================================================================
--- slashjp/branches/upstream/current/plugins/Ajax/PLUGIN	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Ajax/PLUGIN	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.28 2007/11/02 03:13:51 entweichen Exp $
+# $Id: PLUGIN,v 1.29 2007/11/07 17:55:37 entweichen Exp $
 name=Ajax
 description="Ajax (Asynchronous Javascript and XML)"
 mysql_dump=mysql_dump.sql
@@ -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/branches/upstream/current/plugins/Ajax/htdocs/ajax.pl
===================================================================
--- slashjp/branches/upstream/current/plugins/Ajax/htdocs/ajax.pl	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Ajax/htdocs/ajax.pl	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: ajax.pl,v 1.59 2007/10/31 19:54:17 entweichen Exp $
+# $Id: ajax.pl,v 1.61 2007/11/08 08:53:55 pudge Exp $
 
 use strict;
 use warnings;
@@ -14,7 +14,7 @@
 use Slash::Utility;
 use vars qw($VERSION);
 
-($VERSION) = ' $Revision: 1.59 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.61 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 ##################################################################
 sub main {
@@ -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,
 		},
 	);
 

Added: slashjp/branches/upstream/current/plugins/Ajax/templates/modal_footer;misc;default
===================================================================
--- slashjp/branches/upstream/current/plugins/Ajax/templates/modal_footer;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Ajax/templates/modal_footer;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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: modal_footer;misc;default,v 1.1 2007/11/07 17:48:07 entweichen Exp $

Modified: slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_d2;ajax;default
===================================================================
--- slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_d2;ajax;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_d2;ajax;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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.6 2007/10/24 20:01:48 entweichen Exp $
+$Id: prefs_d2;ajax;default,v 1.7 2007/11/05 19:37:55 entweichen Exp $

Added: slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_messages;ajax;default
===================================================================
--- slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_messages;ajax;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Ajax/templates/prefs_messages;ajax;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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: prefs_messages;ajax;default,v 1.1 2007/11/07 17:49:50 entweichen Exp $

Modified: slashjp/branches/upstream/current/plugins/Bookmark/bookmark.pl
===================================================================
--- slashjp/branches/upstream/current/plugins/Bookmark/bookmark.pl	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Bookmark/bookmark.pl	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: bookmark.pl,v 1.22 2007/11/01 20:35:18 jamiemccarthy Exp $
+# $Id: bookmark.pl,v 1.23 2007/11/07 23:15:56 jamiemccarthy Exp $
 
 use strict;
 use Slash;
@@ -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/branches/upstream/current/plugins/Email/email.pl
===================================================================
--- slashjp/branches/upstream/current/plugins/Email/email.pl	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Email/email.pl	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: email.pl,v 1.14 2006/01/06 19:53:43 jamiemccarthy Exp $
+# $Id: email.pl,v 1.15 2007/11/07 23:16:12 jamiemccarthy Exp $
 
 # Slash::Email - web script
 # 
@@ -16,7 +16,7 @@
 use Slash::Constants ':messages';
 use vars qw($VERSION);
 
-($VERSION) = ' $Revision: 1.14 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.15 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 
 # this is an example main().  feel free to use what you think
@@ -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/branches/upstream/current/plugins/FireHose/mysql_dump.sql
===================================================================
--- slashjp/branches/upstream/current/plugins/FireHose/mysql_dump.sql	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/FireHose/mysql_dump.sql	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,5 +1,5 @@
 #
-# $Id: mysql_dump.sql,v 1.34 2007/09/26 21:25:50 jamiemccarthy Exp $
+# $Id: mysql_dump.sql,v 1.35 2007/11/08 21:50:30 jamiemccarthy Exp $
 #
 INSERT INTO ajax_ops VALUES (NULL, 'firehose_fetch_text', 'Slash::FireHose', 'fetchItemText', 'ajax_user_static', 'createuse');
 INSERT INTO ajax_ops VALUES (NULL, 'firehose_reject', 'Slash::FireHose', 'rejectItem', 'ajax_admin_static', 'use');
@@ -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/branches/upstream/current/plugins/FireHose/mysql_schema.sql
===================================================================
--- slashjp/branches/upstream/current/plugins/FireHose/mysql_schema.sql	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/FireHose/mysql_schema.sql	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,5 +1,5 @@
 #
-# $Id: mysql_schema.sql,v 1.24 2007/10/30 20:18:00 tvroom Exp $
+# $Id: mysql_schema.sql,v 1.25 2007/11/08 21:50:30 jamiemccarthy Exp $
 #
 DROP TABLE IF EXISTS firehose;
 CREATE TABLE firehose (
@@ -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/branches/upstream/current/plugins/FireHose/templates/dispFireHose;firehose;default
===================================================================
--- slashjp/branches/upstream/current/plugins/FireHose/templates/dispFireHose;firehose;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/FireHose/templates/dispFireHose;firehose;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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 %]
@@ -156,4 +154,4 @@
 [% END %]
 [% END %]
 __version__
-$Id: dispFireHose;firehose;default,v 1.65 2007/11/01 00:24:42 tvroom Exp $
+$Id: dispFireHose;firehose;default,v 1.66 2007/11/07 16:59:31 tvroom Exp $

Modified: slashjp/branches/upstream/current/plugins/FireHose/templates/fhadvprefpane;misc;default
===================================================================
--- slashjp/branches/upstream/current/plugins/FireHose/templates/fhadvprefpane;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/FireHose/templates/fhadvprefpane;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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>
@@ -91,4 +91,4 @@
 
 </table>
 __version__
-$Id: fhadvprefpane;misc;default,v 1.17 2007/08/15 14:23:40 tvroom Exp $
+$Id: fhadvprefpane;misc;default,v 1.18 2007/11/08 21:50:30 jamiemccarthy Exp $

Modified: slashjp/branches/upstream/current/plugins/FireHose/templates/firehose_options;misc;default
===================================================================
--- slashjp/branches/upstream/current/plugins/FireHose/templates/firehose_options;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/FireHose/templates/firehose_options;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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>
@@ -49,4 +49,4 @@
 [% END %]
 
 __version__
-$Id: firehose_options;misc;default,v 1.6 2007/10/24 00:30:08 scc Exp $
+$Id: firehose_options;misc;default,v 1.7 2007/11/08 21:50:30 jamiemccarthy Exp $

Modified: slashjp/branches/upstream/current/plugins/Journal/Journal.pm
===================================================================
--- slashjp/branches/upstream/current/plugins/Journal/Journal.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Journal/Journal.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Journal.pm,v 1.68 2007/11/01 20:35:18 jamiemccarthy Exp $
+# $Id: Journal.pm,v 1.69 2007/11/07 23:15:56 jamiemccarthy Exp $
 
 package Slash::Journal;
 
@@ -16,7 +16,7 @@
 use base 'Slash::DB::Utility';
 use base 'Slash::DB::MySQL';
 
-($VERSION) = ' $Revision: 1.68 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.69 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 # On a side note, I am not sure if I liked the way I named the methods either.
 # -Brian
@@ -200,8 +200,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/branches/upstream/current/plugins/Messages/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/branches/upstream/current/plugins/Messages/DB/MySQL/MySQL.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Messages/DB/MySQL/MySQL.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: MySQL.pm,v 1.35 2007/08/08 16:57:57 jamiemccarthy Exp $
+# $Id: MySQL.pm,v 1.36 2007/11/07 18:05:14 entweichen Exp $
 
 package Slash::Messages::DB::MySQL;
 
@@ -31,7 +31,7 @@
 				# needs to be second!  figure it out. -- pudge
 use base 'Slash::DB::MySQL';
 
-($VERSION) = ' $Revision: 1.35 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.36 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 my %descriptions = (
 	'deliverymodes'
@@ -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/branches/upstream/current/plugins/Messages/PLUGIN
===================================================================
--- slashjp/branches/upstream/current/plugins/Messages/PLUGIN	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Messages/PLUGIN	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.14 2007/10/24 21:21:12 jamiemccarthy Exp $
+# $Id: PLUGIN,v 1.15 2007/11/08 08:56:20 pudge Exp $
 name=Messages
 description="Messaging system"
 mysql_schema=mysql_schema
@@ -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/branches/upstream/current/plugins/Tags/Tags.pm
===================================================================
--- slashjp/branches/upstream/current/plugins/Tags/Tags.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/plugins/Tags/Tags.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Tags.pm,v 1.86 2007/10/25 15:39:07 jamiemccarthy Exp $
+# $Id: Tags.pm,v 1.87 2007/11/07 23:16:30 jamiemccarthy Exp $
 
 package Slash::Tags;
 
@@ -17,7 +17,7 @@
 use base 'Slash::DB::Utility';
 use base 'Slash::DB::MySQL';
 
-($VERSION) = ' $Revision: 1.86 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.87 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 # FRY: And where would a giant nerd be? THE LIBRARY!
 
@@ -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/branches/upstream/current/sql/mysql/defaults.sql
===================================================================
--- slashjp/branches/upstream/current/sql/mysql/defaults.sql	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/sql/mysql/defaults.sql	2007-11-09 06:46:35 UTC (rev 244)
@@ -3,7 +3,7 @@
 #--------------------------------------------------------
 # Server version	3.23.26-beta-log
 #
-# $Id: defaults.sql,v 1.376 2007/11/02 00:30:01 pudge Exp $
+# $Id: defaults.sql,v 1.377 2007/11/08 08:57:13 pudge Exp $
 #
 
 #
@@ -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/branches/upstream/current/sql/mysql/upgrades
===================================================================
--- slashjp/branches/upstream/current/sql/mysql/upgrades	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/sql/mysql/upgrades	2007-11-09 06:46:35 UTC (rev 244)
@@ -10,7 +10,7 @@
 #      after X started at the same time that X was tagged.
 
 #
-# $Id: upgrades,v 1.1271 2007/11/02 03:35:13 pudge Exp $
+# $Id: upgrades,v 1.1274 2007/11/09 03:48:26 pudge Exp $
 #
 
 # BEGIN tf23's additions 
@@ -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/branches/upstream/current/tagboxes/Despam/Despam.pm
===================================================================
--- slashjp/branches/upstream/current/tagboxes/Despam/Despam.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/tagboxes/Despam/Despam.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Despam.pm,v 1.1 2007/11/01 20:35:18 jamiemccarthy Exp $
+# $Id: Despam.pm,v 1.2 2007/11/08 21:52:21 jamiemccarthy Exp $
 
 package Slash::Tagbox::Despam;
 
@@ -28,7 +28,7 @@
 use Data::Dumper;
 
 use vars qw( $VERSION );
-$VERSION = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+$VERSION = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 use base 'Slash::DB::Utility';	# first for object init stuff, but really
 				# needs to be second!  figure it out. -- pudge
@@ -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/branches/upstream/current/tagboxes/Despam/mysql_dump.sql
===================================================================
--- slashjp/branches/upstream/current/tagboxes/Despam/mysql_dump.sql	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/tagboxes/Despam/mysql_dump.sql	2007-11-09 06:46:35 UTC (rev 244)
@@ -1,5 +1,8 @@
-# $Id: mysql_dump.sql,v 1.1 2007/11/01 20:35:18 jamiemccarthy Exp $
+# $Id: mysql_dump.sql,v 1.2 2007/11/08 21:52:21 jamiemccarthy Exp $
 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/branches/upstream/current/tagboxes/FHEditorPop/FHEditorPop.pm
===================================================================
--- slashjp/branches/upstream/current/tagboxes/FHEditorPop/FHEditorPop.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/tagboxes/FHEditorPop/FHEditorPop.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: FHEditorPop.pm,v 1.19 2007/10/18 03:02:50 jamiemccarthy Exp $
+# $Id: FHEditorPop.pm,v 1.20 2007/11/08 21:52:21 jamiemccarthy Exp $
 
 # This goes by seclev right now but perhaps should define "editor"
 # to be more about author than admin seclev.  In which case the
@@ -32,7 +32,7 @@
 use Data::Dumper;
 
 use vars qw( $VERSION );
-$VERSION = ' $Revision: 1.19 $ ' =~ /\$Revision:\s+([^\s]+)/;
+$VERSION = ' $Revision: 1.20 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 use base 'Slash::DB::Utility';	# first for object init stuff, but really
 				# needs to be second!  figure it out. -- pudge
@@ -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/branches/upstream/current/tagboxes/FireHoseScores/FireHoseScores.pm
===================================================================
--- slashjp/branches/upstream/current/tagboxes/FireHoseScores/FireHoseScores.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/tagboxes/FireHoseScores/FireHoseScores.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: FireHoseScores.pm,v 1.4 2007/10/18 03:02:50 jamiemccarthy Exp $
+# $Id: FireHoseScores.pm,v 1.5 2007/11/08 21:52:21 jamiemccarthy Exp $
 
 package Slash::Tagbox::FireHoseScores;
 
@@ -28,7 +28,7 @@
 use Data::Dumper;
 
 use vars qw( $VERSION );
-$VERSION = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+$VERSION = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 use base 'Slash::DB::Utility';	# first for object init stuff, but really
 				# needs to be second!  figure it out. -- pudge
@@ -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/branches/upstream/current/tagboxes/Top/Top.pm
===================================================================
--- slashjp/branches/upstream/current/tagboxes/Top/Top.pm	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/tagboxes/Top/Top.pm	2007-11-09 06:46:35 UTC (rev 244)
@@ -2,7 +2,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Top.pm,v 1.14 2007/11/01 20:35:19 jamiemccarthy Exp $
+# $Id: Top.pm,v 1.15 2007/11/07 23:17:06 jamiemccarthy Exp $
 
 package Slash::Tagbox::Top;
 
@@ -28,7 +28,7 @@
 use Data::Dumper;
 
 use vars qw( $VERSION );
-$VERSION = ' $Revision: 1.14 $ ' =~ /\$Revision:\s+([^\s]+)/;
+$VERSION = ' $Revision: 1.15 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 use base 'Slash::DB::Utility';	# first for object init stuff, but really
 				# needs to be second!  figure it out. -- pudge
@@ -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/branches/upstream/current/themes/slashcode/htdocs/images/comments.js
===================================================================
(Binary files differ)

Modified: slashjp/branches/upstream/current/themes/slashcode/templates/edit_comment;comments;default
===================================================================
--- slashjp/branches/upstream/current/themes/slashcode/templates/edit_comment;comments;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/themes/slashcode/templates/edit_comment;comments;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -256,14 +256,7 @@
 	</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__
-$Id: edit_comment;comments;default,v 1.52 2007/10/31 19:59:58 entweichen Exp $
+$Id: edit_comment;comments;default,v 1.53 2007/11/07 18:00:36 entweichen Exp $

Modified: slashjp/branches/upstream/current/themes/slashcode/templates/footer;misc;default
===================================================================
--- slashjp/branches/upstream/current/themes/slashcode/templates/footer;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/themes/slashcode/templates/footer;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -66,10 +66,11 @@
 			[% Slash.currentAdminUsers() %]
 		[% END %]
 	</div>
+[% INCLUDE modal_footer %]
 </body>
 </html>
 
 __seclev__
 10000
 __version__
-$Id: footer;misc;default,v 1.18 2006/01/03 19:16:46 pudge Exp $
+$Id: footer;misc;default,v 1.19 2007/11/07 17:57:56 entweichen Exp $

Modified: slashjp/branches/upstream/current/themes/slashcode/templates/prefs_titlebar;misc;default
===================================================================
--- slashjp/branches/upstream/current/themes/slashcode/templates/prefs_titlebar;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/themes/slashcode/templates/prefs_titlebar;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -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" },
@@ -47,4 +52,4 @@
 __seclev__
 10000
 __version__
-$Id: prefs_titlebar;misc;default,v 1.12 2006/03/08 17:36:07 jamiemccarthy Exp $
+$Id: prefs_titlebar;misc;default,v 1.13 2007/11/07 18:16:05 entweichen Exp $

Modified: slashjp/branches/upstream/current/themes/slashcode/templates/printCommentsMain;misc;default
===================================================================
--- slashjp/branches/upstream/current/themes/slashcode/templates/printCommentsMain;misc;default	2007-11-08 06:57:53 UTC (rev 243)
+++ slashjp/branches/upstream/current/themes/slashcode/templates/printCommentsMain;misc;default	2007-11-09 06:46:35 UTC (rev 244)
@@ -291,15 +291,7 @@
 </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__
-$Id: printCommentsMain;misc;default,v 1.95 2007/10/24 00:30:08 scc Exp $
+$Id: printCommentsMain;misc;default,v 1.96 2007/11/07 17:59:36 entweichen Exp $


Slashdotjp-dev メーリングリストの案内
Zurück zum Archiv-Index