Want to say first off how great the CalendarScript is. When I receive my last donator's check I am going to get the $50 for it in as quickly as I can, definitely worth it, guys.
Anyway, I liked the mod for adding the ability to have colorized events (add event title allow color choice to display) but wanted to have small icons for various events too.
After playing around with the changes made in the above-mentioned thread I was able to use this as a starting point to adding code to reference small graphics. I think it came out well.
Basically I used the modification to DEFAULT.HTML but added the following right after the line:
$details->{'title'} = "<font color='" . $details->{'color'} . "'>" . $details->{'title'} . "</font>";
Added these lines - >
$bullet = "bullet|computer|malefemale|woman|beer|chili|burger|chickenleg|wheel|tractor|basketball|football|baseball|extinguisher|guitar|fish";
if ($details->{'icon'} =~ /$bullet/) {
$details->{'title'} = "<img src=http://www.myfilehut.com/userfiles/jeffcocalendar/" . $details->{'icon'} . ".gif border=0>" . $details->{'title'};
}
I then used the free image site, MyFilehut, and uploaded small icons corresponding to each item in the "$bullet=..." line (the ones divided by |).
Then I went into the Admin and "Customize Event Fields" and added an "icon" entry. For the "Input Type" I added "selectbox" and for each selection box I added one of the names of the above graphic icons (each one from the "$bullet=..." section) and made sure "Display in Add Field" was turned on.
Now I can select both the icon graphic as well as the color.
You can see the results at http://calendar.jeffcowebboard.com
I hope I explained this properly.
The next thing I will do is take out the line which has the names of all of the graphic icons and add a line to read a file containing these names instead.
*Edited previous message link*
[This message has been edited by DanO (edited April 18, 2005).]