1. add the following sql to your database:
PHP Code:
CREATE TABLE IF NOT EXISTS `polls` ( `id` int(10) unsigned NOT NULL auto_increment, `added` int(11) NOT NULL, `question` varchar(255) collate utf8_bin NOT NULL default '', `option0` varchar(40) collate utf8_bin NOT NULL default '', `option1` varchar(40) collate utf8_bin NOT NULL default '', `option2` varchar(40) collate utf8_bin NOT NULL default '', `option3` varchar(40) collate utf8_bin NOT NULL default '', `option4` varchar(40) collate utf8_bin NOT NULL default '', `option5` varchar(40) collate utf8_bin NOT NULL default '', `option6` varchar(40) collate utf8_bin NOT NULL default '', `option7` varchar(40) collate utf8_bin NOT NULL default '', `option8` varchar(40) collate utf8_bin NOT NULL default '', `option9` varchar(40) collate utf8_bin NOT NULL default '', `option10` varchar(40) collate utf8_bin NOT NULL default '', `option11` varchar(40) collate utf8_bin NOT NULL default '', `option12` varchar(40) collate utf8_bin NOT NULL default '', `option13` varchar(40) collate utf8_bin NOT NULL default '', `option14` varchar(40) collate utf8_bin NOT NULL default '', `option15` varchar(40) collate utf8_bin NOT NULL default '', `option16` varchar(40) collate utf8_bin NOT NULL default '', `option17` varchar(40) collate utf8_bin NOT NULL default '', `option18` varchar(40) collate utf8_bin NOT NULL default '', `option19` varchar(40) collate utf8_bin NOT NULL default '', `sort` enum('yes','no') collate utf8_bin NOT NULL default 'yes', `location` tinyint(1) NOT NULL default '1', PRIMARY KEY (`id`), KEY `location` (`location`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=18 ;
PHP Code:
CREATE TABLE IF NOT EXISTS `pollanswers` ( `id` int(10) unsigned NOT NULL auto_increment, `pollid` int(10) unsigned NOT NULL default '0', `userid` int(10) unsigned NOT NULL default '0', `selection` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `pollid` (`pollid`), KEY `selection` (`selection`), KEY `userid` (`userid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=14 ;
2. to display tho Poll on index find:
PHP Code:
$HTMLOUT .= "<div style='text-align:left;width:80%;border:1px solid blue;padding:5px;'> <div style='background:lightgrey;height:25px;'><span style='font-weight:bold;font-size:12pt;'>{$lang['stats_title']}</span></div>
and above it add:
PHP Code:
$HTMLOUT .="<script type='text/javascript' src='scripts/jquery.js'></script> <script type='text/javascript' src='scripts/poll.core.js'></script> <script type='text/javascript'> var jq = jQuery.noConflict(); jq(document).ready(function(){ loadpoll(); });</script>"; $pollbutton = ''; $pollbutton1 = ''; $pollbutton1 = " <span style='float:right;'>[<a href='polloverview.php'>{$lang['index_prev']}</a>]</span>\n"; if (get_user_class() >= UC_ADMINISTRATOR) $pollbutton = " <span style='float:right;'>[<a href='makepoll.php'>{$lang['index_new']}</a>]</span>\n"; $HTMLOUT .= "<div style='text-align:left;width:80%;border:1px solid blue;padding:5px;'> <div style='background:lightgrey;height:25px;'><span style='font-weight:bold;font-size:12pt;'>{$lang['index_poll']}</span>{$pollbutton1}{$pollbutton}</div> <table align='center' class='main' width='758' cellspacing='0' cellpadding='10'> <tr> <td align='center'> <div id='poll_container'> <div id='loading_poll' style='display:none'></div> <noscript> <b>{$lang['index_java']}</b> </noscript> </div> </td> </tr> </table> </div> \n";
3. open lang\en\lang_index.php and add
PHP Code:
'index_poll' => "Site Poll",
index_java' => "This requires javascript enabled",
'index_new' => "New Poll",
'index_prev' => "Previos Polls",
4. open each of your style sheets and at the very top add:
PHP Code:
@import "poll.core.css";
5. upload the files from the attachement to your root folder and the 2 files from the scripts folder to your scripts folder and language files to your lang\en folder
FreakyNutz@tbdev.net/index.php?showtopic=22339