Quotes Collection 1.5.7

Quotes Collection plugin for WordPress updated to version 1.5.7.

  • Code improvements (thanks to Juliette for this and this)
  • Localization in Macedonian language added (thanks to Diana for the translation)
  • Localization in Persian language updated (thanks Ehsan)
  • FAQ updated… just adding some clarifications
  • And other minor changes

The latest version of the plugin can be downloaded from the Quotes Collection page at the WP plugin directory.

4 Comments

  1. Thanks for the update. But one problem remains (at least for me). Some of my tags have apostophes, and unfortunately I can’t use other tags that don’t have any (my tags are used for book titles). When I want to call now quotes by tag with an apostrophe, they are not displayed. Any ideas for a quick fix to implement?

  2. Hi Srini,

    Great job on this plugin! I’m using this on a client site and enjoying it.

    I’d like to make one suggested change. We’re showing multiple quotes throughout our blog’s home page, and I’ve set random=1 inside the function call. The problem is that your SQL statement is assuming that the function is only called once per page request. Consequently, I’m getting the identical “random” quote each time I invoke the function throughout the home loop.

    In your plugin, line 89 of quotes-collection.php shows this:


    $sql .= " ORDER BY RAND(UNIX_TIMESTAMP(NOW()))";

    I suggest changing that to something like this:


    $sql .= " ORDER BY RAND(" . rand(0, time()) .")";

    This guarantees that every time quotescollection_quote() is invoked on a single page request, a new random quote will be generated.

    Again, great job! Have a good one.

  3. Hello,
    I wanted to filter the quotes by saying for example ‘if they are tagged in both recipes AND reviews’, so I modified the shortcode. Probably badly :) :) I am posting here because it would be nice to have something like it done properly, for any future versions.

    Anyway, I added a new parameter ‘tagmatch’, and then modified the tags query. I pasted the relevant parts below. Hope it makes sense, and thanks for a great plugin :)

    function quotescollection_shortcodes($atts = array())
    {
    extract( shortcode_atts( array(
    'limit' => 0,
    'id' => 0,
    'author' => '',
    'source' => '',
    'tags' => '',
    'tagmatch' => 'OR',
    'orderby' => 'quote_id',
    'order' => 'ASC',
    'paging' => false,
    'limit_per_page' => 10
    ), $atts ) );

    ......(more code) .....

    if ($tags) {
    $tags = html_entity_decode($tags);
    if(!$tags)
    break;
    $taglist = explode(',', $tags);
    $tags_condition = "";
    if (!(($tagmatch=="AND") || ($tagmatch=="OR"))) $tagmatch="OR"; /*stopping silliness*/
    foreach($taglist as $tag) {
    $tag = trim($tag);
    if($tags_condition) $tags_condition .= " " . $tagmatch . " ";
    $tags_condition .= "(tags = '{$tag}' OR tags LIKE '{$tag},%' OR tags LIKE '%,{$tag},%' OR tags LIKE '%,{$tag}')";
    }
    if($tags_condition) $condition .= " AND ".$tags_condition;
    }

    ... (more code) ...
    }

  4. Hi, Srini. I like this a lot, but I have a question regarding bulk quote importation which I left at the WP Support page. Short version: how do I add a large number of quotations at one time, rather than doing it one-by-one?

    Thanks for your plugins and themes (I’m using F2) and for your anticipated help with this.

Comments are closed.