Skip to content

Commit

Permalink
Remove deprecated stuff; join _invalid regexes into one loop; misc. t…
Browse files Browse the repository at this point in the history
…hingys
  • Loading branch information
pudge committed May 18, 2004
1 parent f62cadd commit 43e9cec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 65 deletions.
38 changes: 6 additions & 32 deletions Slash/DB/MySQL/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3186,28 +3186,6 @@ sub getPollAnswers {
return $answers;
}

# Deprecated -Brian
#########################################################
#sub getPollQuestions {
## This may go away. Haven't finished poll stuff yet
##
# my($self, $limit) = @_;
#
# $limit = 25 if (!defined($limit));
#
# my $poll_hash_ref = {};
# my $sql = "SELECT qid,question FROM pollquestions ORDER BY date DESC ";
# $sql .= " LIMIT $limit " if $limit;
# my $sth = $self->{_dbh}->prepare_cached($sql);
# $sth->execute;
# while (my($id, $desc) = $sth->fetchrow) {
# $poll_hash_ref->{$id} = $desc;
# }
# $sth->finish;
#
# return $poll_hash_ref;
#}

########################################################
sub deleteStory {
my($self, $sid) = @_;
Expand Down Expand Up @@ -7046,16 +7024,12 @@ sub getSlashConf {
}
}

if ($conf{email_domains_invalid}) {
my $regex = sprintf('[^\w-](?:%s)$',
join '|', map quotemeta, split ' ', $conf{email_domains_invalid});
$conf{email_domains_invalid} = qr{$regex};
}

if ($conf{submit_domains_invalid}) {
my $regex = sprintf('[^\w-](?:%s)$',
join '|', map quotemeta, split ' ', $conf{submit_domains_invalid});
$conf{submit_domains_invalid} = qr{$regex};
for my $var (qw(email_domains_invalid submit_domains_invalid)) {
if ($conf{$var}) {
my $regex = sprintf('[^\w-](?:%s)$',
join '|', map quotemeta, split ' ', $conf{$var});
$conf{$var} = qr{$regex};
}
}

if ($conf{comment_nonstartwordchars}) {
Expand Down
34 changes: 2 additions & 32 deletions Slash/DB/Static/MySQL/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,6 @@ sub getBackendStories {
return $returnable;
}

########################################################
# This is only called if ssi is set
#
# Deprecated code as this is now handled in the tasks!
# - Cliff 10/11/01
sub updateCommentTotals {
my($self, $sid, $comments) = @_;
my $hp = join ',', @{$comments->{0}{totals}};
$self->sqlUpdate("stories", {
hitparade => $hp,
writestatus => 'ok',
commentcount => $comments->{0}{totals}[0]
}, 'sid=' . $self->{_dbh}->quote($sid)
);
}

########################################################
# For slashd
sub insertErrnoteLog {
Expand Down Expand Up @@ -2242,22 +2226,6 @@ sub getHeadFootPages {
}

########################################################
# Was once used in template-tool's check_site_templates()
# but is now deprecated. Left here in case another
# application has need of it, but can be removed if
# necessary. - Cliff 2002-09-10
sub getAllTemplateIds {
my($self, $min, $max) = @_;
my $where;

return if $min =~ /\D/ or $max =~ /\D/;

$where = "tpid BETWEEN $min AND $max" if $min || $max;
$self->sqlSelectColArrayref(
'tpid', 'templates', $where, 'ORDER BY tpid'
);
}

sub getCidForDaysBack {
my($self, $days, $startat_cid) = @_;
$days ||= 0;
Expand All @@ -2268,6 +2236,7 @@ sub getCidForDaysBack {
"cid > $startat_cid AND date > DATE_SUB(NOW(), INTERVAL $days DAY)");
}

########################################################
sub getModderModdeeSummary {
my ($self, $options) = @_;
my $ac_uid = getCurrentStatic('anonymous_coward_uid');
Expand All @@ -2291,6 +2260,7 @@ sub getModderModdeeSummary {
return $mods;
}

########################################################
sub getModderCommenterIPIDSummary {
my ($self, $options) = @_;
my $ac_uid = getCurrentStatic('anonymous_coward_uid');
Expand Down
1 change: 0 additions & 1 deletion sql/mysql/defaults.sql
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ INSERT INTO vars (name, value, description) VALUES ('memcached','0','Use memcach
INSERT INTO vars (name, value, description) VALUES ('memcached_debug','0','Turn on debugging for memcached?');
INSERT INTO vars (name, value, description) VALUES ('memcached_keyprefix','x','Unique, short (1-2 chars probably) prefix to distinguish this site from the other sites sharing memcaches');
INSERT INTO vars (name, value, description) VALUES ('memcached_servers','127.0.0.1:11211','Space-sep list of servers for memcached in host:port format; to weight a server append =n');
INSERT INTO vars (name, value, description) VALUES ('metamod_sum','3','sum of moderations 1 for release (deprecated)');
INSERT INTO vars (name, value, description) VALUES ('min_expiry_comm','10','Lowest value for comment expiry trigger.');
INSERT INTO vars (name, value, description) VALUES ('min_expiry_days','7','Lowest value for duration expiry trigger.');
INSERT INTO vars (name, value, description) VALUES ('minkarma','-25','Minimum karma a user can sink to');
Expand Down

0 comments on commit 43e9cec

Please sign in to comment.