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.
- Upload directory «xmasb_quotes» to the
/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- Add the widget to your sidebar
- 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.








After downloading and following your install instructions, the database is never added. Also, the .css file is blank in the zip file.
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.
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.
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.
It doesn’t create the database.. Please let me know what you think it is? Thanks
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.
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
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.
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?
MySQL ver 4.0.25-standard PHP ver 4.4.4 Thanks
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.
That’s nice — I like that you included an image option to tie-in visually with quotes. Very slick.
Thanks, Daniel. I have been meaning to include some additional features this week as well, but work is taking all my time.
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.
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.
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.
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
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.
Sounds good. I will look into it.
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
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.
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
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.
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 !!!
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.
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.
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.
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.
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.
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
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.
Is there a way to implementt this «directly» by manually inserting code into the sideabar.php file instead of through the widget panel? Thanks!
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.
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?
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.
OK, that’s much better. That worked. A little more tweaking and I’ll be able to implement this. Thank you!
Thanks bro for this great plugin
Thank you for using the plugin, PurpleMinded.
Thank you, Kutsalodun.
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.
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.
Brilliant plugin
Thanks for your time
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.
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.
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.
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!
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.
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.
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.
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.
You can do whatever you want with the plugin, Dave. I edit the plugins I download all the time.