Multiple Calendars in Blog mode
Posted by ve9gra | Filed under Tutorials
Have you ever wanted to display more than one little calendar in blog mode? Follow along as we make very few modifications to enable such a functionality.
So you’ve been using the blog mode and you realize that most of your visitors want to see upcoming events. Would it be useful to them to display the next month calendar so they could pick the day right from there?
I’m sure you could find other uses for this functionality, but here’s how you enable it.
First, you have to modify your /calendar/calendar.php file. As of the current version (v6.2.23) insert the following around line 126.
if ($MULTIBLOG==1) { $EPCBLOG=1; }
After the modification, the section should look like this
// SHOW MULTIPLE CALENDARS
if ($MULTI==1) {
if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
if ($MULTIBLOG==1) { $EPCBLOG=1; }
require($serverPath."plugins/multiShow.php");
$MULTIX=1;
}
Lastly, in the same file, you’ll want to add $MULTIBLOG to the unset on the last line.
unset ($CSS,$PCSS,$OL,$LIST,$TOC,$MULTI,$MULTIX,$MULTIBLOG);
The modifications are now complete. We’ll move on to the implementation or how we’ll end up using those modifications.
Instead of using the $EPCBLOG=1; section as usual, we’ll combine the $MULTI command and our modifications. You can modify the output by using the same variables that the multi-calendar generator uses. So here’s our example of a way to do it.
$MULTI=1;$MULTIBLOG=1;
$epcMultiWidth = "205px";
$epcMultiPad = 10;
$epcMultiNav = "200px";
$epcMultiCol = 1;
$epcMultiRow = 2;
require("calendar.php");
Note that this doesn’t change anything as far as the listing part of the blog mode works. You still have to have the $EPCBLOG=2; section for the Blog mode to work properly.
Later on, I will post a link to a working example and some screenshots.
Tags: Integration
