Events map module

More
9 years 2 months ago #59485 by DPaW
Events map module was created by DPaW
Hi all,
I'm trying to see if i can code up an Events Map module. Basically, it's just a simple extension of the Events module, but I need to grab the lat & long values from #__eb_locations

I have duplicated the mod_eb_events module as a base for the code to see if it will work.

I'm hoping someone here may be able to assist with the DB Query, so i can get the following values from eb_locations:

lat, long, address, city, state, zip, country

here's the Query, any help is REALLY appreciated
Code:
$where = array(); $where[] = 'a.published =1 '; $where[] = 'DATE(event_date) >= CURDATE()'; // $where[] = '(cut_off_date = "'.$db->getNullDate().'" OR DATE(cut_off_date) >= CURDATE())' ; if ($categoryIds != '') { $where[] = ' a.id IN (SELECT event_id FROM #__eb_event_categories WHERE category_id IN (' . $categoryIds . '))'; } $where[] = ' a.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; if ($app->getLanguageFilter()) { $where[] = ' a.language IN (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')'; } $sql = 'SELECT a.*, c.name AS location_name FROM #__eb_events AS a ' . ' LEFT JOIN #__eb_locations AS c ' . ' ON a.location_id = c.id ' . ' WHERE ' . implode(' AND ', $where) . ' ORDER BY a.event_date ' . ' LIMIT ' . $numberEvents; $db->setQuery($sql); $rows = $db->loadObjectList(); for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; // Get all categories $sql = 'SELECT a.id, a.name FROM #__eb_categories AS a INNER JOIN #__eb_event_categories AS b ON a.id = b.category_id WHERE b.event_id=' . $row->id; $db->setQuery($sql); $categories = $db->loadObjectList(); if (count($categories)) { $itemCategories = array(); foreach ($categories as $category) { $itemCategories[] = '<a href="' . EventbookingHelperRoute::getCategoryRoute($category->id, $itemId) . '"><strong>' . $category->name . '</strong></a>'; } $row->categories = implode('&nbsp;|&nbsp;', $itemCategories); } }

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #59486 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Events map module
You are lucky, man. We built it for the next release of the extension. We might need to make few tweaks before making it public release but for now, it is good to use it

Please get it here

Tuan
Attachments:
The following user(s) said Thank You: DPaW

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #59487 by DPaW
Replied by DPaW on topic Events map module
Tuan, that is amazing!

I'll have a play and let you know how i get on, great work mate and thanks =)

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc