Quote of the day plugin



The Quote Of The Day plug-in manages quotes displayed on your WordPress or WordPressµ blog. Unlike other QOTD plug-ins that link to external web sites, the Quote Of The Day plug-in stores quotes, and related references, in your WordPress database. In addition, this plug-in conforms with the HTML 4.01 specification regarding <blockquote> and <q> tags.

Overview

There are three elements of a quote, the author, the citation, and the quotation itself. The cd-qotd plug-in administrative page allows you to manage these three elements. You may also select whether a quote is displayed using the <blockquote> or <q> (inline quote) tags, as well as, the frequency at which different quotes are displayed. Specifically, you can select to have a random quote displayed with each new page (page refresh), each hour, or each day.

Note: You can see the cd-qotd in use on this site at the bottom of the right-hand sidebar.

There are a couple of topics I want to address here. One is the proper use of the CITE attribute. The other is selecting a BLOCKQUOTE or Q (inline) quotation type. The cd-qotd plug-in allows you select either of these tags for use within your site. Your use of these elements should conform to your style guide.

The CITE attribute was designed to provide a reference to the source of the quotation. Here is the definition taken from the w3c specification.

The value of this attribute is a URI that designates a source document or message. This attribute is intended to give information about the source from which the quotation was borrowed.

Take a look at the source of this page to view the CITE attribute. As an example referencing this web site, you may elect to use a generic style, such as:
cite="Coyotes Designs. Available at: http://coyotesdesigns.com/quote-of-the-day-plugin/. 03 March 2010".


Whether you select to use either the BLOCKQUOTE or Q tag depends on the type of quotation you want to display. The intent of these tags is to cover a block-level quotation or an inline quotation, respectively. I did not code any restrictions into the cd-qotd plug-in on which tag you select. That means you can use the inline quote tag for block-level quotations.

One very important piece of information regarding the use of the inline Q tag, is whether to use quotation marks to enclose your quotation. According to the specification, quotation marks are automatically inserted by the user agent.

Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.

Installation

The cd-qotd plug-in is installed as any other plug-in.

  1. Download the cd-qotd plug-in to your local machine.
  2. Extract the files retaining the folder structure.
  3. FTP the cd-ad-sponsor files to your WP Plugins directory. (Single and MU versions)
  4. Activate the plug-in through the 'Plugins' menu in WordPress.

You may also use the upload feature in your WordPress Plugin management page to upload the zip file and install the plug-in.

Management Page

Manage Quote Of The Day Management Page

Fig-1 Management Page

When you activate the cd-qotd plug-in, you will see the CD QOTD menu option in your Settings menu. Activation also creates the cd_qotd database table in your WordPress database, and inserts a single default quotation. This table contains all data associated with the quotations you want displayed on your site. Additional information, such as the frequency that quotes are displayed, is inserted into the options table.

Selecting the CD QOTD menu option displays the cd-qotd Management page. This page lists all currently defined quotes within the database, sorted alphabetically by author name. You may delete any unwanted quotes. The plug-in will check to see whether the quote you want to delete is currently scheduled to display. If it is, it will not be deleted. This is a temporary issue, based on the frequency you selected. Once another quote has been registered to display, you can delete the original quote.


There are also two options available, an option to add a new quotation, and the option to define the settings. I will discuss each of these options in the following sections.

Add Quote Page

Manage Quote Of The Day Add Quote Page

Fig-2 Add Quote Page

The Add Quote page displays the data fields necessary to define a quotation. These data fields are defined as follows.

Author Name
This field is where you enter the name of the author of this quotation. This field is required.
Citation
This field is where you enter the printed or URI reference for this quotation. Print references may include ISBN nomenclature, publication titles, etc. This field is optional, although highly recommended.
Quote
This field is where you enter the actual quotation that you want to present. When entering quotations, do not include quotation marks. This field is required.

TIP: I have received emails asking about embedding links within a quotation, and also about wrapping the author name within a link. The answer is, Yes. You can add normal anchor tags to both the author name and quotation fields. These links will be displayed in the quote of the day.

Settings Page

Manage Quote Of The Day Settings Page

Fig-3 Settings Page

The Settings page displays the options to define the presentation of a quotation, and allows you to import a CSV file. These data fields are defined as follows.

Display Type
This data field allows you to select either the BLOCKQUOTE or Q tag in which to display the quotations.
Display Frequency
This data field allows you to select the frequency in which to rotate through the defined quotations. You may select to have a new quotation displayed with each new page, at the top of the hour, or for each new day.
Import Quotes
This is a CSV file in the following format: "Author","Citation","Quotation". Do not include the field names as the first row. Quotes are imported for the current blog, if you are using multi-site.

Modifying Your Theme

Example Quote Of The Day Presentation

