View Full Version : [HTL] & [TXT] Edit Poll Options
Andreas
02-22-2004, 10:00 PM
Edit Poll Options
Version: 1.0
vB-version: 3.0.0 Release Candidate 2
Developer: Kirby
Install difficulty: Easy
File edits: 4
Template edits: 1
Description of the Hack:
By default it is not possible to change poll options (multiple votes, public) when you edit a poll.
This hack allows to change these options.
Please note that it is only possible to make a public poll non-public, you cannot make a non-public poll public with this hack.
History
1.00 Initial release
1.01 Updated instructions for vB 3.0.3
Dropped HTL
HACK INSTALLATION DETAILS:
Files modified for this Hack:
poll.php
Templates modified for this Hack:
editpoll.php
Merjawy
02-23-2004, 06:11 AM
hmmm I don't see the hack.. wheres the zip file? :)
gmarik
02-23-2004, 10:04 AM
It's lost, don't you see it?
Boofo
02-23-2004, 12:35 PM
I found 3 instances of this code in the poll.php:
$threadinfo = $DB_site->query_first("
SELECT *, NOT ISNULL(deletionlog.primaryid) AS isdeleted
Are we supposed to put this code above all 3?
if (!$pollinfo['public'] AND $public)
$public = 0;
Andreas
02-23-2004, 12:57 PM
No. Only around line 459 (for RC2).
Boofo
02-23-2004, 01:02 PM
Maybe you should update the instructions? ;)
Boofo
02-23-2004, 01:04 PM
The one under this?
start adding the edit to the db
Andreas
02-23-2004, 01:10 PM
Yep.
Instructions updated (line number added)
Boofo
02-23-2004, 01:13 PM
You might want to alos mention it is under that. RC3 has that on a different line. ;)
msimplay
03-14-2004, 06:19 PM
What did i do wrong i get that error :(
i use rc4 vb3
Database error in vBulletin 3.0.0 Release Candidate 4:
Invalid SQL:
UPDATE poll
SET numberoptions = '6',
question = 'Is this site any good ?',
votes = '0|||0|||0|||0|||0|||0',
options = 'Excellent|||Good|||Average|||Poor|||Never been here before|||I thought this used to be amc\'s homepage :S',
active = '1',
REPLACE that with
timeout = '0',
multiple = 0,
public = 1
WHERE pollid = 3
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'REPLACE that with
timeout = '0',
multiple = 0,
mysql error number: 1064
Date: Sunday 14th of March 2004 12:20:45 PM
Script: http://www.wambam.net/vbulletin/poll.php
Referer: http://www.wambam.net/vbulletin/poll.php?do=polledit&pollid=3
Username: wAmbAm
IP Address: 82.37.28.131
assassingod
03-14-2004, 06:25 PM
You've installed it incorrectly (You've copied text from the install file into the query accindently)
msimplay
03-14-2004, 06:38 PM
You've installed it incorrectly (You've copied text from the install file into the query accindently)
thank you fixed now :D very useful hack lol why on earth is this even a hack should be standard :mad:
msimplay
03-20-2004, 09:18 PM
ok what about vb3 gold now :o
I tried to install it in vB3 Gold, but there's something with the code in poll.php that needs to be changed.
msimplay
04-02-2004, 03:14 PM
I tried to install it in vB3 Gold, but there's something with the code in poll.php that needs to be changed.
i had a problem with installing this too
is this working in GOLD ?
msimplay
04-06-2004, 07:45 AM
is this working in GOLD ?
i tested it and its not working for me i don't know about anyone else
Not working in GOLD for me either.
Very useful...
/me clicks install
bleah. How a bad way of writing the TXT file. How can i know that the TXT file is not finished ? You shoud'v write an ending message. Like :
#########################3
That's id, i hope you enjoy my hack
Andreas
06-30-2004, 08:14 PM
Hmm, I haven't upgraded to Gold yet :(
But normally it should work.
I'll test that when I got time to do so.
theArchitect
11-05-2004, 10:26 PM
*theArchitect Clicks intalll*.
Very nice. Though I had to make a couple of changes to get it working with 3.0.3.
Andreas
11-05-2004, 10:36 PM
Hmm ... gonna check & update the instructions soon :)
theArchitect
11-06-2004, 02:49 AM
Hmm ... gonna check & update the instructions soon :) Sorry, I should have been more specific.
In your instructions your original code requested a find and replace for:
globalize($_POST, array('pollid' => INT, 'closepoll', 'pollquestion' => STR, 'options', 'pollvotes', 'timeout'));
while the original PHP was:
globalize($_POST, array('pollid' => INT, 'closepoll', 'pollquestion' => STR, 'options', 'pollvotes', 'timeout' => INT));
Another find and replace requested I search for:
timeout = '" . addslashes($timeout) . "'
while the original PHP was:
timeout = $timeout
Nit picking I know, but perhaps confusing for a newbie who is expecting a carbon copy with the find and replace.
And nice to see that you have updated the instructions too. :cool:
Love your work.
Andreas
11-06-2004, 04:45 AM
Yep. As this was originally written for RC2 the code to search for was a bit different.
In the meanwhile I already updated the instructions :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.