/** * page code function */ function MemberPrintPolls() { $query = "SELECT `ID`, `Question` FROM `polls_q` WHERE `Active` = 'on' ORDER BY `Question`"; $res = db_res($query); if (!$res or !mysql_num_rows($res)) { return "<div align=center>" . _t("_No polls available") . "</div>"; } $ret = '<div style="position:relative;"> <div class="clear_both"></div>'; while ($arr = mysql_fetch_array($res)) { $ret .= MemberPrintPoll($arr['ID']); } $ret .= '<div class="clear_both"></div> </div>'; return $ret; }
} $_page['header'] = _t("_Site Poll"); $_page['header_text'] = _t("_Site Poll"); $ID = (int) $_REQUEST['ID']; if ($_POST['vote']) { if (PollsVoteAdd()) { $actionText = _t_action("_Vote accepted"); } else { $actionText = _t_err("_You already voted"); } } else { $actionText = ''; } // --------------- page components $_ni = $_page['name_index']; $_page_cont[$_ni]['page_main_code'] = $actionText . MemberPrintPoll($ID); // --------------- [END] page components PageCode(); // --------------- page components functions /** * page code function */ function PageCompPageMainCode() { global $ID; } /** * Add vote */ function PollsVoteAdd() {