If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
How I make to show resulted in columns?  XML
Forum Index » Support Forum
Author Message
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Carbonize wrote:Might be worth you dropping Auron a PM as he's more familiar with AP.


thanks carbz
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

go to the poll admin panel then the templates section.

edit the templates to how you want the results to appear.

for more info on templates check my sig.

Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

thanks auron.. =)
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Hi auron,

i want to have like this one...



i downloaded already the guide. but i cant find the solution.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Yes I'm not sure that can be achieved using the templates. Would need a loop. eg

  1. $theDisplay = '<table border="0" width="500">';  
  2. $theCount = 0;  
  3. while (fetch results stuff)  
  4. {  
  5.   $theCount++;  
  6.   if ($theCount == 5)  
  7.   {  
  8.      $theDisplay .= "</tr>\n<tr>\n<td align=\"center\">{POLL STUFF}</td>\n";  
  9.      $theCount = 0;  
  10.   }  
  11.   else  
  12.   {  
  13.      $theDisplay .= "<td align=\"center\">{POLL STUFF}</td>\n";  
  14.   }  
  15. }  
  16. if ($theCount != 0)  
  17. {  
  18.    for($i = $theCount; $i < 5; $i++)  
  19.    {  
  20.       $theDisplay .= "<td> &nbsp; </td>\n";  
  21.    }  
  22.    $theDisplay .= "</tr>\n";  
  23. }  
  24. $theDisplay .= '</table>';  


Only a quick idea probably has bugs and I know the vriables aer not correct.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

afaik, the poll loops round using the same bit of html for each option.
so you'd have to modify the template yourself and whatever file calls the template.

the poll is designed to start the table -> echo each option with the html from the template -> then end the table.
In the admin panel when editing the template it is only possible to display one option at a time, if you doubled up the code for the options you would most likely get each option twice resulting in two columns.

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Carbonize wrote:Yes I'm not sure that can be achieved using the templates. Would need a loop. eg

  1. $theDisplay = '<table border="0" width="500">';  
  2. $theCount = 0;  
  3. while (fetch results stuff)  
  4. {  
  5.   $theCount++;  
  6.   if ($theCount == 5)  
  7.   {  
  8.      $theDisplay .= "</tr>\n<tr>\n<td align=\"center\">{POLL STUFF}</td>\n";  
  9.      $theCount = 0;  
  10.   }  
  11.   else  
  12.   {  
  13.      $theDisplay .= "<td align=\"center\">{POLL STUFF}</td>\n";  
  14.   }  
  15. }  
  16. if ($theCount != 0)  
  17. {  
  18.    for($i = $theCount; $i < 5; $i++)  
  19.    {  
  20.       $theDisplay .= "<td> &nbsp; </td>\n";  
  21.    }  
  22.    $theDisplay .= "</tr>\n";  
  23. }  
  24. $theDisplay .= '</table>';  


Only a quick idea probably has bugs and I know the vriables aer not correct.


what is the correct variable carbz?
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Don't know as I don't use AP and I cannot download zip files whilst at work.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Auron wrote:afaik, the poll loops round using the same bit of html for each option.
so you'd have to modify the template yourself and whatever file calls the template.

the poll is designed to start the table -> echo each option with the html from the template -> then end the table.
In the admin panel when editing the template it is only possible to display one option at a time, if you doubled up the code for the options you would most likely get each option twice resulting in two columns.


its hard to do.....
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Carbonize wrote:Don't know as I don't use AP and I cannot download zip files whilst at work.


Hi carbz,

in display_loop.html

this is the code

  1. <tr>   
  2.   <td width="15%"><input type="radio" name="option_id" value="$data[option_id]"></td>  
  3.   <td width="85%"><font face="$pollvars[font_face]" size="1" color="$pollvars[font_color]">$data[option_text]</font></td>  
  4. </tr>  
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

It would be the code in the poll that calls the templates I would need to look at.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

what about this one..

