Display Article only for a limited period of time?

Author Message

Jan Bengia

Tuesday 02 August 2005 3:16:47 pm

Hi,
maybe I'm just to stupid to find this function: How do I set a publish period of time for a certain content object? I mean something like "this article is on the public site only visible between 03/04/2005 and 03/07/2005 ...? Is this possible?

thanks!
Jan

Arran Price

Wednesday 03 August 2005 4:36:05 pm

Hi Jan,
You cant do this by default. To the best of my understanding,You will need to, either
(for where you want all items having different valid dates) add some new attributes to the item, being start and end dates and then modify the template fetch to exclude items that dont match your criteria, or
(where all items in the folder or whatever have the same dates) modify the template doing the fetch so that it only displays between certain dates.

Hope thats of help

Arran

Jan Bengia

Thursday 04 August 2005 2:25:49 am

Hi,
thanks for the hints - I will try this "workaround". I think this is a real lack of the system ...

vg

Luc Chase

Thursday 04 August 2005 3:48:05 am

Jan,
cronjobs should be in place,
your content class must have a datefield named 'unpublish_date' and the content.ini must have two particular values set.

Both the RootNodeList[] and ClassList[] arrays in content.ini must be defined for it to work. So, you may need to add some settings to your <siteAccess_admin>/content.ini[.append][.php] as follows...

[UnpublishSettings]
RootNodeList[]=2
ClassList[]
ClassList[]=2

Here Articles (class ID 2) are set as a potential unpublish content class, starting at the root of the site ( node 2).
Have a look at the code in cronjobs/unpublish.php (that code refers to 'articleNodeArray' but it works not only on Articles but also for other content classes as long as they have an 'unpublish_date' field of type Date).
NB. that script removes the content rather than just a hide, so look in the Trash to recover it.
If you have not setup cronjobs, just run the command

php -C runcronjobs.php -s siteaccess
from the root of your EZP installation.

Where siteaccess above is the siteacces which contains the content.ini file with the unpublish setup.

Have a look at
http://ez.no/products/ez_publish_cms/documentation/development/extensions/workflow_events/unpublish

For the start/publish date you need to create a workflow that is triggered by a wait for date event.

The Web Application Service Provider

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 21:19:39
Script start
Timing: Jan 18 2025 21:19:39
Module start 'layout'
Timing: Jan 18 2025 21:19:39
Module start 'content'
Timing: Jan 18 2025 21:19:40
Module end 'content'
Timing: Jan 18 2025 21:19:40
Script end

Main resources:

Total runtime1.0658 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1719152.6406
Module start 'layout' 0.00560.0031 741.812539.4766
Module start 'content' 0.00861.0558 781.2891548.2500
Module end 'content' 1.06440.0013 1,329.539112.1250
Script end 1.0658  1,341.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2827160.0002
Check MTime0.00130.1217160.0001
Mysql Total
Database connection0.00070.070010.0007
Mysqli_queries1.018995.6041620.0164
Looping result0.00060.0523600.0000
Template Total1.029596.620.5147
Template load0.00210.200820.0011
Template processing1.027396.392320.5137
Template load and register function0.00020.020710.0002
states
state_id_array0.00180.170710.0018
state_identifier_array0.00170.157420.0008
Override
Cache load0.00180.1678370.0000
Sytem overhead
Fetch class attribute can translate value0.00050.050330.0002
Fetch class attribute name0.00120.112440.0003
XML
Image XML parsing0.00030.032030.0001
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00060.0561100.0001
String conversion0.00000.001140.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 5

Time used to render debug report: 0.0001 secs