#b2 daily quotes#
Written by Mike W @ www.dhtmlshock.com.
Adjusted by Sigg3.net for integration to the b2 system.
that rotates based on the day of the month.
Create a file with the following code and call it b2quotes.php:
Then copy it to your server and CHMOD it 766, so you can edit it in b2's "edit template" page.
In the of your b2 template file (e.g. index.php, b2.php etc.) put this line:
And where you want the script to display your quote:
As you can see, the set-up is quite simple. Each line is one day of the month and it is ended by a semicolon;
msg = "«A day without sunshine is like, you know, night.»
If you want to use " instead of « and », you should use the correct HTML 4.01 " entity.
This would display this on the 1st of Month:
«A day without sunshine is like, you know, night»
You should update your quotes on a regular basis. A good source for free quotes is http://en.wikiquote.org/wiki/Main_Page
What you must keep in mind is to never remove any of the "s in the script, but remove any "s from the quote itself.
If your quote is "There ain't no such thing as a free lunch." by John Randolph
and you want it to be displayed on the 4th day of the month, the line would be:
msg = ""There ain't no such thing as a free lunch." by John Randolph";
so you should either use " for ", « for « and » for » or just leave it as it is.
(for a full list see the HTML 4.01 entities reference at http://www.w3schools.com/html/html_entitiesref.asp)
The script can also be modified to display different pictures, links etc. since it is fully html customizable.
If you get any errors or your quotes are not displayed, you've probably just messed up the "s.
This script is copyrighted by Mike W. at www.dhtmlshock.com
Original source: http://www.dhtmlshock.com/scrollers/DailyTip/default.asp