PDA

View Full Version : Post 3 calendars on same page


dmoore1200
01-15-2004, 02:07 PM
Hi All, Was wondering if anyone has posted multiple calendars on the same page, all with different events.

Would I need to do 3 diff installs? or will 1 install with mods work?

Thanks

tomB
01-15-2004, 06:34 PM
Just one install should work fine. There are probably hundereds of different ways to do this. One way is to have three different text files or data tables, and pass to escal.php which you want for each calendar.

For example:

Calling code would be something like (simplified)

<table>
&nbsp; <tr>
&nbsp; &nbsp; &nbsp;<td> <?php $name_sel=1; include("escal.php"); ?> </td>
&nbsp; &nbsp; &nbsp;<td> <?php $name_sel=2; include("escal.php"); ?> </td>
&nbsp; &nbsp; &nbsp;<td> <?php $name_sel=3; include("escal.php"); ?> </td>
&nbsp; &nbsp;</tr>
</table>


in escal.php add

switch ($name_sel) {
&nbsp; &nbsp;case 1:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $textFile="file1.txt";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sqlTable="table1";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;
&nbsp; &nbsp;case 2:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $textFile="file2.txt";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sqlTable="table2";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;
&nbsp; &nbsp;case 3:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $textFile="file3.txt";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sqlTable="table3";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;
}


You may have to experiment a bit, but this is a general approach.

tomB