Fetch upcoming events by section

Author Message

Wenzel Wondra

Friday 13 November 2009 4:43:58 am

Hello!
I'm trying to extend the default fetch for upcoming events to only include certain sections - without success :(

{def        
                $curr_ts = currentdate()
                 $curr_today = $curr_ts|datetime( custom, '%j')
            $curr_year =  $curr_ts|datetime( custom, '%Y')
            $curr_month = $curr_ts|datetime( custom, '%n')
            $today_ts = makedate( $curr_month, $curr_today, $curr_year )
                $upcoming_events = fetch( 'content', 'list', 
                                          hash( 'parent_node_id', 67, 
                                           'limit', 2, 
                                           'sort_by', array( 'attribute', true(), 'event/from_time'),                                                                                                    
                                           'main_node_only', true(), 
                                           'class_filter_type', 'include', 
                                           'class_filter_array', array( 'event' ),                                                                                                                                                                                            
                                           'attribute_filter', array(                                                                                                                                            
                                              'or',                        
                                              array( 'event/from_time', '>=', $today_ts ),                                                                                                                                                  
                                              array( 'event/to_time', '>=', $today_ts ),
                                              array( 'section','=',11 ) ) ) ) }

Can anybody help me, to get that fetch right?
Thank you!

wewo

Eirik Alfstad Johansen

Friday 13 November 2009 11:51:44 am

Hi Wenzel,

Are you sure you want "or" and not "and" in the attribute filter?

Also, I'm not sure if the attribute filter supports section as a parameter, but limitation might. Check out the comment on the bottom of this page:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/modules/content/fetch_functions/list

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Sylvain Gogel

Friday 13 November 2009 12:27:07 pm

section is supported as a non-attribute so it should work

You should first limit your fetch to section only to figure out if you don't mess with the dates

cheers

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Sylvain Gogel

Friday 13 November 2009 12:32:05 pm

hum editing a post that contains a code tag is broken :(

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Wenzel Wondra

Monday 16 November 2009 6:03:08 am

Hey!
@Eirik: You are right with your concerns on the 'or' in the fetch. The 'or' is just needed for the date/time part of the fetch. But I have no idea how to add my 'and', 'section','=','11' to the query. I tried so many combinations and none worked....
@Sylvian: The dates are right - that's the original ezwebin calendar fetch. "Only" the combination fails :(

Any help would be really appreciated :)
Thank you,

WeWo

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 02:53:59
Script start
Timing: Jan 18 2025 02:53:59
Module start 'layout'
Timing: Jan 18 2025 02:53:59
Module start 'content'
Timing: Jan 18 2025 02:54:00
Module end 'content'
Timing: Jan 18 2025 02:54:00
Script end

Main resources:

Total runtime0.8542 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.0391152.6250
Module start 'layout' 0.00550.0021 741.664139.4453
Module start 'content' 0.00760.8452 781.1094601.4531
Module end 'content' 0.85280.0014 1,382.562516.1563
Script end 0.8542  1,398.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3637160.0002
Check MTime0.00130.1493160.0001
Mysql Total
Database connection0.00060.071510.0006
Mysqli_queries0.795693.1367650.0122
Looping result0.00060.0733630.0000
Template Total0.825696.620.4128
Template load0.00180.205720.0009
Template processing0.823896.439120.4119
Template load and register function0.00020.021510.0002
states
state_id_array0.00070.085410.0007
state_identifier_array0.00080.090320.0004
Override
Cache load0.00140.1693300.0000
Sytem overhead
Fetch class attribute can translate value0.00140.158830.0005
Fetch class attribute name0.00130.155170.0002
XML
Image XML parsing0.00580.673530.0019
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00570.6720220.0003
String conversion0.00000.000940.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
5content/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
7content/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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs