Quote:
Originally Posted by magnus
Yea, that'll be added. I store the userid of the person who submitted the quote, so it's just a matter of tossing $randomquote[userid] out somewhere.
|
Yeah just noticed that as I was looking at the code.. I changed your query to:
Code:
$result_quote = $DB_site->query("
SELECT quotes.*,user.username AS quotename FROM ".TABLE_PREFIX."quotes AS quotes
LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = quotes.userid)
ORDER BY rand() LIMIT 1
");
while ($quote = $DB_site->fetch_Array($result_quote)) {
$randomquote[quoteid] = $quote[quoteid];
$randomquote[quote] = $quote[quote];
$randomquote[author] = $quote[author];
$randomquote[username] = $quote[quotename];
}
$DB_site->free_result($result_quote);
eval('$showrandomquote .= "' . fetch_template('randomquote') . '";');
and then you can place
$randomquote[username] where you want the submitters username to show