summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
committerYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
commit33c6bd207473e8ce6ddfc0d19b34ccb139aa8521 (patch)
treed5714b79b3e02c77d78f43a1f4b34f7194068b14 /lib/VNDB/DB/Misc.pm
parent61c4d04980dc0376cf0032364a5952f8d828837f (diff)
parentf35175b04fc9f54680ad2578a994177e4d280b09 (diff)
Merge branch 'beta'2.3
Conflicts: data/docs/4
Diffstat (limited to 'lib/VNDB/DB/Misc.pm')
-rw-r--r--lib/VNDB/DB/Misc.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm
index 14ef45ac..c13a38d2 100644
--- a/lib/VNDB/DB/Misc.pm
+++ b/lib/VNDB/DB/Misc.pm
@@ -6,7 +6,7 @@ use warnings;
use Exporter 'import';
our @EXPORT = qw|
- dbStats dbRevisionInsert dbItemInsert dbRevisionGet dbItemMod dbLanguages
+ dbStats dbRevisionInsert dbItemInsert dbRevisionGet dbItemMod dbLanguages dbRandomQuote
|;
@@ -173,6 +173,16 @@ sub dbLanguages {
}
+# Returns a random quote (hashref with keys = vid, quote)
+sub dbRandomQuote {
+ return $_[0]->dbRow(q|
+ SELECT vid, quote
+ FROM quotes
+ ORDER BY RANDOM()
+ LIMIT 1|);
+}
+
+
1;