Count articles by expiry date?

Author Message

Mark Irvine

Sunday 28 March 2004 2:25:15 pm

Hi,

I've created a class with an attribute for an expiry date. I'd like to display articles of this class on my home page, but I only want to create the page items (header, articles etc.) if there are any documents with an expiry date later than today.

In other words, I want to show a 'latest news' section on my homepage, but if there is no latest news, and all the docs are past their exiry date, then I don't want to display the 'latest news' header and an empty list...

Here's what I'm trying:

{let news_count=fetch('content','list_count',hash(parent_node_id,$news_node.main_node_id, 
                      'attribute_filter',array( array(
                                               'expiry_date',
                                               '>', 
                                               currentdate()))))
}

I realize this won't work, but it should give an idea of what I'm trying to do. Basically, I want to know if there are any docs to display based on the attribute 'expiry_date'.

Any ideas?

Thanks,
Mark

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 22:37:44
Script start
Timing: Jan 18 2025 22:37:44
Module start 'layout'
Timing: Jan 18 2025 22:37:44
Module start 'content'
Timing: Jan 18 2025 22:37:45
Module end 'content'
Timing: Jan 18 2025 22:37:45
Script end

Main resources:

Total runtime1.2649 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.9141152.6250
Module start 'layout' 0.00510.0026 740.539139.4453
Module start 'content' 0.00781.2557 779.9844402.5313
Module end 'content' 1.26340.0015 1,182.51568.1641
Script end 1.2649  1,190.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2638160.0002
Check MTime0.00150.1147160.0001
Mysql Total
Database connection0.00090.074310.0009
Mysqli_queries1.228297.0919460.0267
Looping result0.00050.0400440.0000
Template Total1.235697.720.6178
Template load0.00180.145420.0009
Template processing1.233797.531420.6169
Template load and register function0.00020.016410.0002
states
state_id_array0.00080.063810.0008
state_identifier_array0.00090.070220.0004
Override
Cache load0.00150.1209120.0001
Sytem overhead
Fetch class attribute can translate value0.00080.062010.0008
Fetch class attribute name0.00070.059110.0007
XML
Image XML parsing0.00010.008910.0001
class_abstraction
Instantiating content class attribute0.00000.000310.0000
General
dbfile0.00060.0493100.0001
String conversion0.00000.000540.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs