Forums / Setup & design / Unpublish date for Forum Topics
Jeremy A
Tuesday 05 August 2008 12:41:32 am
Hi,
I would like to know how I can put a kind of "time to live" for topics in forums. Like the articles, get a unpublish date, i.e. in two month the forum topic will delete by itself.I have already add an Date attribute in the Forum Topic class. What's next ?
Thank you.
Łukasz Serwatka
Tuesday 05 August 2008 12:46:12 am
You need to configure cronjob script. Take a look on this example. http://ez.no/doc/ez_publish/technical_manual/4_0/features/cronjobs/the_cronjob_scripts#unpublishhttp://ez.no/doc/ez_publish/technical_manual/4_0/features/cronjobs/configuring_cronjobs
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Wednesday 13 August 2008 2:21:43 am
Hi,Thank you for these useful links.
I don't really understand how I can create a custom cronjobs, saying that after two month (i.e.) the topic delete itself.Should I create my own php script for this ?
Thursday 14 August 2008 4:22:02 am
No, this script is already in eZ Publish. See content.ini file for configuration settings. Everything is described in the documentation.
Thursday 14 August 2008 4:24:12 am
See also: http://ez.no/developer/forum/general/re_publish_unpublished_objects/re_re_publish_unpublished_objects__4
Andy Caiger
Monday 08 September 2008 4:46:02 am
I think what Jeremy wants to do is to be able to specify a global "time-to-live" that will be used by the unpublish cronjob (or variant thereof) rather than have to specify the 'unpublish_date' attribute for each forum topic.
I'm looking for something similar but for RSS import objects. For example, on importing an RSS object is it possible to automatically populate the 'unpublish_date' attribute with (current date + 2 months)?
Or has someone modified unpublish.php so that it will look at the publish date of an object, test if it is more than 2 months old, and unpublish/hide it if is?
Andy
EAB - Integrated Internet Success Offices in England, France & China. http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com