]> git.donarmstrong.com Git - infobot.git/commitdiff
factstats author
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Dec 2002 20:30:28 +0000 (20:30 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Dec 2002 20:30:28 +0000 (20:30 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@729 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/Factoids.pl
src/dbi.pl

index 729ec8e77a7969e2b54a16995a9e2fe411615ebb..7a9a178ca24f68aa6123c37e0dea9b629829d0bb 100644 (file)
@@ -136,14 +136,14 @@ sub CmdFactStats {
     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}++;
index e0f48c4741c7053b47acb74b9ae1b75861533f64..f10845a2b59cfa0648456f1e4655d5ca671fba40 100644 (file)
@@ -88,9 +88,10 @@ sub sqlSelectMany {
        return;
     }
 
+    $query .= " WHERE " if (($where_href) || ($other));
     if ($where_href) {
        my $where = &hashref2where($where_href);
-       $query .= " WHERE $where" if ($where);
+       $query .= "$where" if ($where);
     }
     $query .= " $other"                if $other;