- Posts: 5
- Thank you received: 0
Frontend event submit redirect
- Fontijn
- Topic Author
- Offline
- New Member
-
Less
More
11 years 8 months ago - 11 years 8 months ago #47241
by Fontijn
Frontend event submit redirect was created by Fontijn
Hi,
I have a question.
My customer wants to see the details page of the event after she submitted it using the frondend submission page.
How can i achieve this?
Thanks in advance.
Regards,
Fontijn
I have a question.
My customer wants to see the details page of the event after she submitted it using the frondend submission page.
How can i achieve this?
Thanks in advance.
Regards,
Fontijn
Last edit: 11 years 8 months ago by Fontijn.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
-
11 years 8 months ago #47306
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Frontend event submit redirect
Hi Fontijn
You will need to customize the code. Please follow the instruction below :
1. Open the file components/com_eventbooking/controller/controller.php
2. Find the function save_event
3. Within that function, find the code :
4. Change it to:
After that, it should work as expected. Please note that Events Booking is only display event detail page if the event is published, so if the event is not published when client submit it, he/she will still cannot see event details page.
Tuan
You will need to customize the code. Please follow the instruction below :
1. Open the file components/com_eventbooking/controller/controller.php
2. Find the function save_event
3. Within that function, find the code :
Code:
$this->setRedirect(JRoute::_(EventbookingHelperRoute::getViewRoute('events', JRequest::getInt('Itemid', 0)), false), $msg);
4. Change it to:
Code:
$this->setRedirect(JRoute::_(EventbookingHelperRoute::getEventRoute($post['id']), false), $msg);
After that, it should work as expected. Please note that Events Booking is only display event detail page if the event is published, so if the event is not published when client submit it, he/she will still cannot see event details page.
Tuan
Please Log in or Create an account to join the conversation.
- Fontijn
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
11 years 8 months ago - 11 years 8 months ago #47319
by Fontijn
Replied by Fontijn on topic Frontend event submit redirect
Thanks i noticed that i have an older version 1.5.3 
The code i have is :
I tried changing a few things but i get errors saying not authorized or invalid event.
Dear regards,
Fontijn
The code i have is :
Code:
$this->setRedirect(JRoute::_('index.php?option=com_eventbooking&task=show_events&Itemid='.JRequest::getInt('Itemid'), false) , $msg);
Dear regards,
Fontijn
Last edit: 11 years 8 months ago by Fontijn.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
-
11 years 8 months ago #47320
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Frontend event submit redirect
I am not sure what is the format of the link to event detail page in the version of Events Booking you are using, so I could not give you exactly code. You should be able to find out the format of the link to the event page and change the code to work for you.
Should not take you much time
Tuan
Should not take you much time
Tuan
Please Log in or Create an account to join the conversation.
- Fontijn
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
11 years 8 months ago #47334
by Fontijn
Replied by Fontijn on topic Frontend event submit redirect
Thank you for your response.
But i cant solve this i constantly get the message invalid event.
This is the whole code of the funciton.
I already changed the url to match the current version and i also included the "$post[id]".
But i think the id doesnt match the event id but the itemid or something.
Thanks again for looking into this.
Dear regards,
Bo
But i cant solve this i constantly get the message invalid event.
This is the whole code of the funciton.
I already changed the url to match the current version and i also included the "$post[id]".
But i think the id doesnt match the event id but the itemid or something.
Code:
function save_event() {
JRequest::checkToken() or jexit( 'Invalid Token' );
$post = JRequest::get('post' , JREQUEST_ALLOWHTML);
$model = $this->getModel('event') ;
$cid = $post['cid'];
$post['id'] = (int) $cid[0];
$ret = $model->store($post);
if ($ret) {
$msg = JText::_('Successfully saving event');
} else {
$msg = JText::_('Error while saving event') ;
}
$this->setRedirect(JRoute::_('index.php?option=com_eventbooking&task=view_event&event_id='.$post['id'], false) , $msg);
}
Thanks again for looking into this.
Dear regards,
Bo
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
-
11 years 8 months ago #47335
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Frontend event submit redirect
That's not correct code for version 1.5.3. If you are using version 1.5.3, you will have to customize store() method in components/com_eventbooking/models/event.php to store the id of event back to $data array after save
Something like $data = $row->id ; after calling $row->store(); method
Please try to look at the code and you should be able to do it
BTW, what's the reason keep you using 1.5.3 ? That version is quite outdated.
Tuan
Something like $data = $row->id ; after calling $row->store(); method
Please try to look at the code and you should be able to do it
BTW, what's the reason keep you using 1.5.3 ? That version is quite outdated.
Tuan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
-
11 years 8 months ago #47338
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Frontend event submit redirect
You can try to get this file (it is the file event.php under models folder), unzip it, get the file and upload to components/com_eventbooking/models folder and try again. I made a quick modification for you (without testing) - too busy now.
Tuan
Tuan
Please Log in or Create an account to join the conversation.
- Fontijn
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
11 years 8 months ago #47360
by Fontijn
Replied by Fontijn on topic Frontend event submit redirect
Thanks its working now!
Thank you for taking the time to solve my problem.
Regards,
Fontijn
Thank you for taking the time to solve my problem.
Regards,
Fontijn
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
-
11 years 8 months ago #47383
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Frontend event submit redirect
OK, great. Thanks fro the update.
Tuan
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2026 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.