Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorØ
    • CommentTimeNov 18th 2006
     # 1
    This extension comes in two flavors:
    - Random Quotes (Header) displays random quotes above or below your forum header.
    - Random Quotes (Panel) displays random quotes in the side panel.

    Both are included in this package, you can even use the two versions at the same time if you want to. All you need to do is to edit the quote.txt file to add your own quotes.

    Many thanks to WallPhone for his suggestions and jimw for the rewriting of most of the code (which originally comes from the Random Simpsons Quotes Module, a Joomla! module by Josh - webmaster@gotgtek.com).

    Here's the related discussion:
    http://lussumo.com/community/discussion/3746/random-quotes-/#Item_19

    1.0.2 update: blank lines in the txt file don't cause an error anymore.
    1.0.1 update: the language definition for the quote's title in the panel version is now working.
  1.  # 2
    Thanks for this extension! Love it. One question, though. Can I make it change quotes daily instead of randomly? What would I need to alter in the code?

    The code is well documented, here's the critical bit:

    // Here we split it into lines
    $quotes = explode( $lineSeparator, $quotesString);
    // And then randomly choose a line
    $chosen = $quotes[ mt_rand(0, $i - 1 ) ];
    •  
      CommentAuthorjimw
    • CommentTimeSep 6th 2007
     # 3
    I built a WP quotes plugin and one of the functions was a daily quote. I used the day of the year to find that one on my quotes file, assuming I had at least 365 quotes. You could loop through the quotes file:

    foreach ($result as $row)
    {
    $remainder = $counter % $dayofyear;
    if ($remainder == 0)
    {
    output the $row;
    break;
    }
    }
  2.  # 4
    This is cool.. Gonna hack it up I think to randomly grab quotes from the forums though, as opposed to from a text file :)
Add your comments
    Username Password
  • Format comments as