A news archive by month (problem filtering by date)

Author Message

Cristian G. L.

Thursday 27 May 2004 12:22:10 am

Hi
I want to make a news archive, grouping news by month. A method to do this is make a news loop inside a months loop.
I tried to make a fetch for get all news published in an especific month (in this example, June). The following code don't show any news:

{let arrayNoticias=fetch(content, list, hash(parent_node_id, 53,
  					   sort_by, array(published, false() ),
					   attribute_filter, array( array('published|datetime(custom,'%m')', '=', '06' ) ) ) ) } 

I think that i should modify with operators de value ('06', June) instead of attribute (published). The only operators i know for do it are <i>maketime</i> or <i>makedate</i>. But these functions seems to be undocumented. I don't know if these functions are what i need and, in that case, i don't know how use it.
Maybe exist a better method for do a news archive by month (i am open for any idea), but i will need to know how to filter by date anyway.

Thanks in advance
(Sorry for my poor english.)

Cristian

Piotr Kwiatkowski

Thursday 27 May 2004 1:06:48 am

An example of news archive you can find in BLOG template at:
kernel/setup/packages/blog/files/default/design.blog/override/templates/archive.tpl

Cristian G. L.

Monday 31 May 2004 12:23:14 am

Thanks for reply.

I did the following for fetch all news of a month (June in the example):

{let arrayNoticias=fetch(content, list, hash(parent_node_id, 53,
					 sort_by, array(published, false() ),
					 attribute_filter, array( array( published, >=,
 									 maketime(0,0,0,6,1,2004) ),
								  array( published, <,
									 maketime(0,0,0,7,1,2004) ) )

And it works!

Bye

Cristian

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

Main resources:

Total runtime1.1983 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.0625152.6406
Module start 'layout' 0.00470.0024 740.703139.4766
Module start 'content' 0.00701.1892 780.1797472.6641
Module end 'content' 1.19620.0021 1,252.84388.4375
Script end 1.1983  1,261.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2786160.0002
Check MTime0.00130.1083160.0001
Mysql Total
Database connection0.00090.071510.0009
Mysqli_queries1.153596.2534570.0202
Looping result0.00070.0587550.0000
Template Total1.163197.120.5816
Template load0.00220.187020.0011
Template processing1.160996.871520.5804
Template load and register function0.00020.016810.0002
states
state_id_array0.00320.264910.0032
state_identifier_array0.00180.148220.0009
Override
Cache load0.00180.1517220.0001
Sytem overhead
Fetch class attribute can translate value0.00100.083120.0005
Fetch class attribute name0.00130.112630.0004
XML
Image XML parsing0.00030.022820.0001
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00080.0653100.0001
String conversion0.00000.000740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs