Fortune Widget 0.3

[ This is an old version - Please see Fortune Widget 0.4 or the Fortune Widget project page]

My very first widget for the Wordpress2 “widgets” plugin. It’s very simple, in that it uses php-fortune to display a fortune from fortune files, which you can either copy into place or point towards ones installed on your system. Note: It comes with “calvin” (I.E. Calvin and Hobbes”) fortune file…

Requirements:

Some fortune files (I’ll post later where to look if you don’t know where to go for these).

Wordpress 2.1.x + Automatix Widgets or Wordpress 2.2.x or newer with modifications

Download: ZIP TAR.BZ2

Popularity: 10% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

15 Responses to “Fortune Widget 0.3”

  1. manu Says:

    How do I create one of those fortune files?

  2. leander Says:

    exactly… how to costumize???

  3. Jason Mock’s Place » Blog Archive » Downtime Says:

    [...] I do apologize to the couple of people who have asked on my posting of the Fortune Widget on how to create fortune files. I hope to have a post about that soon, since this is kind of an [...]

  4. Jason Mock’s Place » Blog Archive » Creating Fortune Files Says:

    [...] these steps you should be able to create your own fortune files, which can be used with the Fortune Widget I created for Wordpress. This does get a little tricky for Windows users, as the applications [...]

  5. Jason Mock Says:

    leander: The customizations are simply the ability to set a title for the widget block, and to select which fortune out of the fortune directory should be used. The issue that I had with other fortune widgets that were out there, were the fact that none of them included the fortune reading php script, and none of them had an easy way of updating which fortune file to use (in most cases you have to edit the script.php file by hand).

  6. Adding Trying To Add Fortune Widget to WP-Plugins | Jason's Place Says:

    [...] I’m trying to be somewhat official with my fortune widget by adding it to the wp-plugins database and committing the code to the svn server.  So far I [...]

  7. satoshi Says:

    I copied over a fortune cookie I made and I can’t seem to select it from the widget options.. It also doesn’t see the “cavin” cookie that came with the plugin.. Any ideas?

  8. Jason Mock Says:

    Just a heads up that things have been pretty busy in my life as of late. Probably within the next couple of days I can look into what is going on. I just wanted to make sure you know that I’m not ignoring you.

    Until then, without looking at the plugin because it has been a while, the first think I would look at is make sure that you have fortune index and fortune file located in the fortunes directory under [BLOG]/wp-content/plugins/fortune. That is the location the script is going to look for these files. Additionally for it to work correctly, it MUST have both the index and the dat file (I.E. for calvin, the files are “calvin” and “calvin.dat”). Definitely let me know if this doesn’t help you, otherwise, as I mentioned, I will be looking at what might be going on in the next couple of days.

    :)

  9. satoshi Says:

    Actually, the plugin wants them in wp-content/plugins/widgets/fortune (at least, the version I downloaded from wordpress.org does). I put both calvin and my own cookie there and it lets me choose them now in the widget config thing, but it displays this error when I view the page: “Unable to find fortune file swadsall,” where swadsall is the fortune cookie I made It does the same thing with calvin. Both the index and the .dat file are there.

  10. Jason Mock Says:

    Well, first of all I have to apologize because I didn’t realize how behind I was in regards to this being updated for the widgets plugin being integrated into Wordpress. I, out of a sleep deprived state, must have changed it to work and never updated the plugin for everyone else. That being said, the change I made was to move the fortune directory to wp-content/plugins. Both widget_fortune() and widget_fortune_control() both use a $baseFortunesDir, which “should” be identical. IF they are both identical, double check the permissions of the files such that the web server can read the appropriately. The next possible thing, is to make sure that the fortune.php script is in the same directory, as this is needed to actually read the fortune file. Unfortunately, out of my continued sleep deprived state, I didn’t write a very good validation / error message routine for that (this actually may be the most likely scenario).

    I do plan, after seeing all this, that I plan to write in some improvements such as a single variable for the location with a corrected path, and better output to indicate that everything is in order. Let me know what you find out, because I’d really like to get you working…

  11. satoshi Says:

    Hey! I finally got around to playing some more and after I copied the fortune.php file into wp-content/widgets/fortune/ it worked fine! Thanks for the help, dude!

  12. Jason Mock Says:

    Not a problem! I’m just glad that it worked out for you.

  13. Mick Dakota Says:

    I’ve done some work on a similar but unrelated project. It is a fortune plugin for the main page.

    http://mickdakota.com/wordpress-fortune-plugin

    It uses the fortunemod.com API on the net so doesn’t require any local fortune files or parsing scripts. The downside is that you can’t create your own cookies. The upside is that you can just set it and forget it and get immediate access to a huge collection of quotes from 50-60 of the top fortune databases.

    As it is targeted at the content region you also are not limited to your sidebar width as you would typically be with a widget, so you get much better display formatting.

  14. Jason Mock Says:

    It’s good to see a variety of plugins available, especially with quotes, since quotes can be quite difficult to come by if you don’t already run a unix/linux system or have the technical know how to create quotes. The only downfall that I would raise about off-loaded storage, or any kind, the performance hit when the Wordpress has to contact other websites / offsite servers to derive a given page. It might be worth while to recommend a page caching plugin in conjunction with wordpress-fortune-plugin…

  15. WordPress Widget List | WordPress Blog Design SEO - Customizations - Websites - Tutorials Says:

    [...] Fortune Widget – Fortune widget (Random Quotes), with some simple customizations and easy install. [...]

Leave a Reply

  • Recent Comments

  • Tags

    AACS Adobe Photoshop Elements 6 Apple Apple Lossless C++ C/C++ CNN Customer Service Dell Digikam DRM Firefox FLAC Fortune Fortune-Widget Fortune File Ghosts I-IV Giga-Byte Google Google Analytics Hack Internet Explorer Kernel Kubuntu Lingo Linksys SPA2102 Linux Mandriva Microsoft Nine Inch Nails OpenSuse Parody PC World Performance Perl Plugin Pre-Installed Linux Quote of the Day Restaurant Software Engineering Ubuntu VOIP Widget Wordpress YouTube
  • Stack Overflow

    Gravatar
    Jason Mock
    591r
    39
  •  

    February 2007
    S M T W T F S
    « Dec   Mar »
     123
    45678910
    11121314151617
    18192021222324
    25262728  
  • Archives

  • Categories

  • Books I'm Reading

    ISBN: 0385504225 ISBN: 020161622X ISBN: 0596100469 ISBN: 0321344758