Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Poll (http://www.bvlist.com/showthread.php?t=5514)

Fynnon 13th October 2010 12:41

Poll
 
2 Attachment(s)
1. add the following sql to your database:
PHP Code:

CREATE TABLE IF NOT EXISTS `polls` (  `idint(10unsigned NOT NULL auto_increment,  `addedint(11NOT NULL,  `questionvarchar(255collate utf8_bin NOT NULL default '',  `option0varchar(40collate utf8_bin NOT NULL default '',  `option1varchar(40collate utf8_bin NOT NULL default '',  `option2varchar(40collate utf8_bin NOT NULL default '',  `option3varchar(40collate utf8_bin NOT NULL default '',  `option4varchar(40collate utf8_bin NOT NULL default '',  `option5varchar(40collate utf8_bin NOT NULL default '',  `option6varchar(40collate utf8_bin NOT NULL default '',  `option7varchar(40collate utf8_bin NOT NULL default '',  `option8varchar(40collate utf8_bin NOT NULL default '',  `option9varchar(40collate utf8_bin NOT NULL default '',  `option10varchar(40collate utf8_bin NOT NULL default '',  `option11varchar(40collate utf8_bin NOT NULL default '',  `option12varchar(40collate utf8_bin NOT NULL default '',  `option13varchar(40collate utf8_bin NOT NULL default '',  `option14varchar(40collate utf8_bin NOT NULL default '',  `option15varchar(40collate utf8_bin NOT NULL default '',  `option16varchar(40collate utf8_bin NOT NULL default '',  `option17varchar(40collate utf8_bin NOT NULL default '',  `option18varchar(40collate utf8_bin NOT NULL default '',  `option19varchar(40collate utf8_bin NOT NULL default '',  `sortenum('yes','no'collate utf8_bin NOT NULL default 'yes',  `locationtinyint(1NOT 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` (  `idint(10unsigned NOT NULL auto_increment,  `pollidint(10unsigned NOT NULL default '0',  `useridint(10unsigned NOT NULL default '0',  `selectiontinyint(3unsigned 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 "&nbsp;<span style='float:right;'>[<a href='polloverview.php'>{$lang['index_prev']}</a>]</span>\n"; if (get_user_class() >= UC_ADMINISTRATOR$pollbutton "&nbsp;<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


Attachment 2583

FreakyNutz@tbdev.net/index.php?showtopic=22339


All times are GMT +2. The time now is 23:37.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.