Fig-4 Example QOTD

You may be wondering why this plug-in wasn't designed as a widget. Well, two reasons. First, I didn't want to relegate the cd-qotd plug-in to only the sidebar, and two, well, see the first reason. :)


[edit]The QOTD plug-in was upgraded to function as a widget in release 1.1.0.[/edit]

In order to display your quotations you need to add the cd_qotd_quote() function within your desired theme file. For example, you can include the function call within your sidebar.php file as demonstrated on my site. (See the sidebar for an example.)

Note: The cd-qotd plug-in displays your quotations in your blog theme as styled by your definitions in the /css/cd-qotd.css file. I recommend that you at least re-define the BLOCKQUOTE element definition so that the quotation is displayed differently than other block quotes on your web site. You may elect to display your quotation across the top portion of your blog page, in which case, you would add the cd_qotd_quote() function to your header.php file. This, of course, depends on the structure of your theme files.

The syntax is:

<?php if (function_exists('cd_qotd_quote')) { cd_qotd_quote(); } ?>

No arguments are passed. This is simply a function call that outputs a random quotation in the style you define.

If you intend to display the QOTD in the sidebar or main body of a page, you will need to copy the existing block segment HTML tags that your theme uses to display the desired format, and insert them where you want the QOTD to appear. You then insert the cd_qotd_quote function inside the content area of that block. You can see an example of the block of HTML tags used by this theme by viewing the page source. Your theme will be different, so I cannot offer a tailored example. I will, however, be more than happy to assist you if you so desire. Feel free to contact me on Skype.

Conclusion

I hope that you find this plug-in beneficial to you as it has been for me. Please feel free to comment or make suggestions for future enhancements.



37 Responses to “Quote of the day plugin”

  • LMaui says:

    Thank you - for the quick response and getting me right to it :-).

  • LMaui says:

    Hi Coyote, I have one more question for you. After running it for a couple of days, set to show a new quote each day, I'm finding that it changes to the new quote in the late afternoon/evening. Is there a way to control it, so that it changes in the early morning each day?

    thanks,
    Luann

  • Coyote says:

    Hi Luann,

    Thanks for finding this bug. I have updated the plug-in and you can download it here.

    Please update as follows:

    1. Deactivate the qotd plug-in.
    2. Upload the new plug-in files to the qotd folder (Ensure that you overwrite the original files.)
    3. Re-activate the qotd plug-in.

    Once you have the updated plug-in activated, follow these steps:

    1. Go to the qotd settings page.
    2. Select the desired frequency option.
    3. Save the changes.

    The bug was due to changing between the hourly and daily frequency. If you had used an hourly frequency, the plug-in would increment the hour of the day in order to keep track. However, when you switched to daily, the hour value was still set to the previous value (eg, 5 o'clock), so the daily rotation would not occur until that hour had expired.

    Please let me know if you encounter any further problems.

    Coyote

  • LMaui says:

    Thank you so much! I've downloaded and will try it out later today. I've just sent a donation - you and your plug-in have been wonderful :-).

    thanks,
    Luann

  • Coyote says:

    Thank you very much. I appreciate your interest and your contribution to my master plan of world domination, or at least my domination of a small tropical island some where :)

  • shughey says:

    Well, after searching many, many pages in Google to find this, I finally found it. I've downloaded and activated it and added quotes. However, I have two questions to make this complete:

    1. What in the world is this: existing block segment HTML tags that your theme uses to display the desired format

    2. I need different quotes for different pages, not just one page showing one quote. For example:
    Page 1 quote
    Page 2 quote
    Page 3 quote
    Page 4 quote
    Page 5 quote
    Page 6 quote
    etc.

    Can that be done?

    Thanks,
    Sam Hughey

  • Coyote says:

    Hi Sam,

    Glad you found it.

    Your first question deals with placing the qotd function call inside your theme. If you don't modify your theme, then don't worry about it. You can use the widget to accomplish similar results.

    The answer to you second question is, No, and Yes. The qotd plug-in does not currently support this functionality. Yes, it could be done, but I do not have time to work on it. You could have any php programmer make the necessary changes to the plug-in.

    Hope this helps.
    Coyote

Leave a Reply

You must be logged in to post a comment.


Advertisement

Popular Posts

Quote of the day plugin

The Quote Of The Day plug-in manages quotes displayed on your WordPress or WordPressµ

Sponsor Ad Management User Guide

The cd_ad_sponsor plug-in was written to manage the sponsor ads that can be presented with

A WordPress Sponsor Ad Management Plug-In

I wrote the WordPress Sponsor Ad Management Plug-in to use within the WordPress and WordPr

Quote Of The Day
Praise is well, compliment is well, but affection--that is the last and final and most precious reward that any man can win, whether by character or achievement.
~Mark Twain