Unpublish by date?

Author Message

Arash Molavi

Monday 01 December 2003 3:23:04 pm

I wounder if there is some way to unpublish an object in a spesific day. (ie. I've added an datehandeler in all articles, folders etc.)

Jo Henrik Endrerud

Tuesday 02 December 2003 6:21:36 am

Yes it is. To do this you need to create a new workflow. This workflow should have two events. First event should be "wait until date". On this event you should select all "unpublish time" attributes on your classes (select first class, click "load attributes", select unpublish attribute, click "new entry". Repeat for all classes with this attribute).

Second event should be "unpublish". Save your workflow and set this up to be triggered after publish of content.

This requires the cron-job to run correctly on the server.

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

John Smith

Monday 21 March 2005 9:33:20 am

Can anybody please tell where is the unpublished event in ezpublish 3.5.1. I can't find any such event there.

cheers

Christiane Kloss

Tuesday 22 March 2005 3:04:39 am

Hi,

Unpublish is a standard cronjob since 3.4(?).

There are some UnpublishSettings in content.ini:
Copy to content.ini.append...

[UnpublishSettings]
RootNodeList[]
ClassList[]

The classes to be unpublished have to have a datefield named 'unpublish_date'.

Hope this will help.
Lately there was a thread in the forum, but I can't find it right now.

Christiane

John Smith

Tuesday 22 March 2005 3:26:14 am

hi Christiane,

the lines which you told are already in the content.ini. I am really stuck. Can you help.

What i did, i created a "wait untill event", selected the article class and the new attribute "Unpublish Date". After saving, i assigned the new workflow to the "after publish" trigger.

Run the cronjob manually.

It that right or i am wrong somewhere.

Cheers.

Bjarte Lunde

Wednesday 06 April 2005 5:39:49 am

I've added the unpublish_date attribute to the Article class and added the lines to content.ini.append in the siteaccess settings.

But when i run the cronjob i get this error:

Running cronjobs/unpublish.php

Fatal error: [] operator not supported for strings in /opt/ezpublish/sites/mysite/lib/ezutils/classes/ezini.php on line 638

Fatal error: eZ publish did not finish its request

John Smith

Wednesday 06 April 2005 7:30:28 am

What sort of ezpublish version you using?

Bjarte Lunde

Thursday 07 April 2005 2:10:50 am

Version: 3.5.0 or 3.5.1

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 20:58:30
Script start
Timing: Jan 18 2025 20:58:30
Module start 'layout'
Timing: Jan 18 2025 20:58:30
Module start 'content'
Timing: Jan 18 2025 20:58:30
Module end 'content'
Timing: Jan 18 2025 20:58:30
Script end

Main resources:

Total runtime0.0183 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.7969152.6094
Module start 'layout' 0.00660.0033 740.406339.4297
Module start 'content' 0.00980.0064 779.835993.3047
Module end 'content' 0.01620.0021 873.140638.3047
Script end 0.0183  911.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002714.6220140.0002
Check MTime0.00137.1505140.0001
Mysql Total
Database connection0.00073.712410.0007
Mysqli_queries0.003921.087530.0013
Looping result0.00000.104010.0000
Template Total0.00179.310.0017
Template load0.00084.601510.0008
Template processing0.00094.676910.0009
Override
Cache load0.00063.244410.0006
General
dbfile0.002413.132480.0003
String conversion0.00000.059840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs