Bin-Blog logoBin-Blog

Learn about the latest in Web Development – as soon as I do.

Quartz WordPress Plugin

By • Nov 21st, 2008 • Category: Blogging, Scripts, WordPress

WordPress Plugin Week

Quartz Plugin lets you show random quotes/tips/links/pictures/something else to visitors. These quotes can be added from the admin side. You can add these one by one – or you can bulk import the stuff from a text file.

For those of you who are not in the know, this is the Plugin Week. Actually, this is the final day of the plugin week. In Plugin week, I release a new WordPress Plugin each day, every day for one week. This is the fifth plugin in that series. The plugins released so far are…

Note 1: Quartz is a beta plugin(as are most of the plugins released in the Plugin Week) – so watch out for bugs. And trust me, there will be a lot of them.

Note 2: I would recommend that you don’t install Quartz right now. It has not yet been accepted into the WordPress Plugin Repository. You can install it using the zip file I provide below – but then there will be some problems with auto updating of the plugin. Its better to wait until WordPress accepts the plugin before installing it. I’ll update this section when that happens. UPDATE: WordPress have accepted Quartz – feel free to install it now.

Installation

  • Download the zipped file.
  • Extract and upload the contents of the folder to /wp-contents/plugins/ folder
  • Go to the Plugin management page of WordPress admin section and enable the Quartz plugin
  • Go to the Quotes Management page(Tools > Manage Quote) to create or edit Quotes
  • You can add the Quartz widget by going to the widget area and drag-dropping it into your sidebar. Add the code <?php if(function_exists(‘quartz_show’)) quartz_show() ?> in your template – this will display the quote at that location.

Usage

The most apparent use of the plugin is to show random quotes to your visitors. Something like the famous Hello Dolly plugin – but for the client side. It also useful for showing small tips – say you are running a linux blog. You can insert useful linux commands with a small description into the quotes database – and the visitors will see random linux commands when they visit a new page. You can even upload image and add that to the database – users will see the a random image on each visit.

After installing the plugin, go to the Quartz Management page(Manage > Manage Quote). Now you can create new quotes.

Quartz WordPress Plugin - Manage

Quartz WordPress Plugin - Edit Quote

A better and easier way to do this is to use the bulk import method. You can use that to import a text file full of quotes into the database. Each line in the text file must have a quote in it. An example is the Celebrity Quotes File. You can import that file by entering the value ‘http://binnyva.com/pro/dos/boot_booster/quotes/celebrity.txt’ in the ‘Remote Text File’ field.

Quartz WordPress Plugin - Edit Quote

After the quotes are ready, you have to modify the template code a bit. Go to the location in the template where you want to show the quote and add the code

<?php quartz_show() ?>

This function can take two arguments…

$quotes_count
The first argument decides how many quotes must be shown. It is an optional argument and it defaults to 1.
$quotes_joiner
If you are showing more than 1 quote, use this string to join the quotes. The value defaults to ‘<br />’.

Examples

<?php quartz_show(3, '<br />') ?>

If you are trying to insert the quotes into the sidebar, this might be the way(might be different depending on your themes code)…

<li><h2>Random Quip</h2>
	<ul>
	<li><?php if(function_exists('quartz_show')) quartz_show(2, '</li><li>') ?></li>
	</ul>
</li>

See it in Action

You will see it running in my WordPress Demo Blog – look at the sidebar under the heading ‘Random Quips’. It don’t look all that refined – but that’s the themes fault. And I was too lazy to fix the theme 😉

Quartz WordPress Plugin - Final Result

Feedback

If you have any suggestions or notice any problems with the plugin, post it in the Quartz forum.

Last Words?

This should be the last plugin of my Plugin Week – but since you have been such a wonderful audience, I’ll throw in one more – as a bonus. It will be released tomorrow. Until then!


19 Responses »

  1. Farrhad A says:

    Hey! It’s a great plugin. I will try it out 🙂

  2. Thanks for the nice words. They are so cool.

  3. TheAnand says:

    You just made my day!! I remember reading this on RSS, but forgot which site it was……looking forward to implement this on my homepage 🙂

  4. thinkweird says:

    I like the mass import feature. I like the way I can edit my quote in the standard editor. This plugin should work so well except for one thing:

    It doesn’t support Chinese, and all the characters I input are changed into symbols like ????

    I tried to import texts using both UTF and ANSI encoding, but neither worked.

    How to make it support my language?

  5. thinkweird says:

    Just checked. My blog’s encoding is set to UTF-8 by default. The posts are showing fine, but why doesn’t the quote work?

  6. Binny V A says:

    @thinkweird
    Thanks for the feedback – I am trying to fix the issue with foreign languages.

  7. thinkweird says:

    Thank you for replying.

    This maybe too much to ask: is it possible to make the quotes automatically refresh themselves every few seconds? I mean without even reloading another page.

  8. thinkweird says:

    Have you fixed it yet?

  9. Quartz says:

    […] http://www.bin-co.com/blog/2008/11/quartz-wordpress-plugin/ Download Plugin! Version 1.00.0 Last Updated: November 24, 2008 Author: […]

  10. steve says:

    How do i make it work on a dynamic sidebar?

    Using a dynamic sidebar anything i enter into the sidebar.php itself does not show.

    Thanks in advanced.

  11. […] Plugin Week 1, only wordpress plugins where release(they are Eventr, Autofields, Pollin, Surveys, Quartz and Quizzin). This time around, I will not restrict myself to WordPress plugins – I’m […]

  12. Klark says:

    Hi, does this plugin work with WPMU? I just downloaded the plugin and enabled it in a rather vanilla WPMU and I can not find the Quotes management section?

  13. Klark says:

    Hi, I did find the “Manage Quotes” link. But, when i click on it, i get a 500 error. The log file says:

    mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use ‘RewriteOptions MaxRedirects’ to increase the limit if neccessary.

    Again, this is under WPMU. I increased RewriteOptions MaxRedirects to 30 and still get the error. Any ideas?

  14. Binny,

    You made my day! Excellent implementation that will allow me to reuse my famous quotes collection composed for WebToDate (a low-end German CMS).

    Thx. a lot for your passion!

    Peter A. Gebhardt
    (Germany)

  15. Lou Anne says:

    This can also be used to rotate through testimonials.

  16. rcs says:

    Warning: This plugin causes the widgets dashboard to crash … wp 2.9.2

  17. Lou Anne says:

    widgets dashboard crash in 3.0 multisite

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>