Permalink
Browse files

Bugfixes...

  • Loading branch information...
1 parent cba446c commit 3d036f3e4761121b3c954778c2c025f433154d2e @jamiemccarthy jamiemccarthy committed Aug 30, 2002
Showing with 11 additions and 11 deletions.
  1. +1 −0 Slash/DB/Static/MySQL/MySQL.pm
  2. +10 −11 themes/slashcode/tasks/run_moderatord.pl
@@ -658,6 +658,7 @@ sub convert_tokens_to_points {
# + and - instead of using absolute values. - Jamie 2002/08/08
for my $uid (@$uids) {
+ next unless $uid;
my $rows = $self->setUser($uid, {
-lastgranted => 'NOW()',
-tokens => "tokens - $tokentrade",
@@ -53,7 +53,7 @@ sub give_out_points {
moderatordLog(getData('moderatord_log_header'));
- my $read_db = $slashdb;
+ my $read_db = undef;
# If a backup DB is defined, we use that one.
my $backup_user = $constants->{backup_db_user} || '';
@@ -75,15 +75,14 @@ sub give_out_points {
give_out_tokens($newcomments, $constants, $slashdb, $read_db);
my $granted = $slashdb->convert_tokens_to_points();
- my %g_msg = (
- 0 => 'moderatord_tokennotgrantmsg',
- 1 => 'moderatord_tokengrantmsg',
- );
- for my $uid (keys %$granted) {
- my $g = $granted->{$uid};
- my $logline = getData($g_msg{$g}, { uid => $uid });
- moderatordLog($logline);
- }
+ my @gr_0 = sort { $a <=> $b }
+ grep { $granted->{$_} == 0 }
+ keys %$granted;
+ my @gr_1 = sort { $a <=> $b }
+ grep { $granted->{$_} == 1 }
+ keys %$granted;
+ slashdLog("Not giving points to " . scalar(@gr_0) . " users: '@gr_0'");
+ slashdLog("Giving points to " . scalar(@gr_1) . " users: '@gr_1'");
}
moderatordLog(getData('moderatord_log_footer'));
@@ -103,7 +102,7 @@ sub get_backup_db {
my $sleep_time = $constants->{moderatord_catchup_sleep};
while ($count--) {
- $read_db = new Slash::DB($backup_user);
+ $read_db = getObject('Slash::DB', $backup_user);
if (!$read_db) {
moderatordLog("Cannot open read DB: '$backup_user'");
return undef;

0 comments on commit 3d036f3

Please sign in to comment.