I'm having the stuck on a quote problem as well.
At first I had the template called only for users who were logged in (I had done this inadvertantly by putting the call for the home_randomquote template right after the IF statement to test for users.) When it was setup this way, the quote was perfectly random ... However, When I discovered this, I moved the call out side of the user logged in conditional, and it no longer randoms. It stays on the first quote for both logged in and logged out users. I've tried moving it throughout my index.php
Any ideas?
**I FIXED MY PROBLEM**
Changed the random seed by using the following:
srand((double)microtime()*1000000);
$random_number = rand(1,147);
$quot=$DB_site->query_first("SELECT quote,name FROM quotes WHERE id = '$random_number'");
**************
however, you should change the 1,147 to represent the number of quotes you have (this is the range of the random number selected I believe).
I think you can stick in a query to get the number, but i just hard code it...
Good luck !
|