random banner rotation?

Author Message

Dan Zembrosky

Tuesday 11 March 2003 12:35:02 pm

Anyone know how to do have ez 3 call an item within a folder to be displayed inline at random?

Tony Wood

Wednesday 12 March 2003 12:29:58 am

> > Anyone know how to do have ez 3 call an item within a
> folder
> > to be displayed inline at random?
>
> If you want a random banner EACH refresh, you'll need to run
> a scripts everytime index.php is loaded. Create a random
> banner script with an output of the of the banner or the
> complete link (whatever).
> Put the output in a variable and echo the variable in the
> templates.!
>
> See http://ezwiki.blanko.info/index.php/3XHT_UsePHP

Hans, Did you find that worked with cache enabled?

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Paul Forsyth

Wednesday 12 March 2003 3:50:59 pm

> > > Anyone know how to do have ez 3 call an item within a
> > folder
> > > to be displayed inline at random?
> >
> > If you want a random banner EACH refresh, you'll need to
> run
> > a scripts everytime index.php is loaded. Create a random
> > banner script with an output of the of the banner or the
> > complete link (whatever).
> > Put the output in a variable and echo the variable in
> the
> > templates.!
> >
> > See http://ezwiki.blanko.info/index.php/3XHT_UsePHP
>
> Hans, Did you find that worked with cache enabled?

We have a very simple patch to the ez3 kernel to create a random number that you would use within templates. This doesnt quite address what you want but if you were using choosing images from within the design folder it may help.

The patch adds an operator, eg {rand(1,5)} picks a random integer between 1 and 5. Note that this will type of use will be seperate from cached images.

If this helps anyone Ill put it on the ezwiki site.

Paul

Paul Forsyth

Wednesday 12 March 2003 3:57:10 pm

> > > Anyone know how to do have ez 3 call an item within a
> > folder
> > > to be displayed inline at random?
> >
> > If you want a random banner EACH refresh, you'll need to
> run
> > a scripts everytime index.php is loaded. Create a random
> > banner script with an output of the of the banner or the
> > complete link (whatever).
> > Put the output in a variable and echo the variable in
> the
> > templates.!
> >
> > See http://ezwiki.blanko.info/index.php/3XHT_UsePHP
>
> Hans, Did you find that worked with cache enabled?

We have a very simple patch to the ez3 kernel to create a random number that you would use within templates. This doesnt quite address what you want but if you were using choosing images from within the design folder it may help.

The patch adds an operator, eg {rand(1,5)} picks a random integer between 1 and 5. Note that this will type of use will be seperate from cached images.

If this helps anyone Ill put it on the ezwiki site.

Paul

Dan Zembrosky

Wednesday 12 March 2003 7:34:33 pm

> > > > Anyone know how to do have ez 3 call an item
> within a
> > > folder
> > > > to be displayed inline at random?
> > >
> > > If you want a random banner EACH refresh, you'll
> need to
> > run
> > > a scripts everytime index.php is loaded. Create a
> random
> > > banner script with an output of the of the banner
> or the
> > > complete link (whatever).
> > > Put the output in a variable and echo the variable
> in
> > the
> > > templates.!
> > >
> > > See
> http://ezwiki.blanko.info/index.php/3XHT_UsePHP
> >
> > Hans, Did you find that worked with cache enabled?
>
> We have a very simple patch to the ez3 kernel to create a
> random number that you would use within templates. This
> doesnt quite address what you want but if you were using
> choosing images from within the design folder it may help.
>
>
> The patch adds an operator, eg {rand(1,5)} picks a random
> integer between 1 and 5. Note that this will type of use
> will be seperate from cached images.
>
> If this helps anyone Ill put it on the ezwiki site.
>
> Paul

Tat would be very useful. Please do, thank you.

Dan Zembrosky

Wednesday 12 March 2003 7:55:22 pm

> > > > Anyone know how to do have ez 3 call an item
> within a
> > > folder
> > > > to be displayed inline at random?
> > >
> > > If you want a random banner EACH refresh, you'll
> need to
> > run
> > > a scripts everytime index.php is loaded. Create a
> random
> > > banner script with an output of the of the banner
> or the
> > > complete link (whatever).
> > > Put the output in a variable and echo the variable
> in
> > the
> > > templates.!
> > >
> > > See
> http://ezwiki.blanko.info/index.php/3XHT_UsePHP
> >
> > Hans, Did you find that worked with cache enabled?
>
> We have a very simple patch to the ez3 kernel to create a
> random number that you would use within templates. This
> doesnt quite address what you want but if you were using
> choosing images from within the design folder it may help.
>
>
> The patch adds an operator, eg {rand(1,5)} picks a random
> integer between 1 and 5. Note that this will type of use
> will be seperate from cached images.
>
> If this helps anyone Ill put it on the ezwiki site.
>
> Paul

