location sorting in Event Booking

More
11 years 6 months ago #20492 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: location sorting in Event Booking
Hi Gabriella

Could you please :

1. Share the module you developed (the city module in this case) .

2. Share me the query string which you developed.

I would be happy to add this modification to the core download package .

(right now working on multilingual feature for the extension).

Tuan

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

More
11 years 6 months ago - 11 years 6 months ago #20509 by gabree
Replied by gabree on topic Re: location sorting in Event Booking
Hey, this was hard work, since I am a graphic designer :lol:

I post the file as attachment,
they should install correctly, since I've installed succesfully.


about code in the core application, these are the modification:

location model file:
com_eventbooking/models/location.php
- added in the query, beside c.name, also c.city
Code:
SELECT a.*, c.city AS city, ...

- added in the _buildContentWhere:
Code:
$locationCity = JRequest::getString('location_city', 0) ; if ($locationCity) { $where[] = ' c.city LIKE "' .$locationCity. '"'; }

- added in the getLocation function:
Code:
$locationCity = JRequest::getString('location_city', 0) ;

- and changed the sql in the getLocation function this way (even though I'd better search both locationId or location City):
Code:
//$sql = 'SELECT * FROM #__eb_locations WHERE id='.$locationId; $sql = 'SELECT * FROM #__eb_locations WHERE city LIKE "'.$locationCity.'"';



location view files:
com_eventbooking/views/view.html.php
- added at the top of the function:
Code:
$city = JRequest::getString('location_city', 0) ;

- and added ath the bottom of the function:
Code:
$this->assignRef('city', $city) ;

- commented the "setTitle" and placed the city "setTitle":
Code:
//$document->setTitle($location->name); $document->setTitle($city);


com_eventbooking/views/tmpl/default.php
(my location template view file is more different than the original, but these are the important modification)
- added in the header php code:
Code:
$locationCity = $this->location->city;

- changed the H1 title this way:
Code:
<?php echo JText::sprintf('EB_EVENTS_FROM_LOCATION', $this->location->city); ?>

this should be all. hope to have not forget anything ;)


File Attachment:

File Name: mod_eb_city.zip
File Size:6 KB
Attachments:
Last edit: 11 years 6 months ago by gabree. Reason: wrong zip

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

More
11 years 6 months ago #20683 by gabree
Replied by gabree on topic Re: location sorting in Event Booking
I've just tried the modification explained with the new release, but it doesn't do the work.

maybe there is something more to change in the new version in order to make it work.

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

More
11 years 6 months ago #21189 by jacquesl
Replied by jacquesl on topic Re: location sorting in Event Booking
Hello, Tuan, read post on search city saw the module, i am also interested in the location module search by city , can I share the cost with other request?

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

Moderators: Tuan Pham Ngoc