push(@array,$string);
}
- # modified:
- # disabled for the time being... it's misleading/useless info.
- if (0 && $factinfo{'modified_by'}) {
+ # modified: (TimRiker asks "why do you keep turning this off?)
+ if ($factinfo{'modified_by'}) {
$string = "last modified";
my $time = $factinfo{'modified_time'};
my ($type) = @_;
if ($type =~ /^author$/i) {
- my @array = &sqlSelectColArray("factoids",
+ my %hash = &sqlSelectColHash("factoids",
"factoid_key,created_by", { },
"created_by IS NOT NULL"
);
my %author;
- foreach (@array) {
- my $thisnuh = $hash{$_};
+ foreach my $factoid (keys %hash) {
+ my $thisnuh = $hash{$factoid};
$thisnuh =~ /^(\S+)!\S+@\S+$/;
$author{lc $1}++;
my @list;
my $delta_time = &timedelta($start_time);
- &status(sprintf("factstats(vandalismbroken): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
+ &status(sprintf("factstats(vandalism): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
$start_time = &timeget();
# parse the factoids.
"factoid_value", "^<REPLY> see ");
my %redir;
my $f;
+ my $dangling = 0;
for (@list) {
my $factoid = $_;
if (defined $redirval) {
$redir{$redir}{$factoid} = 1;
} else {
- &WARN("factstats(redir): '$factoid' has loose link => '$redir'.");
+ &DEBUG("factstats(redir): '$factoid' has loose link => '$redir'.");
+ $dangling++;
}
}
}
}
# parse the results.
- my $prefix = "Redirections in factoids ";
+ my $prefix = "Redirections in factoids, $dangling dangling ";
return &formListReply(1, $prefix, @newlist);
} elsif ($type =~ /^request(ed)?$/i) {
for (@list) {
my $factoid = $_;
my $val = &getFactInfo($factoid, "factoid_value");
-
+
next unless ($val =~ /^see( also)? (.*?)\.?$/i);
my $redirf = lc $2;
} elsif ($type =~ /^unrequest(ed)?$/i) {
# todo: use sqlSelect()
- my @list = &sqlRawReturn("SELECT factoid_key FROM factoids WHERE requested_count IS NULL");
-
- for (@list) {
- s/([\,\;]+)/\037$1\037/g;
- }
+ my $count = &sqlRawReturn("SELECT COUNT(*) FROM factoids WHERE requested_count = '0'");
- my $prefix = "Unrequested factoids ";
- return &formListReply(0, $prefix, @list);
+ return "Unrequested factoids: $count";
}
return "error: invalid type => '$type'.";