![]() |
[EDIT] Some users found a badley-coded part of the hack, I am rewriting that part and therefore have deleted the url from this post[/EDIT]
The Poll Hack for the vB, now updated for speed and fuctionality. Demo at http://www.naboonline.com/polltest/ new features from 0.9.2 (previous version) - if a user votes without logging in, is asked to login and the pollvote still counts (2 new templates,error_pollvotenologin, error_pollvoteinvaliduser) - Graphical view of poll results available. Template pollyesvote has a new variable $pollbargraph. If you do not want to have the graphical view, simply remove the variable. - poll icon ist now not needed to be inserted into the vBulletin icon db. - new file pollmodule.php - hacks in files only reference to it, much less code to enter into the new files! - speed enhancements and less mysql calls. Overall features - Let registered users post a new thread that has a poll integrated in it - Let registered users vote on the poll - Multiple votes impossible as userid is stored on vote - Define # of poll options in CP - Limit who can post a poll by usergroups (from the control panel) - Designed to be easily translated. Only some text is hard coded (see localisation section below) - Fully templateable - you can customise the look of the poll - Users who can not post can not vote as well - Make sure person did not vote, press back, and vote again - Admin/Moderator edit of Polls at all times - Edit Poll while no votes (for user who started the poll thread) - vB code parse for options - closing a thread == close a poll - Admin delete - View results without voting - Close a poll (admin/mod/author) - Graphical view of votes (bar graph and/or pie graph) **NEW** Note to upgraders: Due to a change in the how data is stored, the new poll is not backwards compatible. Therefore, you will need to run updatepoll.php The poll hack will be intergrated into vBulletin 2.0, so if you are in no hurry, you should better wait ;) [Edited by doron on 11-04-2000 at 06:00 AM] |
Hey doron, does this work with 1.1.4?
|
yes, there is a special 1.1.4 install file (notes114.txt) which details installing it on 1.1.4. the polltest forums run 1.1.4 now.
|
I'll install it on my test board then! (I love playing with new stuff). Unfortunately since the PM hack isn't compatible with 1.1.4, I can't go live with that version :(
But I'll let you know if I come across anything!! |
Hello Doron,
Thank you very much for your efforts. I am getting a couple of errors:
Quote:
|
double poll: go to your postbit template,
$posticon <smallfont><B>$postitle</b></smallfont> <p><normalfont>$message<BR><BR>$pollbit</normalfont></p> remove $pollbit. as for the 2nd, looking at it |
In showthread.php my line around 180 looks like this:
Code:
$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as postid,post.pagetext as pagetext,post.allowsmilie as allowsmilie,post.signature AS showsignature,post.title as title,post.ipaddress as ipaddress,post.iconid as iconid,post.username as fakename,post.userid as userid, user.usergroupid as usergroupid,user.userid as userid,user.email as email,user.username as username,user.usertitle as usertitle,user.signature as signature,user.showemail as showemail,user.homepage as homepage,user.icq as icq,user.aim as aim,user.yahoo as yahoo,user.joindate as joindate,user.posts as posts,user.usertext as usertext,user.iconpath as iconpath,user.city as city,user.state as state,user.country as country,user.receivepm as receivepm FROM post LEFT JOIN user ON (user.userid = post.userid) WHERE post.threadid=$threadid AND visible=1 ORDER BY dateline $postorder LIMIT $limitlower,$perpage"); Code:
$posts=$DB_site->query("SELECT post.pollid as pollid,post.dateline as dateline,post.postid as postid,post.pagetext as pagetext,post.allowsmilie as allowsmilie,post.signature AS showsignature,post.title as title,post.ipaddress as ipaddress,post.iconid as iconid,post.username as fakename,post.userid as userid, user.usergroupid as usergroupid,user.userid as userid,user.email as email,user.username as username,user.usertitle as usertitle,user.signature as signature,user.showemail as showemail,user.homepage as homepage,user.icq as icq,user.aim as aim,user.yahoo as yahoo,user.joindate as joindate,user.posts as posts,user.usertext as usertext,user.iconpath as iconpath,user.city as city,user.state as state,user.country as country,user.receivepm as receivepm FROM post LEFT JOIN user ON (user.userid = post.userid) WHERE post.threadid=$threadid AND visible=1 ORDER BY dateline $postorder LIMIT $limitlower,$perpage"); |
No because that error is being generated by a query in poll.php
|
ahh, you have some of the optimisation hacks installed, so yes, that should help.
perhaps you should kill your cookies and see if that helps too. |
I would say that poll.php isn't getting the threadid passed onto it after the user logs in i.e. <SUBMIT type="hidden" name="threadid" value="$threadid">
|
Hello,
Here is the HTML in the form: Code:
<FORM ACTION=poll.php method=post> |
Jim you should delete that line with your password as I could now log on as you by passing the encrypted password on the command line.
I tried to access that thread but it must be in a forum that I don't have access to and I forget the login info for phpMyAdmin so I could tweak myself to an admin ;) [Edited by freddie on 11-03-2000 at 06:47 PM] |
Freddie - I made you an admin and emailed you your password to webmaster@hedgehogwheels.com
Also - Doron tried logging in and said he was able to vote on the poll. I have tried clearing my cookies...Other users have tried and gotten the same error I did. I don't see how he could have voted and myself and my users cannot. [Edited by VirtueTech on 11-03-2000 at 06:54 PM] |
Well Jim I logged on as you using the trick I warned you about and this is what I see as the code for the page where it asks for your name/password
Code:
<form action="poll.php" method=post> |
I was able to vote as myself as it didn't ask me to login.
I don't know how Doron tells if you are logged in but it should not be asking you to login when click on the vote button. Are you checking if $bbuserid != 0? |
Hello Freddie,
GOD what trick is that? ICQ me if you don't mind...please and tell me...thanks. Also...why does it go to the password page if I am already logged in... If you lookk above you will see the HTML source from the showthread page where the poll resides. |
this is wierd, why is it for you not handing over the id's with form submit, but is for me and new people.
I'd suspect it is in my coding, but there is nothing that would differenciate between users. |
My user on his forum is not new, it has been there since day 1.
Jim edit your post where you posted the HTML and remove the line that has your password in it! |
Jim has a space in his name whereas we don't, you could start with that and go from there.
[edit] Yes I changed my name to "rangers fan" and now I get prompted to login so your user verification code is at fault. Why do you pass the password/username through the form instead of just checking for $bbuserid == 0 in poll.php and prompting them to login if it is 0? btw Jim I was reading the threads in the mods forum and you can't embed viruses into .jpgs so don't fear that someone can get a virus by uploading avatars. What people believe, geez. [Edited by freddie on 11-03-2000 at 07:23 PM] |
freddie: came to the same conclusion, i sent him a fix, gonna see if that helps. stupid mistakeof mine
|
Ahhh I did not think of that....YES...that is it.
|
Doron - so you don't get confused by my last post....the fix did not work.
|
Freddie - I don't want the moderators to know about the control panel and other such things...but I do agree with your statement.
|
The problem is that you need to put quotes around your form variables.
ie username="$username" instead of username=$username ;) Can I mod the "Bugs in Hacks" forum also? |
Damn doron you made it difficult, you need to put more of it into templates. Jim you need to edit the code that sets the $formend variable in pollmodule.php and put quotes around the line that sets the $username
This line: Code:
$formend= "<INPUT TYPE=hidden NAME=action VALUE=pollvote><INPUT TYPE=hidden NAME=username VALUE=$bbusername><INPUT TYPE=hidden NAME=password VALUE=$bbpassword><INPUT TYPE=submit NAME=submitaction VALUE=Vote!> <A HREF=poll.php?action=showresults&pollid=$pollid><normalfont>View Results</normalfont></A></FORM>"; Code:
$formend= "<INPUT TYPE=\"hidden\" NAME=\"action\" VALUE=\"pollvote\"><INPUT TYPE=\"hidden\" NAME=\"username\" VALUE=\"$bbusername\"><INPUT TYPE=\"hidden\" NAME=\"password\" VALUE=\"$bbpassword\"><INPUT TYPE=\"submit\" NAME=\"submitaction\" VALUE=\"Vote!\"> <A HREF=\"poll.php?action=showresults&pollid=$pollid\"><normalfont>View Results</normalfont></A></FORM>"; [Edited by freddie on 11-03-2000 at 07:53 PM] |
you mean the pollmodule.php....new zip is up with the fix.
it's complex cause I do it dynamically, not via templates. It's a waste of mysql for one line only. now this should be settled, I aplogise for the inconvinience. but that is what users are for, to be misused for finding bugs ;) |
Doron yes but I do some dynamic things in my hacks also and you can use templates, albeit alot of them. Just look how many I use in my hacks.
|
Something's wrong...
When i click on 'view results' i get this: There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser. An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists. We apologise for any inconvenience. And guess what you get on 'polltest forum'. :p http://www.naboonline.com/polltest Here's address line http://www.naboonline.com/polltest/p...pollid=$pollid There should be number instead of $pollid, right? [Edited by PeF on 11-03-2000 at 09:02 PM] |
Same problem here ... the "view results" link does not work.
http://209.15.159.99/showthread.php?threadid=60884 Go there and try for yourself. |
The $pollid is being escaped somehow so it isn't being parsed. I will let Doron tell you how to fix it when he comes online..
|
This hack is very unoptimized....the person who told me this will remain anonymous.
|
Wasn't I as I have never actually looked at it other than to help fix todays problem..
|
Hmm, after looking through the code, the killer lies here:
Code:
$pollidcheck=$DB_site->query_first("SELECT pollid FROM post WHERE threadid=$threadid"); |
ouch...maybe I should take this off for now.
|
Quote:
It's easy to sit back and complain about the work of others, not so easy to do it yourself. Your source would do well to remember that doron is doing this out of the goodness off his heart and doesn't have to contribute anything at all. |
Quote:
that is need however, as forumdisplay checks threads, not posts. And users wanted to have the poll icon showed without it being choosen. I could add a table to thread which would help. You can remove that code, but the custom icon won't show then. http://www.naboonline.com/pollhack/pollmodule.php has the fix for the nonescaped showresults, it regressed cause of trying to fix the space thing at 1 AM here, and I was not thinking correctly. I'll fix the pollidcheck thing today and add a column to the thread table. Sorry again for this, I shoudl have tested this more, but I had 30 people email me last week requesting this hack. |
ok, I now have the optimised version done, thanks to Ed for finding that. i had removed such code away from all other files before, somehow forgot to do that for forumdisplay.php
http://www.naboonline.com/pollhack/pollupgrade.zip is for those who are stuck with the unoptomised version. http://www.naboonline.com/pollhack/pollv101.zip has the full version If anyone else finds anything wrong, don't hesitate to tell. thanks to you all for testing this and all, I guess I should be spanked for this (anyone have a paddle)? |
Works just fine. Thanks to all. :p
|
Hello Martin,
The comment made about the hack was simply to notify everyone about the truth of the hack....the person who I will still keep anonymous is very understanding that the hack was out of the goodness of dorons heart....we were just making him aware....and thanks goes to doron for his fix. :) |
I keep getting this error emailed to my administrators email address:
Quote:
|
All times are GMT. The time now is 03:24 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|