We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26140
    • 11 Posts
    I just tested the Calendar. I have the default functioning at http://hostverde.com/calendar.html running in MODx.

    My question is with the demo: How do I get the popups working?

    I also am not able to get the list function working yet. Is there any documentation besides the demo site?
      • 3927
      • 16 Posts
      Chuck,

      if you are interested I can post the Ajax calls for the iCal example.

      I also found a little bug in calendar.inc.php on line 42
      	$url_arg	= '&';
      	if($modx->config['friendly_urls'] == 1) {
        		$arg = '?';
      	}
      	
      	$this_page .= $url_arg;


      should read

      	$url_arg	= '&';
      	if($modx->config['friendly_urls'] == 1) {
        		$url_arg = '?';
      	}
      	
      	$this_page .= $url_arg;

        • 34017
        • 898 Posts
        @boudie,

        Thanks, I’ll update the repo with that when i get a chance.

        @american idol
        in your ical template, add jquery 1.3 and make sure the javascript is pointing to the right place.
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 29539
          • 1 Posts
          I am using your code (thank you!!) for a new website I just launched, and on the testing site I used to build it, it worked perfectly, but when I moved it to the actual domain the site is hosted on, the code just STOPS when it gets to the calendar code.

          UPDATE:
          Nevermind..... problem solved! Looks like it had to do with the difference between php 4.3 and php 5 on the two different servers.
            • 34017
            • 898 Posts
            tessalr,

            What did you have to fix it?
              Chuck the Trukk
              ProWebscape.com :: Nashville-WebDesign.com
              - - - - - - - -
              What are TV's? Here's some info below.
              http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
              http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
              • 21419
              • 84 Posts
              Chuck,

              Fantastic Calendar!

              I am using the iCal template and the Lists on the same page template (http://goode.bigheadservices.com/our-restaurants/the-armadillo-palace/the-armadillo-palace-event-calendar.html) and am wondering if there is a way to make the list update as the user navigates month to month. Right now, I have the listing for the next 10 days showing up properly for October, but November’s list is empty.

              Any ideas?
                • 1432
                • 1 Posts
                I see that one of the parameters allows this code to run on PHP5 w/o Modx. I’m having trouble getting this demo to run. I installed the demo here: http://gsis.amystoddard.com/chuck/demo/

                The full path to that folder is: /home/amystodd/public_html/dev/gsis/chuck/demo/

                I edited line #2 in "calendar.inc.php" to be:
                $basePath = ’/home/amystodd/public_html/dev/gsis/chuck/demo/calendar/’;

                The demo isn’t coming up. Did I do something wrong? Or will this not run at all on my server cause I’m not using ModX?

                Thanks for any help you can offer.

                .amy
                www.amystoddard.com
                  • 34017
                  • 898 Posts
                  Have you made your google calendar public? and does it work with the default holiday calendar?
                    Chuck the Trukk
                    ProWebscape.com :: Nashville-WebDesign.com
                    - - - - - - - -
                    What are TV's? Here's some info below.
                    http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                    http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                    • 21419
                    • 84 Posts
                    I’ve been trying to figure out a way to limit the results in the listing and have come up with a semi-solution I wanted to share as it works, but is not really the best solution. Hoping someone smarter can run with the idea a bit and come up with a solution that might actually rely on event counts rather than day counts.

                    In calendar.inc.php:

                    1. I created a new parameter in /*Snippet Parameters*/
                    $dayplus = (isset($dayplus)) ? $dayplus : 10;


                    2. I set 2 new variables
                    $todaysDate = date("j");
                    $expDate = date($todaysDate + $dayplus);


                    3. I created a new .tpl file (called ’eachEventHide.tpl’) in the list template I am using and set the display of the li to "none"
                    <li style="display:none;"></li>


                    4. I duplicated the if($display == ’list’), creating a display type called ’finitelist’ and added and new tpl to handle the events outside the date range
                    $tpl['eachEventHide'] = file_get_contents($basePath. 'templates/' .$template. '/eachEventHide.tpl');


                    5. Then added an if statement that limits the list output to Today’s Event through X Days From Now (expDate)
                    if(($eventDate < $todaysDate) || ($eventDate > $expDate)) {$eachEvent = $tpl['eachEventHide'];}


                    6. Last, I added my new parameter and changed the display type in my Calendar snippet tag
                    [!Calendar? &emails=`[email protected]` &display=`finitelist` &dayplus=`7` &limit=`600` &template=`list-template-name`!]


                    Full "Finite List Code
                    /* Beginning of Finite List Output */
                    if ($display == 'finitelist')
                    {
                        $tpl['wrapper']      = file_get_contents($basePath. 'templates/' .$template. '/wrapper.tpl');
                        $tpl['eachEvent']    = file_get_contents($basePath. 'templates/' .$template. '/eachEvent.tpl');
                        $tpl['eachEventAlt'] = file_get_contents($basePath. 'templates/' .$template. '/eachEventAlt.tpl');
                        $tpl['eachEventHide'] = file_get_contents($basePath. 'templates/' .$template. '/eachEventHide.tpl');
                    	
                        if ($cal_dates)
                        {
                            $innerList = '';
                            for ($i = 0; $i < $limit; $i++)
                            {
                            	if ($cal_dates[$i]['startMonth'] == $month )
                            	{
                    				$eventDate = $cal_dates[$i]['startDay'];
                            		
                    	            if($i % 2) 
                    	            {
                    	                $eachEvent = $tpl['eachEvent'];
                    	            } else {
                    	                $eachEvent = $tpl['eachEventAlt'];
                    	            }
                    	            
                    	            if(($eventDate < $todaysDate) || ($eventDate > $expDate))
                    	            {
                    			$eachEvent = $tpl['eachEventHide'];
                    	            }
                    	            
                    	            foreach ($cal_dates[$i] as $key => $value)
                    	            {
                    	                $eachEvent = str_replace('[+' . $key . '+]', $value, $eachEvent);
                    	            }
                    	            
                    	            $innerList .= $eachEvent;
                            	}
                            	
                            }
                            
                            $output = str_replace('[+events+]', $innerList, $tpl['wrapper']);
                    
                        }
                    
                    }
                    /* End of List Output */
                    


                    You can see it in action http://www.goodecompany.com.php5-13.websitetestlink.com/index.html and http://www.goodecompany.com.php5-13.websitetestlink.com/our-restaurants/the-armadillo-palace/the-armadillo-palace-event-calendar.html.

                    Hope this helps somebody.
                      • 27731
                      • 9 Posts
                      I’m trying to use this snippet, but it does not format the calendar at all.

                      In my faulttracing I’m down to this snippet call:

                      [!Calendar?!]


                      This gives me a result shown in enclosed pic.

                      The installation is done purely according to the instructions (at least to my knowledge...).

                      Why does it become this way?

                      I can mention that I’ve tried many variants of snippet call. In all variants it gets in principle the same - no fancy formatting.

                      Thanks in advance for replies!