XmasB Quotes
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.
Stumble it!






oktober 19th, 2007 at 01:48
After downloading and following your install instructions, the database is never added. Also, the .css file is blank in the zip file.
oktober 19th, 2007 at 10:05
The table should be created, but I found a bug when inserting the content right after the tables is created. The table that should be created is named wp_xmasb_quotes, assuming you have the standard “wp_” prefix.
I have fixed this and added some content to the css file in version 0.6.1.
As you can see it still versioned < 1, because I need to test it with more people. It works nicely at my own blog, but I need others to test it as well. Feedback like this helps a lot when ironing out the bugs that I have overlooked. Thanks for trying the Widget.
oktober 19th, 2007 at 17:39
I am still having issues when activating the plugin and database creation. The plugin activate okay, but when I go to the manage - XmasB Quotes area I see the message:
Last 10 quotes added
WordPress database error: [Table 'donnas3_wrdp1.wp_xmasb_quotes' doesn't exist]
SELECT * FROM wp_xmasb_quotes order by id desc limit 10
No quotes found!
Could this be because of the structure of my database? The database name is donnas3_wrp1. This is the way my host creates it.
Thanks for any suggestions.
oktober 21st, 2007 at 13:48
The name of your database is donnas3_wrp1, and the table for XmasB Quotes is named wp_xmasb_quotes. Have you manually checked if the tables is actually created?
The code checks if the table exists and creates it if not found. I have to look more into this, but if you could check if the table is created or not, that would help a lot. It looks like it is not, but I don’t know why at this point. Thanks again for trying out my Widget.
oktober 23rd, 2007 at 05:02
It doesn’t create the database.. Please let me know what you think it is? Thanks
oktober 23rd, 2007 at 11:04
I have done some minor adjustments to the plugin concerning the creation of the table. The plugin uses the dbDelta() function to create the table. this should also go well with any future changes to the table. Not very likely to happen, but just in case.
Kevin, this means that the check I used to see if a table exists has been removed. If your problem was related to this check, everything should be fine. If not it would be a good idea to check if your Wordpress user on MySQL has the privileges to create tables. I suspect this could be the case.
The latest version is 0.7. I’m also looking into options for export and import of quotes. This would be great for backup and “trading” of quotes.
oktober 24th, 2007 at 21:51
I installed ver .70 and am still having the database creation issue. It for some reason doen’t create the table. The account does have permsission to create, but for some reason doesn’t. I have been able to manually create the table and then manually populate it. I did need to change line 69 from “where visible=true” to “where visible=1″ to make the quotes show up in the widget.
suggestions for a feature:
random type
1. random every page load (1,4,3,2) no order
2. ordered every page load (1,2,3,4)
3. Change once daily
oktober 24th, 2007 at 22:31
One more quick question, as I am pretty new to PHP and CSS. How did you make the structure in your sidebar for the quotes with the image on the first line, the quote on the second and the author in the third? I found and change my text color, but the default layout is the image on the left and the text right next to it on the right.
oktober 24th, 2007 at 22:42
I haven’t done any formatting to get the layout I have on this page, except centering of the image. Even if I remove the formatting for centering, the image, quote and author is still shown on separate lines. I have included the xmasbquotes.css which contains the classes for styling the layout. For most blogs, the default layout is the one they want. That is why the css is almost empty.
Thanks for not giving up. I’m not sure why the table couldn’t be created, but glad you managed to fix this manually. I haven’t heard anyone else have this problem, but will test this more.
I will look into more features when I get the time. Hopefully you have upgraded to Wordpress 2.3 and will see an update when a new version is available. I might implement something tomorrow, but can’t promise anything.
Btw, do you know version of PHP you are using?
oktober 24th, 2007 at 23:16
MySQL ver 4.0.25-standard PHP ver 4.4.4 Thanks
oktober 25th, 2007 at 14:05
Ok, I was hoping the problem was old software. But that looks just fine. Thanks for checking.
I’m running MySQL ver 4.1.21 and PHP ver 4.4.7. Although “where visible = true” works for me, I replaced this with “where visible = 1″ just in case. Works for me either way, but now it’s the same as in the table.
oktober 29th, 2007 at 15:39
That’s nice — I like that you included an image option to tie-in visually with quotes. Very slick.
oktober 29th, 2007 at 15:57
Thanks, Daniel. I have been meaning to include some additional features this week as well, but work is taking all my time.
oktober 29th, 2007 at 22:11
Hello, I would like to know how can I use this plugin without using a Widget, I would like to type it straight into my template as this one does not support Widgets.
oktober 30th, 2007 at 09:21
You can use this code for inserting a random quote (only where php is supported):
< ?php if (function_exists('xmasb_random_quote')) {
xmasb_print_random_quote();
} ?>
This only shows the contents of the widget (a random quote and image). Be sure to wrap it with whatever formatting you need.
I will add a tag to insert quotes into posts and pages in the next update. Using the functions from the plugin directly in Wordpress is not recommended because they can change in updates.
oktober 30th, 2007 at 09:56
Hello again, thanks for your solution.
I wanted to give an idea but I don’t know if its very good, for me would be very useful, would nice to have in the administration page of the plugin a text box for each section: quote, image and label (3 text boxes) and then to be able to type freely on each textbox the CSS formating code for it, if the box is empty a default CSS formatting is used but if we espicify CSS code then this one is used overwriting the default. Like this we don’t need to change the CSS file of the theme and all can be handled from the plugin administration page. Thanks for this great plugin.
oktober 30th, 2007 at 10:07
Not a bad idea at all. I will try to include this soon. I think I might include an option to enable/disable advanced options as well.
Thanks for the feedback, Perraco.
oktober 30th, 2007 at 10:12
I’m glad you liked the idea, I hope is not a problem, I thought maybe is better four textboxes for CSS, the fourth would for be the actual entire quote box, like that we can handle the margin, the padding, the background, etc. Thaks again
oktober 30th, 2007 at 10:26
Sounds good. I will look into it.
oktober 31st, 2007 at 15:50
I don’t see the option to disable the images on my site, I did it now by deleting the images themselves. When I open the option in the widget itself it only show the name of the quote widget
oktober 31st, 2007 at 22:50
I’m sorry. I forgot to update the instructions I think. The options are moved, and should be found under Options - XmasB Quotes. I will update this with a little update I plan on releasing tomorrow.
november 2nd, 2007 at 01:39
I installed the plugin and now I am trying to add the widget to the sidebar. I am new to wordpress so how do I add a widget to the side bar? Seems simple but don’t seem to be able to find the answer.
Richard
november 2nd, 2007 at 08:47
In order to use the Widget you need to have a Widget-enabled Wordpress installation. If you have Wordpress 2.2 or later, widgets are part of the Wordpress core and you should have everything you need. You theme must also be widget enabled.
Adding a widget to the sidebar is usually really easy. in your Wordpress dashboard, go to Presentation. There you should find a sub menu for Widgets. In this menu you should be able to arrange sidebars according to your current theme.
november 6th, 2007 at 14:33
This plugin is working good for me. Thanks a lot!
But I have a question:
How can I omite the simbols ” ” that envolve the quote? I don´t want them by default !!!
november 6th, 2007 at 14:49
Thats good to hear, Pablo. The ” ” symbols are there because of the q-tag that envelopes the quote. I will make this optional. I will try to release an update very soon. If you just remove the q-tag from the code, they will disappear. If you don’t want to wait for the release.
november 6th, 2007 at 15:32
Ok, I´ll wait.
Ah, and I realise that in the quote edit box I can write html code also. Good for this plugin!
Congrats.
november 6th, 2007 at 16:07
Thank you, Pablo. I will try to fix this as soon as possible. Hopefully within a few days. This is not the only request on my list of things-to-do.
november 9th, 2007 at 02:35
What an awesome plug. Props to you. I installed it with no problems and it adds a great functionality to my site. Thanks for the good work.
november 9th, 2007 at 07:01
Thanks Steve.Nice to see the plugin being used. I’m gonna add more functionality and customization options soon. Version 1.0 is not far away.
I really like the design on your site.
november 10th, 2007 at 10:45
Great plugin. but i think, you must add javascript file on admin pages only, and maybe you can create input like before ” and after ”. It will be better than
november 10th, 2007 at 18:50
Thanks, antis3ptic. I will add the option to input before and after the quote. I will think about adding the javascript too, but this is not mirst priority.
november 14th, 2007 at 00:39
Is there a way to implementt this “directly” by manually inserting code into the sideabar.php file instead of through the widget panel? Thanks!
november 14th, 2007 at 10:50
I have included an option for this. Insert “[XmasBRandomQuote]” (without the ” “) where you want the quote to appear. Please note that is not documented because I haven’t tested it properly. But as they say: It works on my machine. This code should work in posts and sidebar. Title is not included when this is used. It is still in testing and may be altered in future releases.
november 14th, 2007 at 16:12
XmasB,
Thanks for the reply. Didn’t do anything other than just display[XmasBRandomQuote] in the sidebar. I’m a WordPress/php newbie… do I literally just paste [XmasBRandomQuote] into the sisdbar.php file with no other syntax of any kind?
november 14th, 2007 at 16:27
My bad. I was thinking about inserting into post only. That code only works for content going through the wordpress process. Sorry about that.
To insert a quote in the sidebar.php, use the php function “xmasb_print_random_quote()” where you want the quote to appear. This should give the same result as with the code given above. Title is not included, so you may need to add this as well.
Most likely I will not change the name of this function, but I may someday. Just a heads up. If I change it, I will write it in the changelog of the plugin. It would be smart to wrap the function in a “function_exists()” function, in case I change it in a future release. That way your wordpress installation won’t crash if the function is not found.
Thanks for using the plugin.
november 15th, 2007 at 18:21
OK, that’s much better. That worked. A little more tweaking and I’ll be able to implement this. Thank you!
november 16th, 2007 at 02:37
Thanks bro for this great plugin
november 16th, 2007 at 08:31
Thank you for using the plugin, PurpleMinded.
Thank you, Kutsalodun.
november 22nd, 2007 at 19:06
I’m using this and was wondering if you can make the images to show around the text (to the left or right) rather than on the top.
november 22nd, 2007 at 20:57
I’m planning on adding the option to edit the css directly in the dashobaord. I’m still not sure how I would add this feature. Most likely I will add a choice between simple or advanced settings. Hopefully I will find time to release a new version of the plugin soon.
For now, you can edit the xmasbquotes.css file if needed.
Thanks for using my plugin.
desember 10th, 2007 at 20:02
Brilliant plugin
Thanks for your time
desember 10th, 2007 at 22:06
Thank you for using it, GianLuca.
I wanted to update the plugin with some functions (and fulfill some requests) and new layout, but we have been blessed with a firstborn. Naturally, this have taken up most of my time lately. But an update will be available soon.
januar 17th, 2008 at 06:01
Hi, I can use the WordPress interface but don’t understand php, so I don’t know how to edit the “xmasb-quotes/xmasbquotes.php” file in order to insert the actual quotes. Can you give me some newbie step-by-step instructions? Or perhaps you are working on a newbie-friendly interface for entering quotes? Thanks for any additional information.
januar 17th, 2008 at 08:39
Hi Carolyn,
you insert quotes in the Wordpress dashboard (under Edit - XmasB Quotes). Options for the plugin can be found under Options - XmasB Quotes.
The best way to use the XmasB Quotes plugin is to use the widget in a widget-ready theme. The theme you are using (Bluebird) support widgets, so you should be able to find the widget for XmasB Quotes under Presentation - Widgets. This is also where you edit the title for the widget.
You do not need to edit xmasbquotes.php (try to avoid it completely, as your changes will be lost in any future updates).
Hopefully this helps. I’m going to rewrite this page and the readme file to reflect updated changes and be more easy to understand.
januar 18th, 2008 at 08:27
Howdy! I found this plugin useful, but I have some questions…
If I add the “xmasb_print_random_quote();” code, it works. But if I add it in a if function_exists thing, it doesn’t do anything. Did you change the name of the function?
Also, is there a way to get this to output nothing but pure text? I want to use this to add random page titles to my site, but I noticed it added a div class statement before and after the random quote I chose, which shows up in the browser title window. I dunno if I made sense. Aheh.
Thanks, though!
januar 18th, 2008 at 09:13
I have not changed the name of the function. It is still called “xmasb_print_random_quote()”. I am going to rewrite the entire plugin soon, which may involve new names for the functions used. The reason for this decision is to make uses like yours easier to manage. this includes easier options for printing/getting only quotes and easier management of quotes in the dashboard.
I will include options for outputting quotes in pure text with next version. Along with some other features I’m planning on. Hopefully, I will find time within a week or two.
Thanks for trying the plugin, Dave.
januar 18th, 2008 at 16:32
Well, for some reason Wordpress isn’t recognizing the fact that “xmasb_random_quote” exists. Odd.
Thanks for your work on this! I’ll just fall back on my old method - a small javascript er, script, for now.
januar 19th, 2008 at 14:30
The function “xmasb_random_quote()” does not exist. Try using xmasb_print_random_quote()” instead. But beware that I most likely will change the code for this plugin soon. The names of the functions can change names as well.
januar 19th, 2008 at 22:01
I understand. For now I’ve er… edited your plugin a bit to remove the div and after the quote. It’s only for private use, and as soon as you release a newer version of the plugin, I’ll use it and delete my hacks.
Thanks.
januar 20th, 2008 at 20:55
You can do whatever you want with the plugin, Dave. I edit the plugins I download all the time.
januar 21st, 2008 at 15:06
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!
januar 21st, 2008 at 15:34
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…
januar 21st, 2008 at 16:32
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?
januar 23rd, 2008 at 07:44
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.
februar 10th, 2008 at 05:21
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!
februar 11th, 2008 at 06:35
Thanks for letting me know, Peach. I will try to fix this as soon as possible. And thanks for using the plugin.
februar 16th, 2008 at 16:25
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
februar 16th, 2008 at 22:56
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.
februar 18th, 2008 at 18:57
ok then I hope you will get time for this release.
I will check from time to time.
februar 18th, 2008 at 21:18
Thanks for trying out this plugin, jerry. I will try to find the time.
mars 8th, 2008 at 16:29
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
mars 8th, 2008 at 17:24
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.
mars 8th, 2008 at 18:49
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
mars 9th, 2008 at 19:58
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.
mars 31st, 2008 at 04:29
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.
mars 31st, 2008 at 04:31
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.
mars 31st, 2008 at 09:01
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.
april 1st, 2008 at 09:59
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.
april 2nd, 2008 at 07:28
Thanks! Deactivated, reactivated, and now it’s working.
april 2nd, 2008 at 09:01
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.
april 4th, 2008 at 17:49
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.
april 5th, 2008 at 10:12
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.
april 9th, 2008 at 22:37
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.
april 10th, 2008 at 22:18
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.
april 12th, 2008 at 02:55
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
april 14th, 2008 at 00:42
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.
mai 8th, 2008 at 00:39
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
mai 8th, 2008 at 10:58
Hi baron,
I use the plugin on this site (powered by WordPress 2.5.1). It is compatible with this version.
Trackbacks/pingbacks