Easy PHP Calendar

Easy PHP Calendar (http://www.EasyPHPCalendar.com/forums/index.php)
-   Mambo/Joomla Integration (http://www.EasyPHPCalendar.com/forums/forumdisplay.php?f=24)
-   -   popup path issue (http://www.EasyPHPCalendar.com/forums/showthread.php?t=11311)

metalshaper 11-14-2010 11:09 PM

popup path issue
 
Hey Gurus,

Got nothing but love for ephpcal! It does everything I need it to do! Love it so much I bought 2!

I was asked to add a second calendar just for events. OK. No problem. Admin works great. Add/Edit/Remove events no problem.

Got a funny issue here with popups on mini cals and the path for the url that creates the popup.

Background:
mod_escal
Joomla 1.5.8
Microsoft-IIS/6.0
PHP 5.2.9-1
http://sharonct.org
Two calendars in different directories [each with its own license]
Town Hall is MySQL
Events is flatfile [for now]

Issue:
The path for the popups for each calendar are the same. In other words, when a user clicks a date in the "Town Hall Calendar" they get the appropriate event info. When a user clicks a date in the "Events Calendar" they get a popup but with no event info.

The URL in the popup for "Town Hall Events" is:
hxxp://sharonct.org/calendar/functions/popup.php?ev=2455513&showCat=&oc=1

The URL in the popup for "Event Calendar" is the same. It looks like it is pulling the event data from the wrong path. There is no event data for that date in the SQL for the "Town Hall" If I change the URL to reflect the correct path [event_calendar/functions/] it works and shows the events. If I add event data for that date on the "Town Hall" it shows up for the "Event Calendar".

I read elsewhere in the forum that two calendars on the same page = bad idea. So I turned off the "Town Hall" module and left the "Event Calendar" module. Now I figured it would be just fine. Nope. Same URL in the popup. OK check my calendar.php and server path is good. My urlPath is good.

Also I checked the source and each mini cal shows a different path:

Town Hall:
function popupEvent(ev, w, h) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; win = window.open("/calendar/functions/popup.php?

Event Calendar:
function popupEvent(ev, w, h) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; win =window.open("/event_calendar/functions/popup.php?

So now I'm confused. Anyone have any ideas?

TIA

Joel

ve9gra 11-15-2010 07:30 AM

That is because the function popupEvent is declared twice. Since only the first declaration is used, you'll never get the second popup.

Did you do two installs because it's different people that need to manage the events, without having access to the "other side"? If not, you have no reason to have two installs. Simply create a sub-category that will define which calendar this event is meant for. Then on your page, use the $showCat variable to limit the display of each calendar.

That way, you have everything running off a single installation, and then your popups would work fine :)

If you need help getting this working, we're here.

metalshaper 11-15-2010 01:59 PM

Thanks ve9gra.

Just so I can try to understand,

--That is because the function popupEvent is declared twice. Since only the first declaration is used, you'll never get the second popup.

Even if I turn off the module for the "working" calendar?

--Did you do two installs because it's different people that need to manage the events, without having access to the "other side"?

Yes. But I can work around this requirement.

--Simply create a sub-category that will define which calendar this event is meant for.

OK. I think I will need some guidance here....

--Then on your page, use the $showCat variable to limit the display of each calendar.

So would this be adding the $showCat variable to the mod_escal.php?

I do think I will need some help with this.

TIA

Joel

ve9gra 11-15-2010 04:22 PM

Quote:

Originally Posted by metalshaper (Post 38820)
Even if I turn off the module for the "working" calendar?

I don't know. It's been a while since I've worked with Joomla, but I seem to remember having to clear the output cache several times before being able to see code changes in the plugin.
Quote:

Originally Posted by metalshaper (Post 38820)
Yes. But I can work around this requirement.

That's good. If it's not a problem for the users to see "each other's" events, then it should work fine.
Quote:

Originally Posted by metalshaper (Post 38820)
OK. I think I will need some guidance here....

Setup Manager - Categories. You'll find "New Category" at the bottom. Add an entry like "Show on Event Calendar", and then add a selection of "Yes" to that new category. When you enter your events, by selecting Yes for that field, it will show the entry on the Event Calendar.
Quote:

Originally Posted by metalshaper (Post 38820)
So would this be adding the $showCat variable to the mod_escal.php?

I do think I will need some help with this.

This works with the category you just created. You'll set the $showCat inside of each of the mod_escal (you'll need two) so that each calendar only shows the proper list of events. See the Online Docs in the Customize - Command-Line Variables section. You'll find how to use $showCat.

metalshaper 11-16-2010 11:06 AM

OK. Thanks ve9gra!

I went through the docs. Should I add $showCat="x|x|x" before each instance of require("calendar/calendar.php");? or do I add it before the require at or around line 37-39? And to have a clear understanding, I need the pipes for multiple cats right? I know it should be obvious but I'm just checking.

================================================
Here is a snippet:

$jm_epclistYear=$params->get('listYear', 0);
$jm_epclistEvents=$params->get('listEvents', 0);
$jm_epcnoOld=$params->get('noOld', 0);
$jm_epcTemplate=$params->get('epcTemplate', 0);

$jm_epcListMouseover=$params->get('ListMouseover', 0);
$jm_epctocListMouseover=$params->get('tocListMouseover', 0);
$CSS=1;
require ("calendar/calendar.php");
$OL=1;
require ("calendar/calendar.php");
$showCat="2";
require ("calendar/calendar.php");
<--here?
switch($jm_epccaltype)
{
case "mini":

if($jm_epcnoNavMini)
{
$noNav="1";
}
if($jm_epcnoEventsMini)
{
$noEvents="1";
}
require ("calendar/calendar.php"); <--or here?
break;

================================================

I had two mod_escal modules to start with so I will mod each to reflect the categories that need display respectively.

Joel

metalshaper 11-16-2010 06:22 PM

OK. Got that sorted! Thanks Gervais!

+1 to ve9gra

ve9gra 11-16-2010 07:18 PM

Great to hear! If there's anything else, don't hesitate.


All times are GMT -4. The time now is 09:44 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.