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.

How to Handle Multiple Flat File Calendars (Version 5)

Discussion in 'General Support' started by jchilders, May 23, 2006.

Thread Status:
Not open for further replies.
  1. FYI anyone searching for this solution.

    I had a problem with creating my own flat file calendars on the fly to support multiple calendars (i.e. one for each user): the popups wouldn't synch with the list or the view. I would get errors of various kinds.


    Anyway, here's the trick. Turns out that the problem is that all the little subroutines in the calendar program re-read the filename from the config file. So, you just have to create a session variable and then modify the config.inc.php in the escal folder like so:

    PHP:
    // MCS/SJC Modification to config file for multiple calendars
    $instantFileName $_SESSION[instantfilename];  // add this line
    $readFile="1";
    $flatFileName= (isset($instantFileName) ? $instantFileName "esdates.txt");  // add this line
    //$flatFileName= "esdates.txt";  // comment out this line
    Then, in your calling code, just set the session variable to whatever the current flat file you want to use is before instantiating the calendar:

    PHP:
    $_SESSION[instantfilename] = $currentFileName;
    It would have been nice to have heard from the dev on my repeated inquires for help on this forum. Oh well.
  2. Brian

    Brian EPC Developer Staff Member

    To anyone that may read this thread, this is for Version 5.5 and would not work with Version 6.

    Version 5.5 was released almost two years ago and is no longer supported. (http://www.easyphpcalendar.com/forums/showthread.php?t=2424)

    Additionally, this type of modification wouldn't be "officially" supported.

    :)
  3. Brian,

    Oh, so you want an 'elegant' solution? :) <lol>

    What if instead of entering "esdates.txt" in the admin interface, you entered something like "$_SESSION[somevar]" or "$someOtherVar". Wouldn't PHP evaluate it at runtime to whatever your calling code set it to? I'm away from my dev machine at present or I'd give it a try.

    Anyway, if this works, you wouldn't need to modify the config file and wouldn't run the risk of stepping on the changes later...?

    Regards,

    Jeff
Thread Status:
Not open for further replies.

Share This Page