/* ======================================================================================== * WMLink Version 0.1 * Another PHP & MySQL driven News Publishing system * * Filename : wmupoll.php * Description : Part of WMLink, user polling script * Last Updated : Thursday, June 24, 2004 09:45:17 AM * Latest Version : http://wartamikael.org/PHPScripts/ * * Copyright (c) 2004 Rudy S. Ingga (toekangweb@wartamikael.org). All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ======================================================================================== */ /* ----------------------------------------- * * Tables, configuration and library we need * * ----------------------------------------- */ $pdesc_file="WMPollDesc"; // Poll Description Table $pdata_file="WMPollData"; // Poll Data Table // $plog_file="PollLog"; // Poll Log Table if(!isset($config)){include("config/config.php");} // Your Configuration File like Your Database server, etc... if(!isset($lib_lib)){include("libs/lib-wmlib.php");} if(!isset($lib_poll)){include("libs/lib-wmpoll.php");} /* ---------------- * * Begin the action * * ---------------- */ $output = ""; $numpage = 0; if(!isset($act)){ $PollID = poll_latest(); if($PollID > 0){ $output .= poll_vote($PollID); }else{ $output .= "
$T_POLL $T_NOEXISTS!
"; } }elseif($act == "votepoll"){ $output .= poll_vote($PollID); }elseif($act == "collect"){ poll_collect($PollID, $PollDataID); $output .= poll_results($PollID); }elseif($act == "results"){ $output .= poll_results($PollID); }elseif($act == "vipoll"){ if(!isset($pos)){$pos=0;} $temp_pos = $pos; $get_count = mysql_query("SELECT COUNT(PollID) AS Total FROM $pdesc_file",$db); $count_row = @mysql_fetch_array($get_count); $numrec = $count_row[Total]; $numpage = intval($numrec/$step); if($numrec%$step){ $numpage++; } $get_poll = mysql_query("SELECT * FROM $pdesc_file ORDER BY PollDate DESC LIMIT $pos,$step",$db); if(mysql_num_rows($get_poll) == "0"){ $output .= <<$T_RETURN EOF; }else{ $output .= "
| $get_rows[PollDesc] $pretty_time |
Managed by WMLink, PHP & MySQL"; include("$base_themepath/$theme/body-inside-close.php"); include("$base_themepath/$theme/footer.php"); mysql_close($db); ?>