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.
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.
Subscribe to shindakun dot net
Get the latest posts delivered right to your inbox