Show "events" between two dates

Author Message

Steph A

Wednesday 02 November 2005 4:41:26 am

I have a class called "event" with two date attributes - "event_start" and "event_stop".

http://ez.no/community/forum/general/show_events_for_the_next_x_days

But I would like to take this template further. I would like to have the users themself define a "start_date" and a "stop_date", and then show them the events in between those dates.

Any ideas to achive this?

(Iam still quite a newbie, but trying to learn :)

...any help would be deeply appreciated

{let timestamp=maketime()
     current=gettime($timestamp)
     x=5
     start = maketime( 0, 0, 0, $current.month, $current.day, $current.year )
     end = maketime( 23, 59, 59, $current.month, $current.day|sum( $x ), $current.year )
     events = fetch( 'content', 'list',
         hash(
               'parent_node_id', $node.node_id,
               'attribute_filter', array(
                       'or',
                       array( 'event/event_start', 'between', array( $start, $end ) ),
                       array( 'event/event_end', 'between', array( $start, $end ) )
                    )
              )
            )
}
{foreach $events as $event}
    {node_view_gui view='line' content_node=$event}
{/foreach}
{/let}

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 19 2025 07:23:12
Script start
Timing: Jan 19 2025 07:23:12
Module start 'layout'
Timing: Jan 19 2025 07:23:12
Module start 'content'
Timing: Jan 19 2025 07:23:12
Module end 'content'
Timing: Jan 19 2025 07:23:12
Script end

Main resources:

Total runtime0.6492 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.0054 589.1484152.6250
Module start 'layout' 0.00540.0036 741.773439.4453
Module start 'content' 0.00900.6390 781.2188401.3984
Module end 'content' 0.64800.0012 1,182.61728.1641
Script end 0.6492  1,190.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5149160.0002
Check MTime0.00150.2313160.0001
Mysql Total
Database connection0.00070.112610.0007
Mysqli_queries0.610293.9905460.0133
Looping result0.00050.0745440.0000
Template Total0.616795.020.3084
Template load0.00220.331220.0011
Template processing0.614694.664220.3073
Template load and register function0.00030.043410.0003
states
state_id_array0.00120.192410.0012
state_identifier_array0.00100.154520.0005
Override
Cache load0.00180.2709100.0002
Sytem overhead
Fetch class attribute can translate value0.00070.113510.0007
Fetch class attribute name0.00070.104310.0007
XML
Image XML parsing0.00020.029410.0002
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00080.1198100.0001
String conversion0.00000.001540.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
1content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 5
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs