help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Setting "Handle Old Events"
Setting "Handle Old Events"
6 years 10 months ago
Hi there
In the setting "Handle Old Evens" I have the choice between:
As I can see this an easy change:
in components/com_jem/helpers/helper.php add after line 266 (//Set state trashed of outdated events) and before line 268 (// Set timestamp of last cleanup)
in administrator/components/com_jem/models/forms/settings.xml after line 323 (<option value="1">COM_JEM_DELETE_OLD_EVENTS</option>)
add
and in the language file administrator/components/com_jem/language/en-GB/en-GB.com_jem.ini add after line 848 (COM_JEM_TRASH_OLD_EVENTS="Trash old events")
add
The only thing I couldn't figure out in this quick hack is where to modify the javascript that it displays the connected field "number of days" …
In the setting "Handle Old Evens" I have the choice between:
- Do nothing
- Delete old events
- Archive old events
- Trash old events
- Deactivate old events
or - Unpublish old events
As I can see this an easy change:
in components/com_jem/helpers/helper.php add after line 266 (//Set state trashed of outdated events) and before line 268 (// Set timestamp of last cleanup)
Code:
//Set state unpublished of outdated events
if ($jemsettings->oldevent == 4) {
$query = 'UPDATE #__jem_events SET published = 0 WHERE dates > 0 AND '
.' DATE_SUB(NOW(), INTERVAL '.(int)$jemsettings->minus.' DAY) > (IF (enddates IS NOT NULL, enddates, dates)) '
.' AND published = 1';
$db->SetQuery($query);
$db->execute();
}
in administrator/components/com_jem/models/forms/settings.xml after line 323 (<option value="1">COM_JEM_DELETE_OLD_EVENTS</option>)
add
Code:
<option value="4">COM_JEM_UNPUBLISH_OLD_EVENTS</option>
and in the language file administrator/components/com_jem/language/en-GB/en-GB.com_jem.ini add after line 848 (COM_JEM_TRASH_OLD_EVENTS="Trash old events")
add
Code:
COM_JEM_UNPUBLISH_OLD_EVENTS="Unpublish old events"
The only thing I couldn't figure out in this quick hack is where to modify the javascript that it displays the connected field "number of days" …
The following user(s) said Thank You: benno
Please Log in or Create an account to join the conversation.
Re: Setting "Handle Old Events"
6 years 10 months ago
Ok, I got the javascript:
in administrator/components/com_jem/views/settings/tmpl/default.php change line 204 from
to
or you create a template overrride and do the changes there – better practice since it results in less core hacking.
in administrator/components/com_jem/views/settings/tmpl/default.php change line 204 from
Code:
if (nrevhandler == 1 || nrevhandler == 2 || nrevhandler == 3) {
Code:
if (nrevhandler == 1 || nrevhandler == 2 || nrevhandler == 3 || nrevhandler == 4) {
or you create a template overrride and do the changes there – better practice since it results in less core hacking.
Please Log in or Create an account to join the conversation.
Re: Setting "Handle Old Events"
3 years 11 months ago
Thanks a lot, @hekla
Just added a feature request for this www.joomlaeventmanager.net/forum/feature-requests/11212-handle-old-events-settings-add-unpublish-old-events-option#27905 and a PR github.com/jemproject/JEM-Project/pull/1234
Just added a feature request for this www.joomlaeventmanager.net/forum/feature-requests/11212-handle-old-events-settings-add-unpublish-old-events-option#27905 and a PR github.com/jemproject/JEM-Project/pull/1234
Please Log in or Create an account to join the conversation.
Re: Setting "Handle Old Events"
3 years 10 months ago
@ShannonBerry - as you see in my pull request (
github.com/jemproject/JEM-Project/pull/1234/fileshttps://github.com/jemproject/JEM-Project/pull/1234/files
), there is a second line to be modified in the javascript on line 109.
Moreover the code could be shortened to
(I just committed this modification)
Moreover the code could be shortened to
Code:
if (nrevhandler > 0) {
Please Log in or Create an account to join the conversation.
Time to create page: 0.669 seconds