Another update for quotes-collection users
Updated. See the latest entry for details.
The latest versions of the Quotes Collection plugin have changed the get-quote function. Here is an updated version of the quotescollection_get_quote function that does not waste randomness.
function quotescollection_get_quote($condition = 0) { global $wpdb; $offset = rand( 0, quotescollection_count($condition) ); $sql = "SELECT quote_id, quote, author, source FROM " . $wpdb->prefix . "quotescollection WHERE visible = 'yes'"; if ($condition) $sql .= " AND " . $condition; $sql .= " LIMIT " . $offset . ", 1"; $random_quote = $wpdb->get_row($sql, ARRAY_A); if ( !empty($random_quote) ) { return $random_quote; } else return 0; }
The shipping version of Quotes Collection uses “ORDER BYÂ RAND()”, not a big deal, but hey my randomness is precious.
http://wordpress.org/extend/plugins/quotes-collection/
May 2nd, 2010 at 3:07 pm
I notice your quote box doesn’t have a problem with taking out the escape characters in the quote. Did you have to make a change to the code for this? I used the Quotes Collection plugin as found on WordPress.org and it leaves the \ in with the html it outputs.
May 3rd, 2010 at 12:12 pm
As far as I know, my quote box leaves html in verbatim, and doesn’t escape anything. I haven’t made any other changes! I have to manually remove any HTML bits. This does let me put in italics and so on though.