1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

popup path issue

Discussion in 'Mambo/Joomla Integration' started by metalshaper, Nov 14, 2010.

Thread Status:
Not open for further replies.
  1. metalshaper

    metalshaper not quite smart enough...

    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
    Last edited: Nov 14, 2010
  2. ve9gra

    ve9gra Support Team

    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.
  3. metalshaper

    metalshaper not quite smart enough...

    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
  4. ve9gra

    ve9gra Support Team

    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.
    That's good. If it's not a problem for the users to see "each other's" events, then it should work fine.
    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.
    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.
  5. metalshaper

    metalshaper not quite smart enough...

    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
  6. metalshaper

    metalshaper not quite smart enough...

    OK. Got that sorted! Thanks Gervais!

    +1 to ve9gra
  7. ve9gra

    ve9gra Support Team

    Great to hear! If there's anything else, don't hesitate.
Thread Status:
Not open for further replies.

Share This Page