We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34084 ☆ A M B ☆
    • 756 Posts
    Quote from: neilp123 at Jul 01, 2010, 11:23 AM

    Hi there,

    This module seems to have cropped up just as I need a good one for MODx. Charles, thanks so much for your work, I’d like to make some sort of donation to you when I have it up and running.

    I’ve been following the instructions on the Google wiki, and all seemed to be going OK (I got it installed) until I tried adding a test event. Essentially, I added the event, and when I clicked the confirm button, I was just directed to a blank screen. Not sure what went wrong there. I’m trying to display a list of upcoming events at the moment, and am using the parameter mxcType=`list`. Not sure if this is the right one. Its not displaying anything right now, but I figured that might be because I’m not able to add any events!

    Hope you can help, and thanks again for building this. (I’m on 1.0.4 by the way)

    Cheers

    sorry to hear that your having issues

    there are a couple of core things I’d like for you to check on first:

    1. That there are four tables in the ModX site databse; _mxcalendar_categories, _mxcalendar_config, _mxcalendar_events, _mxcalendar_pastevents

    2. Validate the version of mxCalendar in the top right hand side of the module window

    if you send me a PM for access I can take a closer look as well.

    ~cheers
      Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
      Visit CharlesMx.com for latest news and status updates.
      • 25132
      • 129 Posts
      Installation Problem huh

      Hmm, I am stukc. I think I followed all of the installation instructions and got as far as setting the new module to Run. But nothing else happens after that. It appear in my Module menu but when I click on it I am faced with a blank module window. I also never got the Installation Successful bit or can see a start button. Any idea what I am doing wrong?

      Thanks for your help. I am in the middle of doing up a site for a festival event and your calendar could be a God-sent!
        • 34084 ☆ A M B ☆
        • 756 Posts
        Quote from: rivendell48 at Jul 01, 2010, 03:03 PM

        Installation Problem huh

        Hmm, I am stukc. I think I followed all of the installation instructions and got as far as setting the new module to Run. But nothing else happens after that. It appear in my Module menu but when I click on it I am faced with a blank module window. I also never got the Installation Successful bit or can see a start button. Any idea what I am doing wrong?

        Thanks for your help. I am in the middle of doing up a site for a festival event and your calendar could be a God-sent!

        have you checked your folder and file permissions to make sure they are set so that folders are 755 and files are 644. verify that all files from the package zip file are present. then check the reports > system events log for any errors pertaining to mxCalendar.

        make sure that there are no PHP tags around the module code.

        if you still have issues then please post back your system information; php version, web server and version, mysql version

        cheers
          Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
          Visit CharlesMx.com for latest news and status updates.
          • 25132
          • 129 Posts
          From what I can see everything is in order as per your suggestions. But I will now delete everything and start again from scratch just in case. If I still have the same issue, I’ll post back with set-up details. Thanks!
            • 25132
            • 129 Posts
            Nope, everything not in order after all. Client on an old hosting platform and not running PHP5! So will move everything to a different host and take it from there. Thanks for your reply and will keep you informed of how I’m getting on!
              • 25132
              • 129 Posts
              Ok, up and running now. Looking forward to playing around with this. Looking great!
                • 34084 ☆ A M B ☆
                • 756 Posts
                NQuote from: rivendell48 at Jul 03, 2010, 06:04 AM

                Ok, up and running now. Looking forward to playing around with this. Looking great!

                Great let me know if you have any problems

                Enjoy

                Cheers
                  Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                  Visit CharlesMx.com for latest news and status updates.
                  • 97
                  • 5 Posts
                  Hi!

                  I followed the installation instructions and got everything installed without error. When I go to my template and add [!mxcalendar?!] it kills the page render. The moment i remove the snippet call, my page renders normally. What could be causing this?

                  I’m a modX/PHP newb, so its very likely I am missing something...

                  Thanks for the help!
                    • 41824
                    • 19 Posts
                    Quote from: charless at Jun 29, 2010, 10:58 PM

                    Quote from: the_piper at Jun 28, 2010, 04:44 AM

                    However, does anyone have any ideas on how I can get two instances of this to work on a single page? It will only use the parameters of the last call on the page for all page calls.

                    Yes, this is a known item. The root cause is how the place holders are handled and I’m working on solving that so that a single page can have multiple instances of the mxcalendar running.

                    Sorry there is not a quick fix for all of them. If your just using the Event List view let me know and we can get a custom solution in place for you.

                    cheers

                    Ok I might have a solution or workaround for this. I’ve been working on this for days and have narrowed it down to caching. I’ve duplicated the classes, duplicated the snippets, re-named variables, etc and I always got the parameter set from the final call to apply to all calls. Just for the hell of it I tried calling the first instance like this:

                    [[mxcalendar? &mxcType=`list` &mxcTplEventListItemWrap=`home_marquee_inner` &mxcEventListMaxCnt=`1` ]]


                    And the second like this:

                    [!mxcalendar? &mxcType=`list` &mxcEventListMaxCnt=`3` !]


                    Voila! I was astounded on refresh to see the page lay out like I wanted it to! However, I don’t yet know what will happen after the date of the next event passes. Because it’s using the double brackets, will it not update? Maybe I’m celebrating prematurely. I’ll have to wait a day to see if my test works.

                    Update: Although it printed as I wanted, because the snippet was cached, it’s not going to update properly. I got multiple instances working, with some serious hacking. Here’s a breakdown of how I got it working:

                    1) I’m calling the custom snippets with no parameters
                    [!myCal1!], [!myCal2!]

                    2) I’m creating my own array in the snippet call and hard coding the parameters, as well as hard coding the amount of items to show ($x)

                    [!myCal1!]

                    $myCal = array(
                      
                     'mxcType'=>'list',
                     'mxcTplEventListWrap' => null,
                     'mxcTplEventListItemWrap' => null,
                     'mxcTplEventListFirstItemWrap' => null,
                     'mxcEventListMaxCnt' => '3'
                     
                    );
                    
                    $x = 3;
                    
                    
                    //**** Build the core class ****//
                    if (class_exists('mxCal_APP_CLASS')) {
                       $myCalApp = new mxCal_APP_CLASS();  //-- second instance
                       $myCalApp->output='';
                       //**** Return the calendar component ****//
                       return  $myCalApp->MakeCalendar($myCal, $x) ;  //. $mxCalApp2->MakeCalendar($bsCalParams);
                    } else {
                       //**** Return error *****//
                       return 'error: mxCalendar class not found';
                    }
                    


                    [!myCal2!]

                    
                    $myCal2 = array(
                      
                     'mxcType'=>'list',
                     'mxcTplEventListWrap' => null,
                     'mxcTplEventListItemWrap' => 'home_item_chunk',
                     'mxcTplEventListFirstItemWrap' => null,
                     'mxcEventListMaxCnt' => '1'
                     
                    );
                    
                    $x = 1;
                    
                    
                    //**** Build the core class ****//
                    if (class_exists('mxCal_APP_CLASS')) {
                       $myCalApp2 = new mxCal_APP_CLASS();  //-- second instance
                       $myCalApp2->output='';
                       //**** Return the calendar component ****//
                       return  $myCalApp2->MakeCalendar($myCal2, $x) ;  //. $mxCalApp2->MakeCalendar($bsCalParams);
                    } else {
                       //**** Return error *****//
                       return 'error: mxCalendar class not found';
                    }
                    


                    Then I had to modify the class to accept my $x value instead of using the ’mxcEventListMaxCnt’.

                    It STILL wasn’t working at this point so I removed return$this->output; (line 1278) and replaced with:
                    return $events;

                    I’m not sure what is wrong with return$this->output;, but output is what’s screwing this up. Output seems to contain the amount of items from the final calendar call, no matter what you do. I tested this and the for loops recurse the amount of times you ask them to, that’s why returning $events yields the desired result. This probably isn’t a solid fix for this problem, but it is now doing what I want it to do, so I’m happy.
                      • 41824
                      • 19 Posts
                      Found an issue and I have a fix:

                      ISSUE: Values entered in the event as Link REL and Link TARGET do not get printed.

                      FIX: Change function multisort (line 1285) in mxCalendar.class.php from this:

                      		//--Add mutli-dimensional sorting
                      		function multisort($array, $sort_by, $key1, $key2=NULL, $key3=NULL, $key4=NULL, $key5=NULL, $key6=NULL, $key7=NULL, $key8=NULL){
                      		    // set order
                      		    foreach ($array as $pos =>  $val)
                      			$tmp_array[$pos] = $val[$sort_by];
                      		    asort($tmp_array);
                      		   
                      		    // display the order you want
                      		    foreach ($tmp_array as $pos =>  $val){
                      			$return_array[$pos][$sort_by] = $array[$pos][$sort_by];
                      			$return_array[$pos][$key1] = $array[$pos][$key1];
                      			if (isset($key2)){
                      			    $return_array[$pos][$key2] = $array[$pos][$key2];
                      			    }
                      			if (isset($key3)){
                      			    $return_array[$pos][$key3] = $array[$pos][$key3];
                      			    }
                      			if (isset($key4)){
                      			    $return_array[$pos][$key4] = $array[$pos][$key4];
                      			    }
                      			if (isset($key5)){
                      			    $return_array[$pos][$key5] = $array[$pos][$key5];
                      			    }
                      			if (isset($key6)){
                      			    $return_array[$pos][$key6] = $array[$pos][$key6];
                      			    }
                      			if (isset($key7)){
                      			    $return_array[$pos][$key7] = $array[$pos][$key7];
                      			    }
                      			if (isset($key8)){
                      			    $return_array[$pos][$key7] = $array[$pos][$key8];
                      			    }
                      			}
                      		    return $return_array;
                      		    }


                      to this:

                      		//--Add mutli-dimensional sorting
                      		function multisort($array, $sort_by, $key1, $key2=NULL, $key3=NULL, $key4=NULL, $key5=NULL, $key6=NULL, $key7=NULL, $key8=NULL, $key9=NULL){
                      		    // set order
                      		    foreach ($array as $pos =>  $val)
                      			$tmp_array[$pos] = $val[$sort_by];
                      		    asort($tmp_array);
                      		   
                      		    // display the order you want
                      		    foreach ($tmp_array as $pos =>  $val){
                      			$return_array[$pos][$sort_by] = $array[$pos][$sort_by];
                      			$return_array[$pos][$key1] = $array[$pos][$key1];
                      			if (isset($key2)){
                      			    $return_array[$pos][$key2] = $array[$pos][$key2];
                      			    }
                      			if (isset($key3)){
                      			    $return_array[$pos][$key3] = $array[$pos][$key3];
                      			    }
                      			if (isset($key4)){
                      			    $return_array[$pos][$key4] = $array[$pos][$key4];
                      			    }
                      			if (isset($key5)){
                      			    $return_array[$pos][$key5] = $array[$pos][$key5];
                      			    }
                      			if (isset($key6)){
                      			    $return_array[$pos][$key6] = $array[$pos][$key6];
                      			    }
                      			if (isset($key7)){
                      			    $return_array[$pos][$key7] = $array[$pos][$key7];
                      			    }
                      			if (isset($key8)){
                      			    $return_array[$pos][$key8] = $array[$pos][$key8];
                      			    }
                      			if (isset($key9)){
                      			    $return_array[$pos][$key9] = $array[$pos][$key9];
                      			    }
                      			}
                      		    return $return_array;
                      		    }