This plugin/widget lets you add and show random quotes to your WordPress blog with ease. The plugin uses MySQL to store quotes.
You can specify an image for each quote, default image for quotes, and the option to disable images altogether.
Installation
This section describes how to install the plugin and get it working.
1. Upload directory «xmasb_quotes» to the `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Add the widget to your sidebar
4. That’s it!
By default the plugin looks for an image in the folder named «images» with a name that matches the author and extension «.gif», eg. if the author is «Bart», the plugin will look for the file named «bart.gif». If an image is found it is used, else the quotes is shown without an image or default image if specified.
You can add, edit and delete quotes under Edit – XmasB Quotes.
The options for each quote:
Quote – The actual quote.
Author – The author of the quote. This is optional.
Image – The image to be used. If left blank, the name of the author will be used to search for an image. If not found, and default image is specified, the default image will be used.
Visible – Set this to «No» if you want to hide a quote without deleting it.
Set more general options under «Options – XmasB Quotes».
Options available:
Show Images – Uncheck this to disable images shown with quotes.
Default Image – If specified this image will be used if no image is found for author or specified image for quote. If left blank, quotes without images will not show an image.
Show link to author – Shows a link to xmasb.com and my plugin in the widget. Turn off if you want to.
The title for the Widget is set directly in the Widget under «Presentation – Widgets».
Title – The title to show with the Widget. Default is XmasB Quotes.
For easier management of version and statistics the plugin is hosted at WordPress.org.
This blog is using the Widget as you can see to the right.
You can also take a look at at the readme file for the plugin (XHTML formatted).

Hi XmasB,
Just getting started with the plugin and my site. I was wondering if you’ve encountered a situtation where the plugin text bleeds over the margins of the column (click on my website to see it). Any advice would be appreciated – my layout it widget ready. Thanks for creating such a great tool!
Hi Davin,
your stylesheet has the sidebar set to 334px in width. This is more than you need, which causes the text to bleed over the margins on the right. Try setting it to 250px, I think that looks good on your site (I have already tried this using Firebug on your site).
Also, I think it would look better if you add 12px to the left padding of the classes «xmasb_quotes_quote», «xmasb_quotes_author» and «xmasb_quotes_link» (or just leave the link out by selecting it away in the options page).
Here’s a preview of the changes:

I might have gone overboard in this. Kinda slow in the office today…
XMasB,
Thank you so much for the very quick advice! Much appreciated!! I was also going to float the image to have the text wrap around it – seems a little more natural that way. WHen I do this, all the widgets and text in the sidebar keep floating too. Any suggestions for getting just the image to float?
I believe you could just set «float: left/right» on the class «xmasb_quotes_image». I think that would work. As you can see on my site, I prefer to have it above and centered.
I really like this plugin. When I started looking for a quotes plugin I was worried I’d have to write my own, but this is exactly what I wanted. Thanks so much!
Minor bug: in xmasb_quotes_get_quote, the htmlbeforeauthor and htmlafterauthor variables are not used. Instead, you have strong tags hard coded around the author. I’ve had to fix it twice now
But it is an easy fix.
Thanks again for a great plugin!
Thanks for letting me know, Peach. I will try to fix this as soon as possible. And thanks for using the plugin.
hello i have your nice plugin activated in the side bar, I would like to add a link called «next» that will refresh only the plugin and give another quote,
i ‘m a little confused, anyhelp would be appreciated…
thanks
I have been thinking about that feature, jerry. Today, this is not possible with the current plugin (v 1.1.2). I’m planning to rewrite the plugin to improve the code. I will add several new features when I do this, and also plan on supporting ajax (which lets me do what you request) for smoother visuals.
I’m way behind in my plans for this plugin, but will hopefully find time to work on it soon. For the time being, a newborn and my work takes up pretty much all of my time.
ok then I hope you will get time for this release.
I will check from time to time.
Thanks for trying out this plugin, jerry. I will try to find the time.
Hello,
I just installed your promising plugin but when i try to add a quote in manage/Xmas BQuote it doesn’t show up in the statistics section saying «No quotes found». Any idea what could be the problem?
cheers
sonden
Hi Sonden,
the last 5 quotes added should be available in «Edit – XmasB Quotes» in your WordPress dashboard. If you have added the quote properly it should show up there right after being added. If it’s not there, there is a chance an error has occured.
If nothing shows up, look for an error when adding the quote. Any errors should appear just below the menuline.
Hello again,
Thank you for your quick reply!
I reuploaded and reactivated the plugin and it does exactly the same thing as before. When adding and saving a new quote they are not showing up – neither in the dashboard nor in the statistics section. There is also no error message.
Is it maybe the version of wordpress i am using (2.3.3) that is incompatible?
Best Regards
sonden
This sounds strange. Do you get the message saying the quote has been added?
I’m using WordPress 2.3.3 as well without any problems.
I just installed the newest version on WordPress 2.5 and am seeing the same thing as sonden. There is no message saying the quote has been added, and there is no error message. I checked my database — the xmasb_quotes table has been added, but is empty even though I’ve added half a dozen quotes.
I just noticed that the table is named ‘xmasb_quotes’ — that is, it isn’t using the prefix, even though I see that according to your code, it should be.
Thanks for letting me know, Stephanie.
I have tested against my testblog that I have upgraded to WordPress 2.5. Everything works fine there. I suspect that the problem occurs when creating the table for the plugin, but I have not yet tested this. I will look into this as soon as I can. I will email you when I find an answer, as well as post a comment here.
Found a bug introduced with WordPress 2.5 that caused the prefix to be dropped when creating the table. It has been fixed. I have tested and everything works fine.
Thanks! Deactivated, reactivated, and now it’s working.
Good to hear, Stephanie.
Thanks for pointing out the errors for me. I will be sure to tribute you on my page for this plugin.
My database was not created. I went into phpMyAdmin and tried to create the table manually. Got the following error message «#1101 – BLOB column ‘author’ can’t have a default value». TINYTEXT is a type of TEXT column, which is a type of BLOB. They cannot have default values. http://dev.mysql.com/doc/refman/4.1/en/blob.html
This is probably why the database doesn’t get created. The easiest way to «fix» this is to just get rid of the DEFAULT clause of the SQL create statement since the PHP code already makes sure that spaces ‘ ‘ are put into those fields if they weren’t specified in the management form.
Thanks Don. I have not heard any reports of this being a problem before, but the documentation on mysql is clear. You are probably not te first one experiencing this. I have removed the default value for the table in version 1.1.6.
Using 1.1.6 and wodrpress 2.5
It shows no quotes found on activation. When I add one, it accepts it, but still shows no quotes found.
Thanks for letting me know, Rick. Could you please tell me what version of PHP and MySQL you are using as well? I will look into this as soon as I can.
Operating system Linux
Service Status Click to View
Kernel version 2.4.21-32.ELsmp
Machine Type i686
Apache version 2.0.63
PHP version 5.2.5
MySQL version 4.0.27-standard
Shouldn’t be a problem as far as I can see there. I will look more into this tomorrow. So far you are the only one reporting this problem, but that doesn’t mean that there is no bug. Nobody’s perfect.
Have you checked if the table has been created correctly? The name of the table should follow your default settings, typically starting with «wp_». If that is the case, the table should be called «wp_xmasb_quotes». See if the name is similar to your other tables from WordPress.
hi there .thanks for plugin:
Does anybody know if tis script is compatible with WordPress 2.5.1 ?
Thanks in advance for any help on this!
best regards
Hi baron,
I use the plugin on this site (powered by WordPress 2.5.1). It is compatible with this version.
Hi,
I’m having the «table not created» problem with WordPress v2.3.3 and XmasB quotes 1.2.0. I’ve read most of the posts here, but still can’t figure out the problem. Here are the messages appearing at the bottom of the page when I try to add a quote:
WordPress database error: [Table 'db217842681.wp_xmasb_quotes' doesn't exist]
SELECT * FROM wp_xmasb_quotes order by id desc limit 5
No quotes found
WordPress database error: [Table 'db217842681.wp_xmasb_quotes' doesn't exist]
SELECT quote FROM wp_xmasb_quotes GROUP by quote HAVING COUNT(quote)>1
There are similar messages at the top of the screen but without «no quotes found».
Thanks for any thoughts.
Ed
Hmmm. I was sure I was rid of that error in version 1.1.6.
Can you check if a table has been created just the name «xmasb_quotes»? The prefix should be added, but earlier that has been the problem. I use the prefix set in the configuration file of your WordPress installation, but there could be a bug in that process that causes this.
I’m no SQL expert so I’m not sure how to check for tables. I did go into the database for my blog and looked around, and I saw nothing with «XmasB» in it, with or without the «wp_» prefix. I can tell you that I’m using WP 2.3.3, mySQL 4.0, and though probably not relevant, Windows XP SP2. My host is 1and1 Internet.
If there’s no easy solution then no worries. Thanks for your time.
Ed
Ok. I will try some testing with the version of WordPress you are using, to see if that could be the problem. It could also be the version of php that is too old. Do you know which version 1and1 are using?
I will look into this (it could be a problem for others as well, although I have not heard from anyone else). I will post an update here if I find a solution.
The PhP version 1and1 uses is phpMyAdmin 2.6.4-pl3.
If I’m the only one with this problem, then please don’t spend all your time on it. I appreciate the effort you and others make in putting out these widgets as freeware but I certainly don’t expect 24/7 support!
Ed
No problem, EdB. I haven’t tested with your WordPress version yet, but will try do so soon. If I find out that the version is not supported I will update the requirements for my plugin.
I’m probably going to «bite the bullet» and just upgrade my WordPress. It always makes me nervous, but it’s time. That should solve the issue. I’ll let you know. –Ed
Great. Sounds like a good idea for many other reasons as well. Good luck!
Hi,
I like the plugins, however is that any possibility to include quote on fix date instead of random?
regards,
stef
Not at he moment, stef. I have been planning to implement a few new functionalities to this plugin, and timestamp to allow for quote to be shown on specific dates is one of them. I will try to add this in a future version, but can’t maky any promises on when I’m afraid.
Hi,
I just moved my site to another domain name.
I have copy all the xmasb-quotes to the plugins directory, but when I checked the quote in wp-admin, I did not find any.
Pls let me know, how to restrore the quote. Where do you store the database?
regards,
stef
The table used is called wp_xmasb_quotes by default. The prefix (default «wp_») is the same as your other WordPress tables. If you move this table wiht your installation, you should be fine.
I am planning to include an option to export and import to file, but haven’t found the time for this yet.
Hi,
Where is the location of: wp_xmasb_quotes?
I have tried to find the file, but it is not there.
The wp_xmasb_quotes should be located within your WordPress database, together with your other wp_ tables. If you have chosen another prefix during the installation of WordPress, this will also be the prefix of xmasb_quotes.
You are not looking for a file, but a table within you MySQL database used by WordPress. Typically you will have to access this through your domain control panel.
I will release a new version with the option to export and import quotes (perfect for this kind of operation) soon. Hopefully, I will have this ready by next week.
I have the problem with «No quotes found»
On «localhost» I have WP v2.3.3 and XmasB Quotes v1.1.6 with 152quotes, it’s works fine.
When I install WP v2.5.1 – still works fine. And when I install XmasB Quotes v1.2.2 – works fine, I see quotes on «localhost» site.
But when I upload files from localhost to my site I get error «No quotes found» – in admin page I see all quotes, but when I open site – error.
Localhost:
PHP: 5.2.1
MySQL: 5.0.33
Site:
PHP: 5.2.6
MySQL: 5.0.45
Can you help me?
And I’m sorry for my English.
So you see all the quotes in the admin page, but get an error when viewing you blog? Are you sure the quotes are set to visible? (probably a stupid question…)
And you have of course added the quotes on your site as well? The quotes are stored in the mysql table wp_xmasb_quotes in your database. If you have copied the table from localhost, be sure that the prefix is the same as the other tables used by WordPress.
Please let me now if this helps or not.
Very hard for me describe the problem with my poor English, I’m sorry.
So I have WP v.2.5.1 and XmasB Quotes v1.1.6 – works fine on my blog (www.flector.ru)
I de-activated XmasB Quotes v1.1.6 and deleted folder xmasb_quotes from plugins folder in wordpress. I uploaded new version 1.2.2 on site and activated it in admin\plugins page. I get error «No quotes found» when I viewing blog.
Just see screenshot – http://www.flector.ru/quotes.png
But on «localhost» with WP 2.5.1 and XmasB Quotes v1.2.2 – I can see quotes. I cannot understand the difference between localhost and hosting. Problem with different versions of MySQL and PHP?
I find error in error_log of server
[Tue Jun 10 12:51:07 2008] [error] WordPress database error You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘SELECT FLOOR(MAX(ID)*RAND()) AS ID FROM wp_xmasb_quotes) AS x O for query SELECT * FROM wp_xmasb_quotes T JOIN (SELECT FLOOR(MAX(ID)*RAND()) AS ID FROM wp_xmasb_quotes) AS x ON T.ID >= x.ID and visible = 1 LIMIT 1 made by xmasb_get_random_quote
can you fix it?
I’m a bit puzzled by this. I have tried to find a solution, but so far Ive got nothing I’m afraid. The very query that you get an error or works in my MySQL (version 4.1.21). I copied the query from your comment, just in case. The query works just fine on my database.
One workaround can be to replace the line that causes this error in the plugin. Find the query in the file xmasbquotes.php (line 99) and comment it out by adding to slashes before the line. Uncomment the line before (with the old query). Please note that the old query is not as efficient with large tables (mine has about 15000 quotes in it).
I will try to find out what exactly causes your problem. Hopefully, you can use he workaround until then. Thanks for telling me about your problems with it. I need feedback to improve it.
It would be great if you could apply a refresh feature with AJAX, to enable the possibility of viewing more quotes without refreshing the page.
I have planned to include this in a future release, Alvaro. Hopefully I will find time to implement it soon.
HI,
Is there a way to put the plugins in PHP file instead from the widget? What is the code I need to put in?