Periodic rotation of displayed articles

Author Message

martin k

Friday 14 October 2005 10:00:54 am

Hello,

I'm wondering if it's possible to make a periodic rotation of which article will be displayed once a user visits page. What I had in mind was to display a different "article of the day" chosen from all available articles.

I'm really not sure how to do this, didn't found any useful documentation. Took a look at cronjob.ini, but this only runs php-scripts?

Marko Žmak

Friday 14 October 2005 4:28:31 pm

Could you explain a little? Do you want that articles rotate in some order or randomly? If the sceond is the case, you coul just fetch a random article every time a page is displayed. A way to get a random nubmer is using eZ function for getting current time, together with the mod() function. Does this help you?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

martin k

Tuesday 18 October 2005 2:48:06 am

Yes, I wanted the articles to be rotated daily in some order. I think the right word for it is round-robin.

Anyway, we came up with a solution. My mate at work who is quite bright when it comes to databases made a solution using sql. He figured out that structure of the dynamic content was quite neatly arranged in the database. Since EZ uses article priority when it comes to which article to display, he just made a small script that rearranges priorities daily (runs from cron)

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 19:22:59
Script start
Timing: Jan 18 2025 19:22:59
Module start 'layout'
Timing: Jan 18 2025 19:22:59
Module start 'content'
Timing: Jan 18 2025 19:23:00
Module end 'content'
Timing: Jan 18 2025 19:23:00
Script end

Main resources:

Total runtime0.6798 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.0082 589.1484152.6406
Module start 'layout' 0.00820.0030 741.789139.4766
Module start 'content' 0.01120.6669 781.2656534.5156
Module end 'content' 0.67810.0017 1,315.78138.2969
Script end 0.6798  1,324.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5501160.0002
Check MTime0.00160.2399160.0001
Mysql Total
Database connection0.00120.174510.0012
Mysqli_queries0.632993.0979570.0111
Looping result0.00050.0707550.0000
Template Total0.645194.920.3225
Template load0.00290.433420.0015
Template processing0.642194.450720.3210
Template load and register function0.00020.035910.0002
states
state_id_array0.00190.284510.0019
state_identifier_array0.00090.132820.0005
Override
Cache load0.00240.3567120.0002
Sytem overhead
Fetch class attribute can translate value0.00070.100920.0003
Fetch class attribute name0.00120.169640.0003
XML
Image XML parsing0.00090.125320.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00090.1272180.0000
String conversion0.00000.001240.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
3content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs