Unpublish date for Forum Topics

Author Message

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#unpublish
http://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

Jeremy A

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 ?

Łukasz Serwatka

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.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Łukasz Serwatka

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

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:39:37
Script start
Timing: Jan 18 2025 19:39:37
Module start 'layout'
Timing: Jan 18 2025 19:39:37
Module start 'content'
Timing: Jan 18 2025 19:39:39
Module end 'content'
Timing: Jan 18 2025 19:39:39
Script end

Main resources:

Total runtime1.3030 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00550.0033 740.539139.4609
Module start 'content' 0.00871.2928 780.0000612.3438
Module end 'content' 1.30160.0014 1,392.343816.1641
Script end 1.3030  1,408.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2608160.0002
Check MTime0.00140.1074160.0001
Mysql Total
Database connection0.00070.051510.0007
Mysqli_queries1.249795.9069680.0184
Looping result0.00060.0496660.0000
Template Total1.271697.620.6358
Template load0.00220.169220.0011
Template processing1.269497.419520.6347
Template load and register function0.00020.011910.0002
states
state_id_array0.00080.062110.0008
state_identifier_array0.00170.133520.0009
Override
Cache load0.00190.1424290.0001
Sytem overhead
Fetch class attribute can translate value0.00080.064030.0003
Fetch class attribute name0.00080.062480.0001
XML
Image XML parsing0.00120.092930.0004
class_abstraction
Instantiating content class attribute0.00000.0012100.0000
General
dbfile0.00090.0727240.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs