ABC CMS Pro
10.12.2004

Tags list for 'voting' module

Note! Every template must begin with <%tloop section%> and finish with<%tendloop section%>
All the other tags are included between them.

This module is used for public poll/voting system

The working procedure
Create a form with a question and variants of answers (see the description below). * When the visitor has chosen a variant and pushed the button, his vote is calculated and * all results are displayed. The results are displayed both in text and graphics variants.

Note! Delete all comments (i.e. // Page text) before using the templates for site design

Tags are described below


// Vote form for question number # (replace with question id)

<%tif voting_#%>
<%tloop voting_#%>

// A form for posting public poll system
// Replace dots'...' with section's id and page's id, created for displaying voting results

<form action="index.php?s=...?p=..." method="post" name="vote_
<%tlv n%>">

// System field with question number cannot be changed!!!

<input type="hidden" name="voting[question]" value="<%tlv id%>">

// Text of a question

<%tlv question%>

// Answers' list with a possibility to choose one of them (radio)

<%tloop answers%>

<input name="voting[answer]" type="radio" value="<%tlv n%>"> // Radio switcher
<%tlv answer%> // answer's text

<%tendloop answers%>

<input type="submit" name="submit" value="Vote"> // 'Vote'can be replaced with your text

</form>


<%tendloop voting_#%>
<%tendif voting_#%>






// Page for posting voting results appears after the button [submit] is pushed on in a previous form

// Voting success message

<%tif voting_success%>
<%tlv voting_success%>
<%tendif voting_success%>


// Voting errors

<%tif voting_errors%>
<%tloop voting_errors%>


<%tlv error%> // Error message

<%tendloop voting_errors%>
<%tendif voting_errors%>



// Posting the voting results

<%tloop voting_info%>

<%tlv question%> // Question text

You Answer: <%tlv your_answer%> // Your answer

// Answers list with results

<%tloop answers%>

<%tlv votes_pix%> // Width in pixels to use with image:
// Example: <td width="<%tlv votes_pix%>" height="17" nowrap background="vote.gif"></td>

<%tlv votes_percent%>% // number of votes in percent
<%tlv votes_number%>% // quantity of votes

<%tendloop answers%>

Number of votes: <%tlv total_answers%> // Total votes


<%tendloop voting_info%>