View Full Version : Polls Elsewhere
tubedogg
04-11-2001, 10:00 PM
v0.2.0 Released! Last Updated: 06/01/01
NOTE: DO NOT put this in your forums directory or it WILL overwrite your poll.php file! You must either a) put this in a separate directory or b) rename this to poll1.php or something similar (the script will still function correctly if you do this).
This hack is a request by Me2Be, to show the titles of the poll threads on another page. It uses the header and footer from your vB, and is for use as a stand-alone page. In a future release of the hack, I will look into displaying results of the polls also. For right now, though, it just displays the thread title, linked to that thread, and the forum that the thread is in (they are grouped by forum). You can set the forums to look for polls in, as well as how many polls you want to show on the main screen. There is a separate screen that will show all of the poll threads from any given forum, and a link to this screen is generated any time there are more threads than you want displayed. You can also customize it so you can use it as a separate page, or remove the HTML to use it as an include on another page (it is clearly labeled where to insert HTML).
For version: 2.0.0
Files needed: poll.php, pollconfig.php
Files to edit: pollconfig.php
Instructions
1] Download the zip file, and unzip it somewhere on your hard drive. Open pollconfig.php in an ASCII text editor, such as TextPad, UltraEdit, EditPlus, Notepad, Wordpad, or a similar program. DO NOT use a program such as HotDog, HoTMeTaL, FrontPage, or another WYSIWYG editor. I cannot support you if you open your file in one of these programs.
2] You need to edit the following variables:
$path - the path to your config.php, relative to where you are putting pollconfig.php. So, if your config.php file is in /home/me/html/forums/admin and you are putting this file in /home/me/html/ then the path is forums/admin - no trailing slash, and no "config.php".
$url - the URL to your forums. For example, http://www.mysite.com/forums - no trailing slash, no whateverfile.php.
$images - the URL to your forum images. For example, http://www.mysite.com/forums/images - no trailing slash, no whatever.gif.
$forums - the forum numbers to use, separated by a comma. You can find out the number of a forum by going to your forums' index.php and running your mouse over the link to the forum(s) you want to include. Make a note of "xx" in forumid=xx where xx is a number (this will appear in the status bar of your browser).
$maxresults - the maximum results to show on the main page for each forum. If you set this to 3, for example, and there are 5 polls in a given forum, the script will generate a "more polls for this forum" link, which will link to a page with all the polls for that forum listed.
$id - the ID of the replacement set you want to use. If you have a custom set, put that ID here. If you leave this blank it will use the style named "Default" that comes with vB.
3] Save this file.
4] Upload poll.php and pollconfig.php to your server. DO NOT UPLOAD the files to your vB directory! Doing so will overwrite the vB poll.php which will mean no one will be able to post new polls! Go to poll.php in a browser to make sure it is working correctly. Then you can link to it from another page, or from your forums.
Please do not contact me via ICQ, AIM, or PM about this hack. Post your question/problem here and I will see it and try to help you.
Enjoy!
Me2Be
04-12-2001, 04:30 PM
Thank you! Thank you!!
Actually, I didn't want the poll results on the page, so this is great. I'm off to try it now!
BTW, the demo link goes to a 404 page :)
tubedogg
04-12-2001, 04:33 PM
Whoops! You're right. Gotta fix that. edit: fixed :D
You're welcome. ;)
Me2Be
04-12-2001, 04:41 PM
Well, I replaced the poll.php and the pollconfig.php and uploaded it. When I go to test the poll.php file and put in my subject, message, check poll and enter how many options, it goes the the redirect screen and then back to the forumdisplay again.
It never went to ask me for poll options, and it also put my thread in the moderator queue (which is normal if someone creates a post, clicks poll and doesn't provide any options)
Me2Be
04-12-2001, 04:43 PM
Originally posted by tubedogg
Whoops! You're right. Gotta fix that. edit: fixed :DClose, just change it to poll.php instead of polls.php
But it looks great!!!
Is there a way to add the forum header/footer/styles?
(Aren't I full of questions?) :D
Streicher
04-12-2001, 04:45 PM
The Demo has still a 404 Error.
tubedogg
04-12-2001, 04:46 PM
Wait no no no! :D I'm sorry, don't replace poll.php - this is totally separate from that. I should have made that more clear. This is for elsewhere on one's site. Sorry...you need to reupload poll.php from beta 5 to your forums directory, and put poll.php from my hack in a separate directory, or rename it to poll1.php or something like that.
Streicher: Yes you're right. It is now really fixed. ;)
tubedogg
04-12-2001, 04:50 PM
Hmm...give me a little bit and I'll try to work in the header/footer styles.
jojo85
04-12-2001, 04:54 PM
Nice one thx :)
Me2Be
04-12-2001, 05:04 PM
Originally posted by tubedogg
Wait no no no! :D I'm sorry, don't replace poll.php - this is totally separate from that. I should have made that more clear. Oops! Thank GOODNESS I saved the other copy
(I backup everything when I make changes!)
I'm still on beta 2 (until next week when 6 comes out), I wonder if it will still work.
*off to try it*
Freddie Bingham
04-12-2001, 05:10 PM
I'm still on beta 2 (until next week when 6 comes out), I wonder if it will still work. Hopefully there will not be a beta 6.
RobAC
04-12-2001, 06:13 PM
Originally posted by freddie
Hopefully there will not be a beta 6.
Does this mean, we're shooting for full "production" by next week?????? :D :D :D
jojo85
04-12-2001, 06:16 PM
Originally posted by freddie
Hopefully there will not be a beta 6.
me too erf,want a stable release :rolleyes:
tubedogg
04-12-2001, 06:20 PM
Originally posted by RobAC
Does this mean, we're shooting for full "production" by next week?????? :D :D :D
I doubt it. ;) We got to get through a Release Candidate first, at least according to what's been said elsewhere around here. :)
Me2Be
04-13-2001, 02:16 PM
Originally posted by tubedogg
Hmm...give me a little bit and I'll try to work in the header/footer styles. Thanks Kevin!!!
I can't wait to go live with this :)
tubedogg
04-13-2001, 08:52 PM
After much hair-pulling and screaming at the monitor, I have completed the changes mentioned by Me2Be (adding the board's header and footer). You can take a look at the demo to see how it works.
Enjoy!
RobAC
04-13-2001, 10:32 PM
Where's the demo?? :D
Originally posted by RobAC
Where's the demo?? :D
Demo: http://www.tubescan.com/poll.php
at the very firt page!!
Me2Be
04-14-2001, 05:51 PM
Oh I am SOOOO happy! :D
**off to try it!!! **
THANK YOU KEVIN!!!!!
tubedogg
04-14-2001, 06:03 PM
You're welcome, Me2Be. ;)
Rob: Sorry I should have pointed that out. :D
One more thing I should point out: This will work with any beta from 2 through 5 (and probably 1, also). I said beta 5, but then I realized I was testing it with beta 2, not beta 5 (long story...) and so it does work with beta 2, and therefore should work with 1, and will work with 3 and 4.
eva2000
04-14-2001, 06:18 PM
wow nice... might need to upgrade to beta 5 for this :)
tubedogg
04-14-2001, 06:42 PM
It works with betas 2-4 also, George. ;)
DeMoN
04-14-2001, 06:45 PM
ne chance of a hack that puts a poll on ya main page like emm... the optims like a radio button. you know like the ones on sites well ne way. is it possible.
Me2Be
04-14-2001, 06:59 PM
I made a few "asthetic" modifications, but it works great!!! I'll send you the URL so you can check it out.
Also, I renamed your poll.php file to polllist.php so I could put it in the main directory and it works great!!!
If you ever decide to "enhance" upon this, can I throw out a couple more suggestions? (I'm saying "enhance" because it works great now!)
1] Ability to put the info HTML into a template so we can add some commentary (like "My Poll List") and a <title>Title</title>
2] Ability to use color styles of the style choice
Kevin, you did an awesome job and I can't thank you enough!!!! I love it!!
eva2000
04-14-2001, 07:04 PM
Originally posted by tubedogg
It works with betas 2-4 also, George. ;) great but i might wait until i upgrade to beta 5...
don't know why , but i feel like waiting for beta 6 or something...
julius
04-23-2001, 11:05 PM
Perfect, it is just I was looking for! :)
Thanks tubedogg.
In poll.php it seems there is not the close </ul> at the end of line 97.
It would be very nice to show the date the poll started, so people can know if they have already visited that poll or not. :)
Does this hack work with RC2?
julius
05-10-2001, 10:41 AM
yes
Mitrofan
05-18-2001, 12:03 PM
It seems that phpinclude stuff is not processed in header and footer when this hack is displayed.
I have $thefooter defined in phpinclude and with this hack is just displas $thefooter where the footer is supposed to be
Also Powered by: vBulletin $templateversion
is shown just like that, so the $templateversion variable is also not processed.
There must be a simple fix , please look into that.
Kevin, please respond to this post.
Streicher
05-18-2001, 08:49 PM
Is it possible to make a hack, which displays the results of a vote with the colored bars on a non vB page?
Mitrofan
05-21-2001, 06:08 PM
^^^^^^^
tubedogg, please respond to my previous post of phpinclude not working with this hack.
I really want to use this hack, but can't without phpinclude stuff working.
Peteruk
05-24-2001, 09:06 AM
Originally posted by Streicher
Is it possible to make a hack, which displays the results of a vote with the colored bars on a non vB page?
Thats what Ive been after for a while if you or anyone get their hands on anything like it be sure to gives us a bell and let me know, and i'll do likewise.
fruitsalad
05-25-2001, 05:43 PM
I'm having a problem with this script now that eventhough I se the maxresults to 5 or what have you in the config, the script is still pulling every single poll out.
tubedogg
06-01-2001, 08:17 PM
v0.2.0 has been released, and is updated to ensure it works with vBulletin 2.0.0. It also now includes the phpinclude template.
julius
06-01-2001, 09:48 PM
Parse error: parse error in /usr/local/plesk/apache/vhosts/myhost.com/httpdocs/forum/pollist.php on line 105
:(
Joshs
06-03-2001, 12:04 AM
I am getting the same exact error...
tubedogg
06-03-2001, 12:21 AM
I have updated the first post in this thread with v0.2.1 which fixes the parse error and this time actually utilizes the phpinclude template as opposed to just echoing it to the page. :rolleyes:
Joshs
06-03-2001, 12:27 AM
Now I am getting blank pages
tubedogg
06-03-2001, 12:33 AM
Try deleting poll.php and pollconfig.php off your server and reuploading them.
Joshs
06-03-2001, 12:35 AM
I did, still no luck...
tubedogg
06-03-2001, 12:40 AM
Is there anything in your phpinclude template?
Joshs
06-03-2001, 12:42 AM
No, Its empty
tubedogg
06-03-2001, 12:44 AM
You got a URL to where you've installed this?
Joshs
06-03-2001, 12:48 AM
<a href="http://tech.hytekcomputer.com/other/poll.php" target="_blank">http://tech.hytekcomputer.com/other/poll.php</a>
tubedogg
06-03-2001, 12:52 AM
OK dumb question time. Did you upload pollconfig.php? Did you set the path to your admin/config.php file correctly?
Try adding
<!-- This is a test comment -->
right after
require("pollconfig.php");
and see if it shows up on the page.
Joshs
06-03-2001, 12:55 AM
look at it now..., can you icq me? 107230003
tubedogg
06-03-2001, 01:00 AM
Sorry, I don't support hacks via ICQ.
That was my mistake - put this instead:
echo("<!-- This is a test comment -->");
right after
require("pollconfig.php");
Joshs
06-03-2001, 01:02 AM
I added that, I just wanted to add you to my icq list...
tubedogg
06-03-2001, 01:13 AM
Try removing
<html>
<head>
<body>
</body>
</html>
from poll.php and see if that helps.
Joshs
06-03-2001, 01:18 AM
Okay, now the comment is working, but not the polls... check it out...
Eficrx
06-03-2001, 01:18 AM
did you upload in ascii mode ?
it worked for me
Joshs
06-03-2001, 01:19 AM
I dont have to upload, just copy... My server is on my LAN...
tubedogg
06-03-2001, 01:28 AM
I'm at a loss, Josh. It works perfectly for me, and there's no reason it shouldn't just be not working, especially with no error messages.
Joshs
06-03-2001, 01:30 AM
here is my pollconfig.php
tubedogg
06-03-2001, 01:32 AM
Ok my next question is are you positive that path would work?
Maybe try setting it as
../forums/admin
Joshs
06-03-2001, 01:36 AM
I have it working for online.php...
Here is what I have:
Drive E > Sites folder
^
Forums & tech
Tubedogg, I want to ask you a weird question.
Is there any way you can add this in your script...
I like how it pulls the title of the polls, but is there any way you can get the first one to display the radio buttons, the option, and the 'vote' button where they can vote with this script?
For example, I would include the script on my main page and people would vote from there, and once they did, they would be directed to the poll in the forums.
What do you think? Can it be done? ;)
Eficrx
06-06-2001, 07:25 PM
im waiting for that as well he does have it on his site though.
daydreamer
06-08-2001, 03:09 AM
Of course, I get an error...
Fatal error: Call to unsupported or undefined function foreach() in /../..../.../pollpage.php3 on line 85
Any ideas?
dd
tubedogg
06-08-2001, 03:15 AM
First I'm positive that
/../..../.../
is not a valid path.
Also PHP 3 does not support foreach(). I'll probably look into some way around this but for now there's not much I can do. Sorry.
daydreamer
06-08-2001, 03:22 AM
Thanks tubedogg,
Have you figured out the parse error problem with who's online hack yet? You thought that it might be a php3 problem as well...
dd
annams
06-15-2001, 04:25 PM
By reading the description I am not sure whether this hack allows me to conduct a survey or not.
[list=1] A survey requires that I display several questions in a page, and below each question several possible answers are displayed. User clicks submit after selecting one of the possible answers for all questions. The hack should now propogate users answers to individual polls in vB.[/list=1]
Does this or any other hack for vB supports this? Or there any php/mysql based scripts that do this (even if they are not integrated with vB)?
-- Annam
surfdude
06-17-2001, 01:53 PM
tubedogg,
Many users of the vB seem to ask about poll radio buttons inclusion on their non vB pages with the ability to vote from there. This would be a great tool for all site administrators to pull visitors from their sites into their forums, stick and carrot stylie
But one thing seems to be missing - your reply to these. ;)
Is this deliberate?
tubescan.com still powered by vBulletin Version 2.0.0 Beta 3
Joshs
06-21-2001, 03:52 AM
Okay I need some help... I went to install this hack and found I had a problem.
On my server's "e" drive there is a sites directory. In there are all of my sites, two being my main site and forums. In the poll configuration for the $path variable to the forums/admin/config.php, it doesnt seem to like me entering e:/sites/forums/admin. I dont know what to do and would like to get this working for my new sites launch possibly tomorrow!
Thanks!!!
tubedogg
06-21-2001, 08:50 AM
Originally posted by surfdude
Many users of the vB seem to ask about poll radio buttons inclusion on their non vB pages with the ability to vote from there. This would be a great tool for all site administrators to pull visitors from their sites into their forums, stick and carrot stylie
But one thing seems to be missing - your reply to these. ;)
Is this deliberate?I thought I had answered this a ways up but this hack doesn't do that at this point and probably won't at least for a while. I really don't have the time to write it now.
tubescan.com still powered by vBulletin Version 2.0.0 Beta 3Your point?
tubedogg
06-21-2001, 08:51 AM
Josh: My experience with Windows servers could be fit into a 1x1 graphic. I have no idea about how stuff like that works and am not really sure what to tell you. Maybe someone else here with experience on Win servers could help him out?
Joshs
06-21-2001, 12:17 PM
Okay, thanks!
Dave#
06-28-2001, 03:08 PM
Kevin is there an easy way just to include a bulleted list of polls without links to the relevant forums or click here for more polls?
Sorry :)
Dave#
06-28-2001, 10:34 PM
I've managed to get this to just show the latest polls (no forum links) but it doesn't seem to be showing the latest polls
http://forums.cpfc.org/addons/poll.php
There are definately polls posted after that date and I have included the correct forum ID's :(
amsch
07-10-2001, 01:18 PM
I am getting this error..
Fatal error: Failed opening required 'home/sites/20ishparents.com/web/boards/admin/config.php' (include_path='.:/usr/local/lib/php') in
/home/sites/20ishparents.com/web/boards/poll1.php on line 11
which I am sure is a path error even though my path is correct. I guess what I am asking is what does this mean? (include_path='.:/usr/local/lib/php')
I apprecaite any help!
Amy
julius
08-22-2001, 04:41 PM
How can I put Title and keywords metatags in poll.php?
SirSteve
08-22-2001, 07:14 PM
I want to be able to have the poll question and voting options on the same page (non vB). When you submit a vote, it takes you to the results/thread page. Is this possible?
SirSteve
09-17-2001, 07:14 PM
I am looking for something SIMILAR to this.
I would like to pull the entire poll questions and choices on another page (nested, like on your home page somewhere) with the ability to cast your vote. After you cast your vote, it takes you to the vB page where that current poll is to view the results and talk about the poll.
montybug
10-12-2001, 09:34 PM
sirsteve
did you get anywhere on this? i'm also looking for a hack to let me put embedded VB polls on my homepage. i've currently got my own poll sw (non-VB, using perl and flat-files) running to do it but it's a pain to maintain and an integrate system would be so much cooler.
thanks
chris
SirSteve
10-12-2001, 11:54 PM
Sorta. The only thing I came up with was vbPortal (phpportals.com)
vbPortal sits on top of vBulletin.
montybug
10-13-2001, 02:55 AM
have you managed to isolate the code from vbportal to just implement the poll?
i'm about half way thru figuring out some rough mySQL code to hard code a VB poll. it's not going to be idiot proof so still would like to know if anyone else is working on something better.
thanks
chris
Dave#
06-17-2002, 09:09 PM
I'm sure I asked this before but would it be possible for someone to post the code that would select the last X polls from a list of forums and display them chronologically regardless of forum?
Thanks
Dave
SirSteve
05-13-2003, 01:39 AM
How can I get a link to the results page of a particular poll? I want my poll.php to display:
Poll title
Vote Now
View Results
Past Polls
I have everything working but View Results.
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.