Version: 1.00, by KuraFire
Developer Last Online: Nov 2023
Version: 2.2.x
Rating:
Released: 05-21-2002
Last Update: Never
Installs: 55
No support by the author.
IF THIS HACK DOESN'T RANDOMIZE WELL FOR YOU, DO THIS:
(by Boofo)
"You need to change the RAND() to RAND(NOW()) to make it more random with the new versions of mySQL since version .54
The NOW will seed it and make it more random that it was before. "
That should fix the problem for a lack of randomized quotes. ALSO NOTE THIS:
There's a bit of code going around that's 'unofficial' (ie. looks like it's from this hack, but it's adjusted and now flawed), saying "ORDER BY id" in the Query that gets the random quote. This is BAD CODE as it doesn't randomize anything at all. It should say "ORDER BY RAND(NOW())" instead.
</end Hack Issue Fix>
*drumroll*
It's here!
What does this hack do:
* it's an extension (big time!) on the Admin-only controlled hack I released earlier. If you installed that hack already, it should be pretty clear for you which steps you should ignore in the Instructions for this hack. What you Cannot ignore is the step about your Admin Panel, and the lines to add to admin/index.php !
* It lists a random quote either on your Forum Home, or in your Header. Next to that, it adds a Quote List, which is just a massive database of quotes that works just like the Memberlist, but with your quotes. It's searchable, and with the Add-on (see post #2!) users can also add quotes in it (which need moderation, before showing up online).
* Quotes can be added, edited and deleted from your Admin Panel. With the add-on, you can moderate quotes from your AP as well.
* There are no hard-coded colors. All colors are taken from your style, so all pages will appear in concordance of whatever style it is you're using.
Install instructions are in the zipfile: uqh_instructions.txt
For the add-on, see the second post, instructions file: w-add_instructions.txt
Have fun!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by tweak I installed this hack but My quotes started to go random on refresh then Stopped???? Now it sits on the same one.
You're not alone -_-
Mine just sits on ID 1 and once in a blue moon changes to ID 2
Edited: Well it changed to all of them after loads of refreshing.
I know this may sound stupid but how do I get it to get a quote in order?
PHP Code:
// random quote hack by KuraFire
$quot=$DB_site->query_first("SELECT id,quote,name FROM quotes ORDER BY id");
$thequote = $quot['quote'];
$thequoter = $quot['name'];
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...