Jueves, 20 Noviembre 2014 22:59
beggarly

[Fix] Xmap + Eventlist Plugin | Events not displaying

Suggest/Comment/Post new extensions for Xmap!

[Fix] Xmap + Eventlist Plugin | Events not displaying

Postby kelipasan » Thu Jun 03, 2010 4:12 pm

Firstly I would like to thank Guillermo Vargas for such a wonderful component. Saved me so much time in developing my site! And i guess you must be drained out supporting this component with numerous plugins.

I was using Xmap on my site and surprised to see my Eventlist events not showing up under its event category. I chose the Simplelist Layout as my menu.

Checked the codes for the plugin and fixed it. Below is the fixed function. This might not work for other Eventlist's menu type so don't flame me it it didn't work!

administrator/components/com_xmap/extensions/com_eventlist.php
line 132 - 178

Code: Select all
function getCategoryTree(&$xmap, &$parent, $params,$catid=0)
{
   
   $db = &JFactory::getDBO();
   $gid = intval($xmap->gid);
   
   $query = "SELECT id , catname, alias"
         . "\nFROM #__eventlist_categories"
         . "\nWHERE published = 1 and parent_id=$catid"
         . "\nAND access <= $gid"
         . "\nORDER BY ordering";
   $db->setQuery($query);
   $cats = $db->loadObjectList();

   $xmap->changeLevel(1);
   foreach($cats as $cat)
   {
      $node = new stdclass;
      $node->id   = $parent->id;
      $node->uid   = $parent->uid.'c'.$cat->id;
      $node->name = $cat->catname;
      $node->link = 'index.php?option=com_eventlist&amp;view=categoryevents&amp;id='.$cat->id.':'.$cat->alias;
      $node->expandible = true;
      $xmap->printNode($node);
      

      if ($params['include_events']) {
         $db->setQuery ("select `id`, `title`,`alias`,UNIX_TIMESTAMP(`created`) as `created`,UNIX_TIMESTAMP(`modified`) as `modified` from #__eventlist_events where catsid=".$cat->id." and `published` = '1' ".$params['days']." order by dates,times,enddates,endtimes " . $params['limit']);
         // echo $db->getQuery ();
         $rows = $db->loadObjectList();
         $xmap->changeLevel(1);
         foreach ($rows as $event) {
            $node = new stdclass;
            $node->id   = $parent->id;
            $node->uid  = $parent->uid .'e'.$event->id;
            $node->name = $event->title;
            $node->modified = ($event->modified? $event->modified : $event->created);
            $node->link = 'index.php?option=com_eventlist&amp;view=details&amp;id='.$event->id.':'.$event->alias;
            $node->priority   = $params['event_priority'];
            $node->changefreq = $params['event_changefreq'];
            $node->expandible = false;
            $xmap->printNode($node);
         }
         $xmap->changeLevel(-1);
      }
   }
   $xmap->changeLevel(-1);
   
}


Using:
Xmap 1.2.7
Eventlist Plugin 1.0.0
Eventlist 1.0.1
Attachments
com_eventlist.zip
Eventlist Plugin 1.0.0 Simplelist Layout fix
(2.19 KiB) Downloaded 498 times
kelipasan
Fresh Boarder
Fresh Boarder
 
Posts: 1
Joined: Thu Jun 03, 2010 3:42 pm

Re: [Fix] Xmap + Eventlist Plugin | Events not displaying

Postby salesgorilla » Wed Dec 22, 2010 5:11 pm

Thank you for your work.

Xmap 1.2.10 still does not have this fix in it. Perhaps it could be applied to the next update?
salesgorilla
Fresh Boarder
Fresh Boarder
 
Posts: 3
Joined: Mon Jun 15, 2009 3:36 am


Return to Plugins



Who is online

Users browsing this forum: No registered users and 2 guests

cron