diff options
author | gerv%gerv.net <> | 2002-07-25 08:22:55 +0200 |
---|---|---|
committer | gerv%gerv.net <> | 2002-07-25 08:22:55 +0200 |
commit | f71149e1af4ac0b03678fc80da73a7cdc352c3aa (patch) | |
tree | e2bdebeb1b6a27171fc22b14fd5b4f9412052c3e /buglist.cgi | |
parent | 8685e9a274f0b6d88d0b3447662ff8db9564c8a9 (diff) | |
download | bugzilla-f71149e1af4ac0b03678fc80da73a7cdc352c3aa.tar.gz bugzilla-f71149e1af4ac0b03678fc80da73a7cdc352c3aa.tar.xz |
Bug 67950 - Move the quip list into the database. Patch by davef@tetsubo.com; r=gerv, preed.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/buglist.cgi b/buglist.cgi index aa9cfb7eb..7863dda3e 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -270,18 +270,14 @@ sub LookupNamedQuery { } sub GetQuip { - return if !Param('usequip'); my $quip; - # This is stupid. We really really need to move the quip list into the DB! - if (open(COMMENTS, "<data/comments")) { - my @cdata; - push(@cdata, $_) while <COMMENTS>; - close COMMENTS; - $quip = $cdata[int(rand($#cdata + 1))]; + SendSQL("SELECT quip FROM quips ORDER BY RAND() LIMIT 1"); + + if (MoreSQLData()) { + ($quip) = FetchSQLData(); } - $quip ||= "Bugzilla would like to put a random quip here, but nobody has entered any."; return $quip; } @@ -1542,7 +1538,7 @@ if ($::FORM{'debug'}) { # the list more compact. $vars->{'splitheader'} = $::COOKIE{'SPLITHEADER'} ? 1 : 0; -$vars->{'quip'} = GetQuip() if Param('usequip'); +$vars->{'quip'} = GetQuip(); $vars->{'currenttime'} = time2str("%a %b %e %T %Z %Y", time()); # The following variables are used when the user is making changes to multiple bugs. |