INCLUDE
class_poll.php

  1. <?php  
  2. /** 
  3. * ---------------------------------------------- 
  4. * Advanced Poll 2.0.7 (PHP/MySQL) 
  5. * Copyright (c) Chi Kien Uong 
  6. * URL: http://www.proxy2.de 
  7. * ---------------------------------------------- 
  8. */  
  9.   
  10. class poll {  
  11.   
  12.     var $db;  
  13.     var $tbl;  
  14.     var $pollvars;  
  15.     var $poll_view_html;  
  16.     var $poll_result_html;  
  17.     var $options;  
  18.     var $options_text;  
  19.     var $poll_question;  
  20.     var $form_forward;  
  21.     var $template_set;  
  22.     var $ip;  
  23.   
  24.     function poll() {  
  25.         global $POLLTBL, $CLASS;  
  26.         $this->tbl = $POLLTBL;  
  27.         $this->poll_view_html = array();  
  28.         $this->poll_result_html = array();  
  29.         $this->options = array();  
  30.         $this->options_text = array();  
  31.         $this->poll_question = array();  
  32.         $this->form_forward = basename($_SERVER['PHP_SELF']);  
  33.   
  34.         $this->ip = getenv("REMOTE_ADDR");  
  35.         $this->db = &$CLASS["db"];  
  36.         $this->pollvars = $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_config']));  
  37.         $this->template_set = "default";  
  38.           
  39.         if ($this->pollvars['result_order'] == "asc") {  
  40.             $this->pollvars['result_order'] = "ORDER BY votes ASC";  
  41.         } elseif ($this->pollvars['result_order'] == "desc") {  
  42.             $this->pollvars['result_order'] = "ORDER BY votes DESC";  
  43.         } else {  
  44.             $this->pollvars['result_order'] = '';  
  45.         }  
  46.     }  
  47.   
  48.     function set_template_set($template_set='') {  
  49.         if (!empty($template_set)) {  
  50.             $template_set = addslashes($template_set);  
  51.             $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_tplset']." WHERE tplset_name='$template_set'"));  
  52.             if ($this->db->record) {  
  53.                 $this->template_set = $template_set;  
  54.             } else {  
  55.                 $this->template_set = "default";  
  56.             }  
  57.         } else {  
  58.             $this->template_set = "default";  
  59.         }  
  60.         return $this->template_set;  
  61.     }  
  62.   
  63.     function set_display_order($order='') {  
  64.         switch ($order) {  
  65.             case "asc":  
  66.                 $this->pollvars['result_order'] = "ORDER BY votes ASC";  
  67.                 break;  
  68.             case "desc":  
  69.                 $this->pollvars['result_order'] = "ORDER BY votes DESC";  
  70.                 break;  
  71.             default:  
  72.                 $this->pollvars['result_order'] = "";  
  73.                 return false;  
  74.         }  
  75.         return true;  
  76.     }  
  77.   
  78.     function set_display_result($result='') {  
  79.         switch ($result) {  
  80.             case "votes":  
  81.                 $this->pollvars['type'] = "votes";  
  82.                 break;  
  83.             case "percent":  
  84.                 $this->pollvars['type'] = "percent";  
  85.                 break;  
  86.             default:  
  87.                 return false;  
  88.         }  
  89.         return true;  
  90.     }  
  91.   
  92.     function set_max_bar_length($max_bar_length=0) {  
  93.         if ($max_bar_length && $max_bar_length>0) {  
  94.             $this->pollvars['img_length'] = $max_bar_length;  
  95.             return true;  
  96.         } else {  
  97.             return false;  
  98.         }  
  99.     }  
  100.   
  101.     function set_max_bar_height($max_bar_height=0) {  
  102.         if ($max_bar_height && $max_bar_height>0) {  
  103.             $this->pollvars['img_height'] = $max_bar_height;  
  104.             return true;  
  105.         } else {  
  106.             return false;  
  107.         }  
  108.     }  
  109.   
  110.     function get_poll_tpl($tpl) {  
  111.         $tpl = addslashes($tpl);  
  112.         $this->db->fetch_array($this->db->query("SELECT x.*, y.* from ".$this->tbl['poll_tplset']." x, ".$this->tbl['poll_tpl']." y where x.tplset_name='$this->template_set' and x.tplset_id=y.tplset_id AND y.title='$tpl'"));  
  113.         if ($this->db->record['template']) {  
  114.             $this->db->record['template'] = ereg_replace("\"", "\\\"", $this->db->record['template']);  
  115.             return $this->db->record['template'];  
  116.         } else {  
  117.             return false;  
  118.         }  
  119.     }  
  120.   
  121.     function get_poll_data($poll_id) {  
  122.         $poll_id = intval($poll_id);  
  123.         if (!isset($this->options[$poll_id])) {             
  124.             $this->db->query("SELECT SUM(votes) as total FROM ".$this->tbl['poll_data']." WHERE (poll_id = '$poll_id')");  
  125.             $this->db->fetch_array($this->db->result);  
  126.             $this->options[$poll_id]['total'] = $this->db->record['total'];  
  127.             $this->db->query("SELECT * FROM ".$this->tbl['poll_data']." WHERE (poll_id = '$poll_id') ".$this->pollvars['result_order']);  
  128.             while ($this->db->fetch_array($this->db->result)) {  
  129.                 $option_id_arr[] = $this->db->record['option_id'];  
  130.                 $option_text_arr[] = $this->db->record['option_text'];  
  131.                 $option_votes_arr[] = $this->db->record['votes'];  
  132.                 $option_color_arr[] = $this->db->record['color'];  
  133.             }  
  134.             $this->options[$poll_id]['option_id'] = $option_id_arr;  
  135.             $this->options[$poll_id]['option_text'] = $option_text_arr;  
  136.             $this->options[$poll_id]['votes'] = $option_votes_arr;  
  137.             $this->options[$poll_id]['color'] = $option_color_arr;  
  138.             for ($i=0,$maxvote=0; $i<sizeof($option_votes_arr); $i++) {  
  139.                 $maxvote = ($option_votes_arr[$i]>$maxvote) ? $option_votes_arr[$i] : $maxvote;  
  140.             }  
  141.             $this->options[$poll_id]['maxvote'] = $maxvote;  
  142.         }  
  143.         return $this->options[$poll_id];  
  144.     }  
  145.   
  146.     function get_poll_option($poll_id) {  
  147.         $poll_id = intval($poll_id);  
  148.         if (!isset($this->options_text[$poll_id])) {             
  149.             $query = $this->db->query("SELECT option_id, option_text FROM ".$this->tbl['poll_data']." WHERE (poll_id = '$poll_id') order by option_id asc");  
  150.             while ($data = $this->db->fetch_array($query)) {  
  151.                 $option_id_arr[] = $this->db->record['option_id'];  
  152.                 $option_text_arr[] = $this->db->record['option_text'];  
  153.             }  
  154.             $this->options_text[$poll_id]['option_id'] = $option_id_arr;  
  155.             $this->options_text[$poll_id]['option_text'] = $option_text_arr;  
  156.         }  
  157.         return $this->options_text[$poll_id];  
  158.     }  
  159.   
  160.     function get_poll_question($poll_id) {  
  161.         $poll_id = intval($poll_id);  
  162.         if (!isset($this->poll_question[$poll_id])) {             
  163.             $row = $this->db->fetch_array($this->db->query("SELECT question FROM ".$this->tbl['poll_index']." WHERE (poll_id = '$poll_id')"));  
  164.             $this->poll_question[$poll_id] = $row['question'];  
  165.         }  
  166.         return $this->poll_question[$poll_id];  
  167.     }  
  168.   
  169.     function display_poll($poll_id) {  
  170.         $poll_id = intval($poll_id);  
  171.         if (!isset($this->poll_view_html[$poll_id]) || !isset($this->poll_view_html[$poll_id][$this->template_set])) {              
  172.             $pollvars = $this->pollvars;  
  173.             if (!isset($this->options_text[$poll_id])) {  
  174.                 $this->get_poll_option($poll_id);  
  175.             }  
  176.             $question = $this->get_poll_question($poll_id);  
  177.             eval("\$display_html = \"".$this->get_poll_tpl("display_head")."\";");  
  178.             $loop_html = $this->get_poll_tpl("display_loop");  
  179.             for ($i=0;$i<sizeof($this->options_text[$poll_id]['option_id']);$i++) {  
  180.                 $data['option_text'] = $this->options_text[$poll_id]['option_text'][$i];  
  181.                 $data['option_id'] = $this->options_text[$poll_id]['option_id'][$i];  
  182.                 eval("\$display_html .= \"$loop_html\";");  
  183.             }  
  184.             eval("\$display_html .= \"".$this->get_poll_tpl("display_foot")."\";");  
  185.             $this->poll_view_html[$poll_id][$this->template_set] = $display_html;  
  186.         }  
  187.         return $this->poll_view_html[$poll_id][$this->template_set];  
  188.     }  
  189.   
  190.     function view_poll_result($poll_id,$vote_stat=0) {  
  191.         $poll_id = intval($poll_id);  
  192.         if (!isset($this->poll_result_html[$poll_id]) || !isset($this->poll_result_html[$poll_id][$this->template_set])) {             
  193.             $pollvars = $this->pollvars;  
  194.             $row = $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_index']." WHERE (poll_id = '$poll_id')"));  
  195.             if (!$row) {  
  196.                 return "";  
  197.             }  
  198.             $question = $row['question'];  
  199.             $VOTE = ($vote_stat==1) ? $this->pollvars['voted'] : '';  
  200.             $COMMENT = ($row['comments']==1) ? "<a href=\"javascript:void(window.open('$pollvars[base_url]/comments.php?action=send&amp;id=$poll_id&amp;template_set=$this->template_set','$poll_id','width=230,height=320,toolbar=no,statusbar=no'))\">".$this->pollvars['send_com']."</a>" : '';  
  201.             eval("\$result_html = \"".$this->get_poll_tpl("result_head")."\";");  
  202.             $i=0;  
  203.             $loop_html = $this->get_poll_tpl("result_loop");  
  204.             if (!isset($this->options[$poll_id])) {  
  205.                 $this->get_poll_data($poll_id);  
  206.             }  
  207.             $maxvote = ($this->options[$poll_id]['maxvote'] == 0) ? 1 : $this->options[$poll_id]['maxvote'];  
  208.             $totalvotes = ($this->options[$poll_id]['total'] == 0) ? 1 : $this->options[$poll_id]['total'];  
  209.             for ($i=0;$i<sizeof($this->options[$poll_id]['option_id']);$i++) {  
  210.                 $img_width = (int) ($this->options[$poll_id]['votes'][$i]*$this->pollvars['img_length']/$maxvote);  
  211.                 $vote_count = $this->options[$poll_id]['votes'][$i];  
  212.                 $vote_percent = sprintf("%.2f",($this->options[$poll_id]['votes'][$i]*100/$totalvotes));  
  213.                 $vote_val = ($this->pollvars['type'] == "percent") ? sprintf("%.1f",($this->options[$poll_id]['votes'][$i]*100/$totalvotes))."%" : $vote_count;  
  214.                 $option_text = $this->options[$poll_id]['option_text'][$i];  
  215.                 $option_votes = $this->options[$poll_id]['votes'][$i];  
  216.                 $poll_color = $this->options[$poll_id]['color'][$i];  
  217.                 eval("\$result_html .= \"$loop_html\";");  
  218.             }  
  219.             $total_votes = $this->options[$poll_id]['total'];  
  220.             eval("\$result_html .= \"".$this->get_poll_tpl("result_foot")."\";");  
  221.             $this->poll_result_html[$poll_id][$this->template_set] = $result_html;  
  222.         }  
  223.         return $this->poll_result_html[$poll_id][$this->template_set];  
  224.     }  
  225.   
  226.     function update_poll($poll_id,$option_id) {  
  227.         $poll_id = intval($poll_id);  
  228.         $option_id = intval($option_id);  
  229.         $this->db->query("UPDATE ".$this->tbl['poll_data']." SET votes=votes+1 WHERE (poll_id='$poll_id') AND (option_id='$option_id')");  
  230.         $row = $this->db->fetch_array($this->db->query("SELECT logging as logging FROM ".$this->tbl['poll_index']." WHERE (poll_id = '$poll_id')"));  
  231.         $timestamp = time();  
  232.         if ($this->pollvars['check_ip'] == 2) {  
  233.             $this->db->query("INSERT INTO ".$this->tbl['poll_ip']." (poll_id,ip_addr,timestamp) VALUES ('$poll_id','$this->ip','$timestamp')");  
  234.         }  
  235.         if ($row['logging'] == 1) {  
  236.             $host = @gethostbyaddr($this->ip);  
  237.             $agent = addslashes(getenv("HTTP_USER_AGENT"));  
  238.             $this->db->query("INSERT INTO ".$this->tbl['poll_log']." (poll_id,option_id,timestamp,ip_addr,host,agent) VALUES ('$poll_id','$option_id','$timestamp','$this->ip','$host','$agent')");  
  239.         }  
  240.     }  
  241.   
  242.     function get_latest_poll_id() {  
  243.         $this->db->query("SELECT poll_id FROM ".$this->tbl['poll_index']." WHERE (status < '2') ORDER BY TIMESTAMP DESC LIMIT 1");  
  244.         $this->db->fetch_array($this->db->result);  
  245.         return (!isset($this->db->record['poll_id'])) ? 0 : $this->db->record['poll_id'];  
  246.     }  
  247.   
  248.     function get_random_poll_id() {  
  249.         $timestamp = time();  
  250.         $this->db->query("SELECT poll_id FROM ".$this->tbl['poll_index']." WHERE (status=1 AND exp_time>$timestamp) OR (status=1 AND expire=0)");  
  251.         while ($this->db->fetch_array($this->db->result)) {  
  252.             $poll_id_arr[] = $this->db->record['poll_id'];  
  253.         }  
  254.         if (!isset($poll_id_arr)) {  
  255.             return 0;  
  256.         }  
  257.         $available = sizeof($poll_id_arr)-1;  
  258.         srand((double) microtime() * 1000000);  
  259.         $random_id = ($available>0) ? rand(0,$available) : 0;  
  260.         return $poll_id_arr[$random_id];  
  261.     }  
  262.   
  263.     function is_active_poll_id($poll_id) {  
  264.         $poll_id = intval($poll_id);  
  265.         $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_index']." WHERE (poll_id='$poll_id' AND status=1)"));  
  266.         if (!$this->db->record) {  
  267.             return false;  
  268.         } elseif ($this->db->record['expire']==0) {  
  269.             return true;  
  270.         }  
  271.         return ($this->db->record['exp_time']<time()) ? false : true;  
  272.     }  
  273.   
  274.     function is_valid_poll_id($poll_id) {  
  275.         $poll_id = intval($poll_id);  
  276.         if ($poll_id>0) {  
  277.             $this->db->fetch_array($this->db->query("SELECT poll_id FROM ".$this->tbl['poll_index']." WHERE poll_id=$poll_id AND status<'2'"));  
  278.             return ($this->db->record['poll_id']) ? true : false;  
  279.         } else {  
  280.             return false;  
  281.         }  
  282.     }  
  283.   
  284.     function has_voted($poll_id) {  
  285.         $poll_id = intval($poll_id);  
  286.         $pollcookie = $poll_id;  
  287.         if (isset($_COOKIE['AdvancedPoll'][$pollcookie])) {  
  288.             return true;  
  289.         }  
  290.         if ($this->pollvars['check_ip']==2) {  
  291.             $today = time()-$this->pollvars['lock_timeout']*3600;  
  292.             $this->db->query("DELETE FROM ".$this->tbl['poll_ip']." WHERE (timestamp < $today)");  
  293.             $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_ip']." WHERE (ip_addr = '$this->ip' and poll_id='$poll_id')"));  
  294.             return ($this->db->record) ? true : false;  
  295.         }  
  296.     }  
  297.   
  298.     function get_query_strg($self) {  
  299.         if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {  
  300.             if (ereg("($self=[0-9]+)",$_SERVER['QUERY_STRING'],$regs)) {  
  301.                 $_SERVER['QUERY_STRING'] = str_replace($regs[1], "", $_SERVER['QUERY_STRING']);  
  302.             }  
  303.             $_SERVER['QUERY_STRING'] = str_replace("$self=", "", $_SERVER['QUERY_STRING']);  
  304.             if (empty($_SERVER['QUERY_STRING'])) {  
  305.                 $append = $_SERVER['PHP_SELF']."?";  
  306.             } else {  
  307.                 $query_vars = explode("&",$_SERVER['QUERY_STRING']);  
  308.                 $append = $_SERVER['PHP_SELF']."?";  
  309.                 for ($i=0; $i<sizeof($query_vars); $i++) {  
  310.                     if (!empty($query_vars[$i])) {  
  311.                         $append .= $query_vars[$i]."&amp;";  
  312.                     }  
  313.                 }  
  314.             }  
  315.         } else {  
  316.             $append = $_SERVER['PHP_SELF']."?";  
  317.         }  
  318.         return $append;  
  319.     }  
  320.   
  321.     function poll_process($poll_id='') {  
  322.         $poll_ident = (isset($_POST['poll_ident'])) ? intval($_POST['poll_ident']) : "";  
  323.         if ($poll_ident == "") {  
  324.             if (isset($_GET['poll_ident'])) {  
  325.                 $poll_ident = intval($_GET['poll_ident']);  
  326.             }  
  327.         }  
  328.   
  329.         $option_id = (isset($_POST['option_id'])) ? intval($_POST['option_id']) : "";  
  330.         if ($option_id == "") {  
  331.             if (isset($_GET['option_id'])) {  
  332.                 $option_id = intval($_GET['option_id']);  
  333.             }  
  334.         }  
  335.   
  336.         $action = (isset($_POST['action'])) ? trim($_POST['action']) : "";  
  337.         if ($action == "") {  
  338.             if (isset($_GET['action'])) {  
  339.                 $action = trim($_GET['action']);  
  340.             }  
  341.         }  
  342.   
  343.         if ($poll_id=="random") {  
  344.             $poll_id = (empty($poll_ident)) ? $this->get_random_poll_id() : $poll_ident;  
  345.         } elseif ($poll_id=="newest") {  
  346.             $poll_id = $this->get_latest_poll_id();  
  347.         }  
  348.         if ($this->is_valid_poll_id($poll_id)) {  
  349.             $voted = $this->has_voted($poll_id);  
  350.             $is_active = $this->is_active_poll_id($poll_id);  
  351.             if ($action=="results" && $poll_id==$poll_ident) {  
  352.                 return $this->view_poll_result($poll_id,0);  
  353.             } elseif (!$is_active) {  
  354.                 return $this->view_poll_result($poll_id,0);  
  355.             } elseif ($is_active && $voted) {  
  356.                 return $this->view_poll_result($poll_id,1);  
  357.             } elseif (!$voted && isset($option_id) && $action=="vote" && $poll_id==$poll_ident) {  
  358.                 $this->update_poll($poll_id,$option_id);  
  359.                 return $this->view_poll_result($poll_id,0);  
  360.             } else {  
  361.                 return $this->display_poll($poll_id);  
  362.             }  
  363.         } else {  
  364.             $error = "<b>Poll ID <font color=red>".intval($poll_id)."</font> does not exist.</b>";  
  365.             return $error;  
  366.         }  
  367.     }  
  368.   
  369. }  ?>   
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

carbz?
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Sorry I'm a tad busy at present. I will download it to my laptop for when I get some free time.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
jalmz
Beginner

Joined: 19/06/2006 06:48:16
Messages: 25
Offline

Carbonize wrote:Sorry I'm a tad busy at present. I will download it to my laptop for when I get some free time.


Thanks Carbz. =)
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum