Forums / Setup & design / Unpublish date for Forum Topics

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

eZ debug

Timing: Jan 18 2025 16:17:11
Script start
Timing: Jan 18 2025 16:17:11
Module start 'content'
Timing: Jan 18 2025 16:17:12
Module end 'content'
Timing: Jan 18 2025 16:17:12
Script end

Main resources:

Total runtime0.9001 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0041 588.8438180.8359
Module start 'content' 0.00410.7455 769.6797617.4219
Module end 'content' 0.74960.1505 1,387.1016337.0938
Script end 0.9001  1,724.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4141210.0002
Check MTime0.00140.1576210.0001
Mysql Total
Database connection0.00060.071810.0006
Mysqli_queries0.822591.37992050.0040
Looping result0.00820.90642030.0000
Template Total0.881397.920.4406
Template load0.00190.207320.0009
Template processing0.879497.697420.4397
Template load and register function0.00010.013110.0001
states
state_id_array0.00060.069710.0006
state_identifier_array0.00110.120420.0005
Override
Cache load0.00160.1725290.0001
Sytem overhead
Fetch class attribute can translate value0.00140.150040.0003
Fetch class attribute name0.00090.097480.0001
XML
Image XML parsing0.00150.170340.0004
class_abstraction
Instantiating content class attribute0.00000.0019100.0000
General
dbfile0.00230.2564350.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs