A few people have pointed out an inefficiency in the wp-quotes plugin. My plugin grabs every quote in your database, sticks in a PHP array, and then chooses a random member of that array. It’s slow, but it works. Some people have pointed out that mysql supports an “order by rand()” clause that will automagically choose a random element from the result set. This is true, but the version of MySQL I have in this server doesn’t support the rand option properly. To use it, you need mysql 3.23.56 or above.
Yes, I should be on MySQL 5.0, but I don’t control this server, so I work with what I’m given. An option in the plugin will be available in the next version if you know your version of MySQL supports it. I’ll be starting a refactoring/redesign soon, and it will include proper wordpress 2.0 support, proper admin support (via the options panel instead of the manage panel), and probably a widget version. Thanks to everyone who uses the plugin!







Hey, thank you for the plugin, Dustin. Glad to hear that you’re still developing on it, and looking forward to version 2.0 (or whatever it’ll be).
Dustin, I just LOVE this plugin — I’m so happy to hear that you are working on a widget for it. (I haven’t been able to use wp-quotes since I changed my layout because I can’t figure out where to put the code. I *really* miss it! Thanks so much for continuing your hard work… I am eagerly awaiting the results.
I love wp-quotes - I post more quotes than I do blog entries.
Just saying thanks for keeping it current and making it better, I look forward to the new versions.
si, gracias por el plugin, en serio. Este plugin es una parte muy central de mi blog. Me gusta mucho
Very nice. I hope you’ll update very soon. right plane will love corner without any questions
[…] All that remains is the interesting part - performance tuning. No - wait. Existing users have already identified this modification as efficiently fetching a single, random record. Horribly database specific of course but worth having when you have 2.4 million quotes. […]
dgsgdsgds gds
For legacies sake you could just get the row count (I use “SELECT COUNT(1) FROM “) and then use the built in PHP rand function (preferably the Mersenne Twister) with the LIMIT clause to select a random row.
LIMIT ,1 //offset being the desired row
Hi. I wanted a daily quote in my sidebar (like MOTD), so I took your plugin and changed it for my needs. It reads the quotes descending from the database and taggs it with a timestampt starting the date I began with it. I even have a kind of quote archive (click on the three dots in the upper right), but it isn’t devided into pages, so in the future the page will be very long. Maybe I find someone who helps me rewriting the code or figure it out myself. Thanks anyway for your plugin! Bye
How can I show a specific number of quotes on a page instead of the whole lot?
I want to make multiple pages, each showing a specific number of quotes from the database.
Please help. Thanks
S.K
Hi your message is amazing.
I like your diary..
See ya
Instead of having a order by you also could do something like
while(didn’t fetch a valid quote){
mysql_query(select form quotes where quote_id = random())
}
Damn I didn’t write what I really wanted too… it would be nice to have a “quote added” field and a display for that.