From f71149e1af4ac0b03678fc80da73a7cdc352c3aa Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Thu, 25 Jul 2002 06:22:55 +0000 Subject: Bug 67950 - Move the quip list into the database. Patch by davef@tetsubo.com; r=gerv, preed. --- buglist.cgi | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'buglist.cgi') 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, "; - 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. -- cgit v1.2.3-24-g4f1b