Skip to content

Commit

Permalink
Misc. thingys
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Apr 27, 2004
1 parent 9e21701 commit ea8f8b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 6 additions & 7 deletions Slash/DB/MySQL/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,10 @@ sub getMetamodsForMods {
}
return $mods_to_m2s;
}
########################################################

########################################################
sub getMetamodlogForUser {
my ($self, $uid, $limit) = @_;
my($self, $uid, $limit) = @_;
my $uid_q = $self->sqlQuote($uid);
my $limit_clause = $limit ? " LIMIT $limit" : "";
my $m2s = $self->sqlSelectAllHashrefArray(
Expand All @@ -1112,7 +1112,6 @@ sub getMetamodlogForUser {
return $m2s;
}


########################################################
sub getModeratorLogID {
my($self, $cid, $uid) = @_;
Expand Down Expand Up @@ -5752,7 +5751,7 @@ sub setCommentForMod {
if (!$constants->{mod_down_karmacoststyle}) {
$karma_val = $karma_change;
} elsif ($val < 0) {
$karma_val = ($hr->{points_before}+$karma_change) - $hr->{points_max};
$karma_val = ($hr->{points_before} + $karma_change) - $hr->{points_max};
} else {
$karma_val = $karma_change;
}
Expand Down Expand Up @@ -6499,13 +6498,13 @@ sub calcModval {
}

sub getNetIDKarma {
my ($self, $type, $id ) = @_;
my ($count, $karma);
my($self, $type, $id) = @_;
my($count, $karma);
if ($type eq "ipid") {
($count, $karma) = $self->sqlSelect("count(*),sum(karma)","comments","ipid='$id'");
return wantarray ? ($karma, $count) : $karma;
} elsif ($type eq "subnetid") {
($count, $karma) = $self->sqlSelect("count(*),sum(karma)","comments","subnetid='$id'");
($count, $karma) = $self->sqlSelect("count(*),sum(karma)","comments","subnetid='$id'");
return wantarray ? ($karma, $count) : $karma;
} else {
($count, $karma) = $self->sqlSelect("count(*),sum(karma)","comments","ipid='$id'");
Expand Down
4 changes: 4 additions & 0 deletions sql/mysql/upgrades
Original file line number Diff line number Diff line change
Expand Up @@ -2266,9 +2266,13 @@ INSERT INTO vars (name, value, description) VALUES ('karma_posting_penalty_style

# End of T_2_3_0_149, Start of T_2_3_0_150 - 2004/04/13

# End of T_2_3_0_150, Start of T_2_3_0_151 - 2004/04/20

INSERT INTO vars (name, value, description) VALUES ('m2_if_smoother',5,'Number that acts as multiplier for the if_expr, should probably be around your average m2needed/consensus value');
INSERT INTO vars (name, value, description) VALUES ('subnet_karma_post_limit_range','-5|-9|-10|-999999','range of subnet karma to block posting at -5|-9|-10|-999999 blocks anonymous posting at -5 to -9 subnet karma, and all posting from -10 to -999999 subnet karma');
INSERT INTO vars (name, value, description) VALUES ('subnet_karma_comments_needed','5','Number of comments needed before subnet karma is used for disallowing posting');

INSERT INTO vars (name, value, description) VALUES ('maxtokens_add','3','Max tokens to give any one user per pass');

# End of T_2_3_0_151, Start of T_2_3_0_152 - 2004/04/27

3 changes: 1 addition & 2 deletions themes/slashcode/htdocs/index.pl
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ sub do_rss {
my $story = $reader->getStory($_->{sid});
$story->{introtext} = parseSlashizedLinks($story->{introtext});
$story->{introtext} = processSlashTags($story->{introtext});
# this REALLY REALLY SUCKS and MUST be rewritten before going live -- pudge
$story->{introtext} =~ s{(HREF|SRC)="(//[^/]+)}{$1 . '="' . url2abs($2)}eg;
$story->{introtext} =~ s{(HREF|SRC)="(//[^/"]+)}{$1 . '="' . url2abs($2)}ieg;
push @rss_stories, { story => $story };
}

Expand Down

0 comments on commit ea8f8b1

Please sign in to comment.