That would be very helpful, thanks!

Paul Forsyth

Thursday 13 March 2003 1:15:05 am

> > > > > Anyone know how to do have ez 3 call an item
> > within a
> > > > folder
> > > > > to be displayed inline at random?
> > > >
> > > > If you want a random banner EACH refresh, you'll
> > need to
> > > run
> > > > a scripts everytime index.php is loaded. Create a
> > random
> > > > banner script with an output of the of the banner
> > or the
> > > > complete link (whatever).
> > > > Put the output in a variable and echo the variable
> > in
> > > the
> > > > templates.!
> > > >
> > > > See
> > http://ezwiki.blanko.info/index.php/3XHT_UsePHP
> > >
> > > Hans, Did you find that worked with cache enabled?
> >
> > We have a very simple patch to the ez3 kernel to create
> a
> > random number that you would use within templates. This
> > doesnt quite address what you want but if you were using
> > choosing images from within the design folder it may
> help.
> >
> >
> > The patch adds an operator, eg {rand(1,5)} picks a
> random
> > integer between 1 and 5. Note that this will type of use
> > will be seperate from cached images.
> >
> > If this helps anyone Ill put it on the ezwiki site.
> >
> > Paul
>
> That would be very helpful, thanks!

Ok its referenced from ezwiki:

http://ezwiki.blanko.info/index.php/eZp%203.x%20-%20User%20modifications

I had to submit it as a bug report to get the file onto a page i could reference :) Let me know how you get on.

btw, ive now realised that the bug report i submitted is slightly wrong. it should have said 'greater than or equal to 0'... doh. wish we could edit or add to bug reports.

Paul

Paul Forsyth

Thursday 13 March 2003 1:32:27 am

> > > > > Anyone know how to do have ez 3 call an item
> > within a
> > > > folder
> > > > > to be displayed inline at random?
> > > >
> > > > If you want a random banner EACH refresh, you'll
> > need to
> > > run
> > > > a scripts everytime index.php is loaded. Create a
> > random
> > > > banner script with an output of the of the banner
> > or the
> > > > complete link (whatever).
> > > > Put the output in a variable and echo the variable
> > in
> > > the
> > > > templates.!
> > > >
> > > > See
> > http://ezwiki.blanko.info/index.php/3XHT_UsePHP
> > >
> > > Hans, Did you find that worked with cache enabled?
> >
> > We have a very simple patch to the ez3 kernel to create
> a
> > random number that you would use within templates. This
> > doesnt quite address what you want but if you were using
> > choosing images from within the design folder it may
> help.
> >
> >
> > The patch adds an operator, eg {rand(1,5)} picks a
> random
> > integer between 1 and 5. Note that this will type of use
> > will be seperate from cached images.
> >
> > If this helps anyone Ill put it on the ezwiki site.
> >
> > Paul
>
> That would be very helpful, thanks!

Ok its referenced from ezwiki:

http://ezwiki.blanko.info/index.php/eZp%203.x%20-%20User%20modifications

I had to submit it as a bug report to get the file onto a page i could reference :) Let me know how you get on.

btw, ive now realised that the bug report i submitted is slightly wrong. it should have said 'greater than or equal to 0'... doh. wish we could edit or add to bug reports.

Paul

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 30 2025 22:24:53
Script start
Timing: Jan 30 2025 22:24:53
Module start 'layout'
Timing: Jan 30 2025 22:24:53
Module start 'content'
Timing: Jan 30 2025 22:24:55
Module end 'content'
Timing: Jan 30 2025 22:24:55
Script end

Main resources:

Total runtime1.1365 sec
Peak memory usage8,192.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.1328151.2109
Module start 'layout' 0.00520.0036 739.3438220.7031
Module start 'content' 0.00881.1268 960.04694,584.6875
Module end 'content' 1.13560.0008 5,544.734423.8594
Script end 1.1364  5,568.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2956160.0002
Check MTime0.00120.1097160.0001
Mysql Total
Database connection0.00070.065610.0007
Mysqli_queries1.006388.5451740.0136
Looping result0.00080.0699720.0000
Template Total1.080695.120.5403
Template load0.00190.167020.0009
Template processing1.078694.912420.5393
Template load and register function0.00140.126510.0014
states
state_id_array0.00110.097010.0011
state_identifier_array0.00200.177520.0010
Override
Cache load0.00210.18802310.0000
Sytem overhead
Fetch class attribute can translate value0.00160.140630.0005
Fetch class attribute name0.00220.189890.0002
XML
Image XML parsing0.00070.061730.0002
class_abstraction
Instantiating content class attribute0.00000.001590.0000
General
dbfile0.00100.0923160.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/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: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs