WebCal 101

I installed WebCalendar 1.0.1 today so I could check it out (the new beta Mozilla Sunbird deleted my calendars). And it's a pretty cool little webapp. After a little while of playing around I realized I wanted to have images in my pop up descriptions. But that won't work right if the image is big - the default width of the pop up is 300px.

So, my solution to the problem is a quick hack that will scale the image down when your viewing the event from the event tool tip pop ups.
When we're done you'll be able to enter an image into your event description using the BBCODE [img][/img] tags and the script will take care of everything else. The hack is very basic and only requires a small edit to two of the files - you should be looking in the base webcal directory. The first edit is in the file view_entry.php on line 443 insert this PHP code: $description = str_replace("[img]", "\"image\"", $description);

Now, in the file /includes/functions.php insert the following code at line 1185: $description = str_replace("[img]", "<img xsrc="$url", $description); $description = str_replace("[/img]", "" width="250" alt="image" />", $description);

And by insert I mean go to that line hit enter once or twice to move everything else down and then paste this code on that line. And that's it... Easy huh? What's it do? Well, when the description is pulled from the database it replaces the BBCODE image tags with the proper html to display in your browser. However, in the short pop up description the width of the picture is limited to 250 pixels. This gives us a nice scaled image when looking at the pop up and keeps the full size image when looking at the full description. And that's all for now. edit: opps on the code not showing up - it's fixed now.