Creating average review results

Author Message

David Barker

Thursday 31 July 2003 3:40:16 pm

Hi,
I am going to use the enum variable in the products review class to create a review of 1 to 5 with 5 different stars but I would also like to create an average result for the review. Like if it got two reviews of 2/5 and 4/5, the average would be 3/5.

I was thinking maybe I could do this by making a new field in the 'product' class called 'Average Review' and have eZpublish insert the average review into that. What I would like to know is how to do make eZpublish calculate the average review (if possible) and how to make it insert it into the product it is assosicated with.

Thanks!

Dave

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:25:28
Script start
Timing: Jan 18 2025 19:25:28
Module start 'layout'
Timing: Jan 18 2025 19:25:28
Module start 'content'
Timing: Jan 18 2025 19:25:28
Module end 'content'
Timing: Jan 18 2025 19:25:28
Script end

Main resources:

Total runtime0.8144 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.0070 589.0469152.6250
Module start 'layout' 0.00700.0030 741.671939.4609
Module start 'content' 0.00990.8026 781.1328399.7031
Module end 'content' 0.81250.0018 1,180.83598.1641
Script end 0.8143  1,189.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4351160.0002
Check MTime0.00160.1925160.0001
Mysql Total
Database connection0.00110.130010.0011
Mysqli_queries0.773294.9456460.0168
Looping result0.00050.0646440.0000
Template Total0.771894.820.3859
Template load0.00220.271620.0011
Template processing0.769594.495820.3848
Template load and register function0.00020.025410.0002
states
state_id_array0.00240.297310.0024
state_identifier_array0.00380.472420.0019
Override
Cache load0.00180.225580.0002
Sytem overhead
Fetch class attribute can translate value0.00070.090210.0007
Fetch class attribute name0.00060.076610.0006
XML
Image XML parsing0.00010.013510.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00070.0852100.0001
String conversion0.00000.001140.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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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