We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4675
    • 38 Posts
    Thank you. Have I said that I really like the module, and that it has so much potential?

    thanks again.
      • 18913
      • 654 Posts
      Hi,
      I’d like to use mxCalendar on a site that will have different managers logging and - ideally - managing different calendars. Can I accomplish that with mxCalendar? I’d like to have different types of calendars available on different pages on the site, but restrict who can edit what.

      This would be on Evo 1.0.5.

      If I’ve overlooked something in the new code and I could be enlightened, I’d be appreciative.

      TIA,
      Matt
        • 34084 ☆ A M B ☆
        • 756 Posts
        Currently "Manager" user roles inside mxCalendar are not supported. That stated with a fairly moderate amount of effort this could be achieve, but currently this is not an immediate effort. If your interested in a custom build to get you through your project send me a PM and we can review it in more detail.

        Cheers
          Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
          Visit CharlesMx.com for latest news and status updates.
          • 21419
          • 84 Posts
          I’m using version 1.3 on a client site as an event calendar for a music venue.

          http://www.goodecompany.com/our-restaurants/the-armadillo-palace/the-armadillo-palace-event-calendar.html

          The site had been using a Google Calendar feed and the client wanted more information and the ability to add images to the events. I found mxCalendar and saw that it would almost do everything I needed. But I wanted to be able to re-use performer information and images for different events so that recurring artists would be very easy to add to the calendar.

          I worked directly with Charles in order to set up a method to be able to re-use resources to provide details for the events and allow the use of TVs to create a fully-customizable calendar output. It’s incredibly flexible. The resources used to populate the calendar use the content and pagetitle for the basics and TVs for the art. The resources are available via a select field in the Add/Edit Event form as a Custom Field. You can add, delete and define the type of your own custom fields as needed and access any of them in the template.

          We’re also using the Listing output on the Home Page of the site. The client loves it. It’s a fantastic module.
            • 34084 ☆ A M B ☆
            • 756 Posts
            thanks so much for sharing, what a great example of all the capabilities.

            if anyone else has some examples of how they are using mxCalendar and would like to share I’d certainly love to see them.

            thanks again to everyone for your support of mxCalendar.

            cheers
              Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
              Visit CharlesMx.com for latest news and status updates.
              • 4172
              • 5,888 Posts
              added a new table to mxcalendar for the repeating-events:

              CREATE TABLE `modx_mxcalendar_repeatings` (
              	`id` INT(10) NOT NULL AUTO_INCREMENT,
              	`repeating` DATE NULL DEFAULT NULL,
              	`eventid` INT(10) NULL DEFAULT NULL,
              	PRIMARY KEY (`id`),
              	INDEX `repeating` (`repeating`)
              )
              COLLATE='latin1_swedish_ci'
              ENGINE=MyISAM
              ROW_FORMAT=DEFAULT


              and this bit of code at the end of mxcalendars _saveEvent - function.

                                  $rep_table=$modx->getFullTablename('mxcalendar_repeatings');
                                  $modx->db->delete($rep_table,'eventid='.$NID);
                                  $repeatings = explode(',',$reOcc);
                                  if (count($repeatings)>0){
                                    $repeatings = array_merge(array($fields['startdate']),$repeatings);  
                                    foreach ($repeatings as $rep){
                                        $fields = array();
                                        $fields['eventid'] = $NID;
                                        $fields['repeating'] = $rep;
                                        $modx->db->insert($fields, $rep_table); 
                                    }
                                   
                                  }



              now its possible to get all events including the repeatings in one query sorted, limited(for pagination), what you want with this function:

                  function getMxEvents($timestart, $timeend, $limit = 0, $category = '')
                  {
              
                      global $modx;
              
                      $tablename = $modx->getFullTableName('mxcalendar_events');
                      $table2 = $modx->getFullTableName('mxcalendar_categories');
              
                      $where = 'e.active = 1';
                      if (!empty($category)) {
                          $where .= ' and e.category = ' . $category;
                      }
              
                      //-- Front end: returns logged in user's webgroup assignments [webgroup = web group id's user belongs to]
                      if ($modx->getLoginUserID()) {
                          $userInfo = $modx->db->makeArray($modx->db->select('webgroup', $modx->getFullTableName('web_groups'), '`webuser`=' . $modx->getLoginUserID()));
                          //-- Web View Permission Where Builder
                          foreach ($userInfo as $wu) {
                              foreach ($wu as $wp) $WHERE_WGP[] = 'FIND_IN_SET(' . $wp['0'] . ',E.restrictedwebusergroup)';
                          }
                      }
              
                      $query = "select e.* ";
                      $query .= " ,c.name as cat_name, c.foregroundcss as cat_fg , c.backgroundcss as cat_bg ,c.inlinecss as cat_css";
                      $query .= " , UNIX_TIMESTAMP(IF(eventid is not null,CONCAT(repeating,' ',e.starttime) ,start )) AS Time";
                      $query .= " , UNIX_TIMESTAMP(IF(eventid is not null,ADDTIME(repeating,TIMEDIFF(e.end, CAST(e.startdate as datetime))),end)) AS Timeend";
                      $query .= " ,(SELECT TIMESTAMPDIFF(SECOND,e.start,e.end)) as DurationSeconds";
                      $query .= " from " . $tablename . "e";
                      $query .= " left join $table2 c ON c.id=e.category";
                      $query .= " left join modx_mxcalendar_repeatings r on r.eventid = e.id ";
                      $query .= " where " . $where;
                      $query .= ' AND ' . ($WHERE_WGP && count($WHERE_WGP) ? '(' . implode(' OR ', $WHERE_WGP) . ' OR ( e.restrictedwebusergroup = \'\' OR e.restrictedwebusergroup <=> NULL ))' :
                          '( e.restrictedwebusergroup = \'\' OR e.restrictedwebusergroup <=> NULL )');
                      //Terminbeginn innerhalb der Zeitspanne
                      $query .= " having(( Time >= '$timestart' and Time <= '$timeend') ";
                      $query .= " or ";
                      //oder Terminende innerhalb der Zeitspanne
                      $query .= "(Timeend >= '$timestart' and Timeend <= '$timeend') ";
              
                      $query .= " or ";
                      //oder abgefragte Zeitspanne beginnt innerbalb des Terminzeitraums
                      $query .= "('$timestart' >= Time and '$timestart' <= Timeend) ";
              
                      $query .= " ) ";
                      $query .= " order by Time {$orderDir}";
              
                      if ($limit) {
                          $query .= ' LIMIT ' . $limit;
                      }
              
                      //echo $query;
                      $rs = $modx->db->query($query);
              
                      $events = $modx->db->makeArray($rs);
              
                      //echo '<pre>' . print_r($events, true) . '</pre>';
              
                      return $events;
                  }


              I use it for a minicalendar, generated with bloX. bloX can generate calendar-views out of a given array of events.
              you can see a test-installation here: http://www.webcmsolutions.de/minical.html




                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 34084 ☆ A M B ☆
                • 756 Posts
                thanks for sharing, that’s great. I had internal turmoil on how I was going to store the repeating events and didn’t use the external table from my personal experience with other calendaring type apps, but I’m glad that you were able to make the modifications to fit your needs.

                cheers
                  Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                  Visit CharlesMx.com for latest news and status updates.
                  • 4675
                  • 38 Posts
                  cartierbailey Reply #168, 15 years ago
                  I have a new problem that just started happening in the past week or so.

                  When an event list is generated (see http://www.centralcaribooarts.com/eventslist.html for example), some of the newly created events have a 12:00AM start time, but if you click on the actual event details, the correct start time will show.

                  This is a relatively new occurrence, so I'm trying to figure out how to correct this problem.

                  Thank you.
                    • 4675
                    • 38 Posts
                    cartierbailey Reply #169, 15 years ago
                    Is anyone using this plugin at all? I could use some help here.
                      • 34084 ☆ A M B ☆
                      • 756 Posts
                      sorry for the delay, since the migration to the new forum I do not receive email notices, reviewing issue now.
                        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                        Visit CharlesMx.com for latest news and status updates.