PDA

View Full Version : Multiple Calendars on Module-iframe Page OR using TOC mode alone?


drdan01
04-03-2010, 08:13 PM
I've got a couple of things I'm trying to work out and hoping that someone might know enough about the php side of things to see what I might need to do.

I've just recently installed the calendar, having found a way to create a module and then load the calendar using iframe. What I haven't been able to do is to either have just the TOC mode alone or alternately have both the normal mode (3-month view) and the TOC mode both on the same page. I tried to add the TOC code to the module I wrote, but haven't successfully figured out how to make it work integrating it into that (ended up with both calendars on the page, but the TOC was lacking in any CSS while the normal mode looked fine.

Here's the module code that I've got, integrating the calendar using iframe:

<?
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if(!IsSet($mainfile)) { include ("mainfile.php"); }
$index=0;

$go_to_address1="http://www.kmpro.org/calendar/events/index.php";
$go_to_address=rawurldecode($go_to_address1);
include("header.php");
OpenTable();
echo "<center><h4><a href=\"index.php\">Click to close.</a></h4></center>";
echo "<iframe SRC=\"".$go_to_address."\" width=\"100%\" height=\"1200\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>";
echo "<br><center>NB. Using iframes!</center><br>";
CloseTable();
include("footer.php");
die;
?>



And for trying to get the TOC, I tried this code (tried it in a couple of different places, none worked properly):

<?php
$TOC=1;
require ("calendar/calendar.php");
?>


Frankly, I thought about simply trying to bring the TOC version into the iframe by itself (more on that below) but the only way that I can seem to access that is through: http://www.kmpro.org/calendar/demoTOC.php

Which would seem to work...I think....but I'd need to edit the demo.php file to eliminate the other links on the page that I wouldn't want showing (Setup Manager, Event Manager, Instructions). But it would seem that there must be "another" absolute link for the TOC mode that I should be able to get to?

And two other quirky issues that have me wondering which mode/version to use is that....in the normal mode if I add an html link to the event description, it does not appear then in either the popup box or in the event listings below the calendar. But the popup box remains open until closed. AND in the TOC mode, the popup box opens then auto-closes so that you cannot get to the link in that popup box...but the link does appear in the event listing below the calendar. So something is obviously different in both of those mode -- the normal mode can't have a link in the events popup and it won't show below; the TOC mode has the link in the event popup but you can't get to it, and has the link in the list. Which is driving me nuts.

So I'd love it if someone familiar with php could look at my module and offer up a suggestion on how to get them both there. And would also appreciate hearing from anyone who has resolved the whole popups not staying open in the TOC mode and links not showing in normal mode.

ve9gra
04-04-2010, 03:49 AM
Like I said in your other thread, do not use the /events/index.php link, as an external user would never be able to see the calendar.. they'd have to login to see it. Stick with the demoX.php files. Have a look inside of demoTOC.php and comment out the section for the List mode.

Do not add the code for the TOC itself, as then you'll end up with two calendars like you did before. Change the link in the iframe to the demoTOC.php and change the code inside of that file.

drdan01
04-04-2010, 08:43 AM
Thanks, all that works great!

The only thing that I have left is related to the event popup box that opens then auto-closes so that you cannot get to the link in that popup box...but the link does appear in the event listing below the calendar. Is there a way to cause that popup window to remain open until user selects to close it?

drdan01
04-04-2010, 09:09 AM
Never mind -- forgot that I'd turned that off in the admin, back on and works fine! I'm now just down to playing around with CSS and such. Thanks for the help!