Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > Integration > Mambo/Joomla Integration

Mambo/Joomla Integration Information about integrating the calendar with the Mambo Content Management System.

Closed Thread
 
Thread Tools Search this Thread Display Modes

minical and $showCat Issue...
Old 02-16-2011, 11:42 AM   #1
metalshaper
not quite smart enough...
 
metalshaper's Avatar
 
metalshaper is offline
Join Date: Jan 2010
Location: Northwest CT USA
Posts: 10
Default minical and $showCat Issue...

Hey Gurus,

I'm having another issue with two minicals on the same joomla page.

Background:
Ve9gra was awesome and got me sorted on my first issue that is in another post. Now I seem to have another issue. My $showCat[s] are working but in a funny way.

System:
joomla 1.5.18 windows server
PHP 5.2.9-1
Single MySQL5 DB
EPHPCAL 6.4.0 single install [need to update to 6.4.1 I know]
mod_escal latest version. One mod for each calendar.
  1. mod_ephpcal for town events [town hall calendar]
  2. mod_ephpcal_events for local events [event calendar]
I have two minicals on all pages.
  1. town hall calendar
  2. event calendar
I have categories setup in the admin.


For each calendar/module the filter results that I have added to $showCat.

1. cal/mod townhall

$CSS=1;
$showCat="1|3|4";
require ("calendar/calendar.php");
$OL=1;
require ("calendar/calendar.php");
switch($jm_epccaltype)
{
case "mini":




2. cal/mod event calendar

$CSS=1;
$showCat="a|2|6";
require ("calendar/calendar.php");
$OL=1;
require ("calendar/calendar.php");

switch($jm_epccaltype)
{
case "mini":



So here's what is not working. Even with the $showCat[s] set, the events calendar shows town hall events and NOT the categorized events for that calendar.

check it here http://www.sharonct.org

So, is there a solution? Am I not doing this correctly? Should I install a second calendar and reference that in the mod?

TIA

Joel
 

Old 02-16-2011, 02:40 PM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Can you make this work on the demo.php file (trying to eliminate Joomla as the issue)?
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 02-16-2011, 04:58 PM   #3
metalshaper
not quite smart enough...
 
metalshaper's Avatar
 
metalshaper is offline
Join Date: Jan 2010
Location: Northwest CT USA
Posts: 10
Default

Thank you Brian for the reply,

I get the same behavior on the demo page when I add a second minical and apply filters to both. http://sharonct.org/calendar/demo.php

The first instance seems to set the popup display to its' filter. Yet the second displays the correct legends for its' filter. Could be I need an "unset" somewhere but I don't know where.

Joel
 

Old 02-16-2011, 05:52 PM   #4
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

What happens if you reverse the order of the calendars?

You might want to search the forum for unset and try the various suggestions. Off the top of my head right now, I don't remember what they are. (Note to self: Make a FAQ...)
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 02-17-2011, 07:14 AM   #5
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

I see... it's the popups that aren't working like expected. And I can tell you why.

When the require() for the small calendar gets called, that's when the JavaScript function popupEvent gets added to the page.

This is the function for your first calendar:
HTML Code:
<script type="text/JavaScript">
<!--
function popupEvent(ev, w, h) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  win = window.open("/calendar/functions/popup.php?ev=" + ev + "&showCat=1|3|4&oc=1","Calendar","scrollbars=yes,status=no,location=no,toolbar=no,menubar=no,directories=no,resizable=yes,width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winl + "");
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
  }
//-->
</script>
Then you get your second calendar on the page... and the second popupEvent
HTML Code:
<script type="text/JavaScript">
<!--
function popupEvent(ev, w, h) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  win = window.open("/calendar/functions/popup.php?ev=" + ev + "&showCat=a|2|6&oc=1","Calendar","scrollbars=yes,status=no,location=no,toolbar=no,menubar=no,directories=no,resizable=yes,width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winl + "");
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
  }
//-->
</script>
Now, on the days that have events, they call the function like this
HTML Code:
onclick="popupEvent(2455614,250,220)"
The first variable is the day to show in the popup, and the other two are for the size of the popup. Now, when you look in the function, you see that the $showCat has been added in there.

What do you think happens when something on a page calls a function that has been declared twice?

Yup... it takes the first one.

So, your only fix is to not use on-click popups. However, Joomla doesn't play nice with mouse-over popups either as the variables required don't get declared properly.

Rock, meet hard place.

I would say your best bet is in trying to figure out how to fix Joomla so that the variables get called properly for the mouse-overs, because there's no fixing the other popups.

Alternatively, you could run your calendars in small iframes...
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 02-17-2011, 11:56 AM   #6
metalshaper
not quite smart enough...
 
metalshaper's Avatar
 
metalshaper is offline
Join Date: Jan 2010
Location: Northwest CT USA
Posts: 10
Default

@Brian

I tried that and the result is reversed. So 1st cal sets the function for the 2nd as well.

@ Ve9gra

I noticed the same thing as I was digging through the source.
Now I have a clearer understanding of what's happening. Thank you for your explanation.

So I will have to figure some other way to get this to work. iFrames may be the ticket. I will give that a try. If not, I may just link to a separate page altogether for the local events and not try to display a minical. If I do find a way to fix joomla mouseovers I will post my solution here for others.

Still love the calendar though!

Thanks Brian and Gervais for the help!
 

Old 02-17-2011, 08:44 PM   #7
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

The problem is with what I call "function variable isolation". Because Joomla uses a function to parse the PHP, stuff that you declare in the page isn't passed to the rest of the page because it gets segregated to the parsing function.

One way that you can try is by adding
PHP Code:
require("calendar/config.inc.php"); 
before the
PHP Code:
require("calendar/calendar.php"); 
in each section. This might work, but only if Joomla didn't replace the require() function too.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi $ShowCat on one page AGouldstone Customizations (Themes / Templates) 1 11-02-2010 04:02 PM
trouble with $showCat.. diff b/t Categories and Selections?? sholt@utm.edu Customizations (Themes / Templates) 1 09-14-2009 08:08 AM
problem w/ $showCat variable plantsheal General Support 2 08-04-2009 11:07 AM
$showCat does not work dfgtyx General Support 1 09-10-2007 01:05 PM



All times are GMT -4. The time now is 08:42 AM.


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

| Home | Register | Today's Posts | Search | New Posts |