Board member voting

Author Message

Tore Skobba

Friday 20 February 2004 4:42:09 am

Hi

In my site I have a need to have support for voting for boardmembers and various roles. For example:
Candidates______President Vice-Presiden Boardmember
Lotriam pura______[ ] [ ] [ ]
Tyurim____________[ ] [ ] [ ]
Porma_____________[ ] [ ] [ ]
etc

For each Candidates the user should select one of the roles (Presiden, Vice President and Boardmember). First I though about using "Option" for each candidate. However, there is a need to have a dynamic number of candidates. Do anyone here have any tips on how to implemnt such functionality with EZ ? Secondly note that each candidate should be an URL, i.e. clicking the name should lead the user to his appeal on the web.

I am not looking for specific code, more tips about how to start solve this. Which existing EZ attribute should I use etc. ?

Cheers
Tore

James Packham

Friday 20 February 2004 5:47:11 am

You could create a class that holds all the relevant information for a candiate (including for example their statement), so that each of the candiates can be represented by an object in the database. You can then add/remove candiates as necessary.

Then you could then build the list of candiates using a fetch statement in your template. You could then have a full.tpl override for each candidate that displayed everything you wanted to appear on their statement page.

To build the link between the two would be fairly simple, you would be able to find out the object variables needed for the link by doing an attribute show on a candidate.

There's also an example of a voting system in the blog siteaccess which should help you with some of the code.

Regards,

James

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 03:34:43
Script start
Timing: Jan 19 2025 03:34:43
Module start 'layout'
Timing: Jan 19 2025 03:34:43
Module start 'content'
Timing: Jan 19 2025 03:34:44
Module end 'content'
Timing: Jan 19 2025 03:34:44
Script end

Main resources:

Total runtime0.9437 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.1484152.6250
Module start 'layout' 0.00530.0027 741.773439.4297
Module start 'content' 0.00800.9345 781.2031494.9453
Module end 'content' 0.94240.0012 1,276.14848.1875
Script end 0.9437  1,284.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3211160.0002
Check MTime0.00130.1328160.0001
Mysql Total
Database connection0.00080.084110.0008
Mysqli_queries0.898695.2180540.0166
Looping result0.00050.0485520.0000
Template Total0.917697.220.4588
Template load0.00180.186420.0009
Template processing0.915897.041520.4579
Template load and register function0.00020.025210.0002
states
state_id_array0.00070.079010.0007
state_identifier_array0.00150.156520.0007
Override
Cache load0.00140.1530220.0001
Sytem overhead
Fetch class attribute can translate value0.00160.167520.0008
Fetch class attribute name0.00170.180530.0006
XML
Image XML parsing0.00100.104820.0005
class_abstraction
Instantiating content class attribute0.00000.001730.0000
General
dbfile0.00070.0790160.0000
String conversion0.00000.000540.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs