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
#24805
Hi there

In the setting "Handle Old Evens" I have the choice between:
  • Do nothing
  • Delete old events
  • Archive old events
  • Trash old events
I would like to add
  • Deactivate old events
    or
  • Unpublish old events
This is usefull when I want to reuse the events, but I want to prevent visitors to still find them in the archive.

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
#24806
Ok, I got the javascript:

in administrator/components/com_jem/views/settings/tmpl/default.php change line 204 from
Code:
if (nrevhandler == 1 || nrevhandler == 2 || nrevhandler == 3) {
to

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
#27906

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

Re: Setting "Handle Old Events"

3 years 10 months ago
#27947
@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
Code:
if (nrevhandler > 0) {
(I just committed this modification)

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

Time to create page: 0.669 seconds