Forum
Welcome, Guest
Please Login to access forum.
Event booking passed events (1 viewing) 
Go to bottom
TOPIC: Event booking passed events
#4294
Roger
Fresh Boarder
Posts: 18
User Offline
Event booking passed events Karma: 0  
Hello

I'm using th preconfigured data source for Event booking. This seems to work fine. It seems to me that all published events are in the sitemap. I think the passed events should not be shown anymore. Can I just change the sql code using the end date of the event and a now variable to make them disappear automatically? How about the cached sitemap? Do I have to renew the cached sitemap manually after each event that has passed?

Thanks

Roger
 
Logged Logged  
  The administrator has disabled public write access.
#4296
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Event booking passed events Karma: 79  
Hello again.

If you prefer to remove past events of Eventbooking from the sitemap you can edit the SQL query adding an additional where condition as below:

Code:

SELECT `#__eb_events`.`title`, `#__eb_events`.`id`, `#__eb_event_categories`.`category_id` AS `catid`, `#__eb_categories`.`name` FROM `#__eb_events` JOIN `#__eb_event_categories` ON `#__eb_events`.`id` = `#__eb_event_categories`.`event_id` JOIN `#__eb_categories` ON `#__eb_event_categories`.`category_id` = `#__eb_categories`.`id` WHERE `#__eb_categories`.`published` = '1' AND `#__eb_events`.`published` = '1' AND `#__eb_events`.`access` IN {aid} AND (`#__eb_events`.`language` = '*' OR `#__eb_events`.`language` = {langtag}) AND `#__eb_events`.`event_date` > NOW() ORDER BY `#__eb_categories`.`ordering` ASC, `#__eb_events`.`ordering` ASC
where there is a new condition:
Code:

AND `#__eb_events`.`event_date` > NOW()
Please refer to the PDF docs about caching technologies there are detailed explanations. Only AJAX precaching requires manual refresh of the cached sitemap. Cheers, John
 
Logged Logged  
  The administrator has disabled public write access.
#4336
Roger
Fresh Boarder
Posts: 18
User Offline
Re:Event booking passed events Karma: 0  
Hi John

I finally got to test this. Unfortunately it doesn't work. I made the following adjustment.


It seems to me the the generated SQL query looks the same as the one you mentioned in your last thread. Looking at the standard formated xml sitemap I don't see any events from Event Booking at all anymore.

Also tried with CURDATE() instead of NOW(), but the same problem. Setting the where statement to
WHERE event_date < NOW() I get events, but setting them to event_date > NOW() there are no events anymore.

I guess I'm missing something, but wasn't able to figure it out.

Thanks

Roger
 
Logged Logged  
  The administrator has disabled public write access.
#4337
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Event booking passed events Karma: 79  
Hi Roger,

CURDATE() is probably wrong at all.
But i tested the solution about `#__eb_events`.`event_date` > NOW() and it worked perfectly at my end so i suggested it to you.
Eventually you can copy/paste the above query that i sent in the previous post if you are unsure.
If you don't get events, i can only think that there are no future events set in the database table.

John
 
Logged Logged  
  The administrator has disabled public write access.
#4345
Roger
Fresh Boarder
Posts: 18
User Offline
Re:Event booking passed events Karma: 0  
Hi John

You are correct, if I take the code you wrote in the thread above, it works fine. I analyzed the code you sent and the code done by the Data source SQL Query Compiler. The compiler put out 'NOW()', where as correct would be NOW().
Using the compiler as shown in the picture below and then regenerate the output and delete the ' from the output around NOW() makes it work just fine.

Am I doing something wrong?

Thanks

Roger
 
Logged Logged  
  The administrator has disabled public write access.
#4346
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Event booking passed events Karma: 79  
Hi Roger,

that's right and expected. When using the compiler to add NOW() the value is automatically escaped for security reasons to prevent SQL injection. So just remove the ' in the raw SQL string to have it working.

Best,
John
 
Logged Logged  
  The administrator has disabled public write access.
Go to top