Parašė Elvinas· 2009 Spa. 26 12:10:28
#1
}
if ($rows != 0) {
if ($_GET['rowstart'] == 0 && $fdata['thread_poll'] == "1") {
if (iMEMBER) {
$presult = dbquery(
"SELECT tfp.*, tfv.forum_vote_user_id FROM ".DB_FORUM_POLLS." tfp
LEFT JOIN ".DB_FORUM_POLL_VOTERS." tfv
ON tfp.thread_id=tfv.thread_id AND forum_vote_user_id='".$userdata['user_id']."'
WHERE tfp.thread_id='".$_GET['thread_id']."'"
);
} else {
$presult = dbquery(
"SELECT tfp.* FROM ".DB_FORUM_POLLS." tfp
WHERE tfp.thread_id='".$_GET['thread_id']."'"
);
}
if (dbrows($presult)) {
$pdata = dbarray($presult); $i = 1;
if (iMEMBER) { echo "<form name='voteform' method='post' action='".FUSION_SELF."?forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>\n"; }
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin-bottom:5px'>\n<tr>\n";
echo "<td align='center' class='tbl2'><strong>".$pdata['forum_poll_title']."</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
$presult = dbquery("SELECT * FROM ".DB_FORUM_POLL_OPTIONS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY forum_poll_option_id ASC");
$poll_options = dbrows($presult);
while ($pvdata = dbarray($presult)) {
if ((iMEMBER && isset($pdata['forum_vote_user_id']) || (!$fdata['forum_vote'] || !checkgroup($fdata['forum_vote'])))) {
$option_votes = ($pdata['forum_poll_votes'] ? number_format(100 / $pdata['forum_poll_votes'] * $pvdata['forum_poll_option_votes']) : 0);
echo "<tr>\n<td class='tbl1'>".$pvdata['forum_poll_option_text']."</td>\n";
echo "<td class='tbl1'><img src='".get_image("pollbar")."' alt='".$pvdata['forum_poll_option_text']."' height='12' width='".(200 / 100 * $option_votes)."' class='poll' /></td>\n";
echo "<td class='tbl1'>".$option_votes."%</td><td class='tbl1'>[".$pvdata['forum_poll_option_votes']." ".($pvdata['forum_poll_option_votes'] == 1 ? $locale['global_133'] : $locale['global_134'])."]</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><label><input type='radio' name='poll_option' value='".$i."' style='vertical-align:middle' /> ".$pvdata['forum_poll_option_text']."</label></td>\n</tr>\n";
$i++;
}
}
if ((iMEMBER && isset($pdata['forum_vote_user_id']) || (!$fdata['forum_vote'] || !checkgroup($fdata['forum_vote'])))) {
echo "<tr>\n<td align='center' colspan='4' class='tbl1'>".$locale['480']." : ".$pdata['forum_poll_votes']."</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><input type='submit' name='cast_vote' value='".$locale['481']."' class='button' /></td>\n</tr>\n";
}
echo "</table>\n</td>\n</tr>\n</table>\n";
if (iMEMBER) { echo "</form>\n"; }
}
Man reikia, kad cia rastu kur yra rast ta sakini kuris arba rodo rezultatus arba duoda balsuot.
Padekit:)