PDA

View Full Version : [preview] Poll hack


07-06-2000, 08:22 PM
Ok, you can peview the poll hack here:
http://www.naboonline.com/polltest/index.php

posting a reply causes the poll post.

the curreny big bug is that the redirection after vote/post is not working, you have to press back and reload to see the differences.

verify email is turned off.

07-06-2000, 10:09 PM
I just tested it - except for the blank screen after you vote, it looks pretty good!

07-07-2000, 07:40 AM
Hello,

It looks great so far! I can't wait for a final release.

Now all we need is someone to work on the ratings for a thread. :)

07-07-2000, 05:01 PM
Am I the only one who cannot view a poll?? No matter what thread I view I get "Invalid username. Please press the back button, enter the correct password and try again. To register, click here! ". I did register and am logged in (it even shows my name on the currently active users). It even let me post a new poll.

07-07-2000, 05:03 PM
If you set your profile to NOT save your info "in browser memory" you cannot view any polls. I changed it to yes and everything works now.

07-07-2000, 05:29 PM
i noticed a few polls were submitted that crashed due to using ', this was fixed thanks to Mas*Mind

07-07-2000, 05:43 PM
I voted no problem, but the refresh had a:

Parse error: parse error in /home/naboonl/public_html/polltest/poll.php on line 415

07-07-2000, 06:51 PM
yeah, small php code error on my part, had a } too much, is fixed now.

07-07-2000, 09:23 PM
Ouh man, this is so great! but i could not find a download link. Please tell me where to get this hack from!!!!

07-07-2000, 10:42 PM
Great Doron! My wish list:


Email notification (if turned on) when someone places a vote
Possible pie/bar chart to represent voting %'s
In forumdisplay, have it say 'POLL' or such beside the thread title
Usergroup option 'Allowed to Create Polls'
Voting History - An admin/Moderator only option


All I can think of for now

07-08-2000, 01:24 AM
doron,
I think your poll hack looks great. The implementation of mine is going to be a fair bit different, so I think I am still going to finish mine. I am leaving for a 7 day vacation in a few hours (Vegas :)) so I probably won't work on it much in the next week, but I plan on finishing it the week I get back. If anyone has any comments/questions about my poll hack feel free to email me - I will be checking my mail.

07-08-2000, 01:43 AM
I definitely like it:)

it seems it would be easy to add a 3rd button that functioned as a "start poll" button:)

07-08-2000, 02:03 AM
I am thinking it might be best to make a "poll" forum for just polls and nothing else.

And if this is done we can make another template for just polls etc no need to put all the icons on it etc. Lemme play with some designs and see if I can make anything nice :)

What do you think about this?

07-08-2000, 02:39 AM
Maybe something like:
http://www.elitepub.com/votescreen.gif

07-08-2000, 03:39 AM
I prefer the idea of being able to start a poll in any forum but that's just me...

07-08-2000, 03:47 AM
Ya I think that would be nice, im just thinking how cluttered it can get because I know a lot of people will be doing them on my sites. Thus if I limited it to one forum I can use its own template and keep things cleaner...

07-08-2000, 03:50 AM
I think it needs to be made for any forum and then you can hack it for just one forum *OR* maybe Doron could add a permission to forum permissions such as 'allow polls to be posted'.

07-08-2000, 03:57 AM
Ya I think if its made for all forums you just wont add that part to the newthread template if you dont want it in all forums, and then if you want to make it for just one forum make a new template for that forum with it in their. That will be the easiest and require no code changes just a template change..

07-08-2000, 04:15 AM
about the only thing I see wrong is that you can't preview a poll.

other than that everything on the surface seems to be about perfect :)

07-08-2000, 05:02 AM
Yes i'm dieing to get this hack install Doron - hurry up! :) :) :)

07-08-2000, 07:22 AM
I must say, this is looking really good :)

07-08-2000, 10:37 AM
This looks unbelieveably excellent. It has all the features I need. When is it ready for download - I WANT IT NOW! ;)

Except I think that it should only be called from a 'post poll' icon in the forums. It would be confusing for users to be presented with the poll options when starting a thread if they don't want to post a poll.

Also, I don't know how 'doable' this is but I would like to restrict the ability to post polls to users which have posted a certain number of posts (e.g. are not Junior Members).

PS Menno you want to make a New Poll icon in the same style as the new thread one?


[Edited by Mark Hewitt on 07-08-2000 at 07:38 AM]

07-08-2000, 10:40 AM
PS. (again) you should be able to see the results if you wish without having to vote in the poll.

Also votes in the poll should be treated as replies. i.e. the message should move to the top of the list. Otherwise you could have a very popular poll which isn't replied to and it would drift off the bottom of the threads list.

[Edited by Mark Hewitt on 07-08-2000 at 08:11 AM]

07-08-2000, 12:20 PM
Add Mark's suggestions to my wish list, they are all needed.

07-08-2000, 05:07 PM
where to start...

first, you can't download it yet cause it is still missing some stuff, most importantly the delete feature.

>>Email notification (if turned on) when someone places a vote

I'll look into that, probably copy/paste

>>Possible pie/bar chart to represent voting %'s
I've seen that before on php polls, I downloaded a couple of php polls to see how they do it.

>>In forumdisplay, have it say 'POLL' or such beside the thread title

Do you want it hardcoded? Ie the user can not remove it?

>>Usergroup option 'Allowed to Create Polls'

Definately, still working on how to do so. Would it be better to modify this via the usergroup section or just have a multicombobox where you select who is allowed?

>>Voting History - An admin/Moderator only option

The test board has that, but public.

>>Graphics - hopefully menno can do that ;)

Preview - that's has not been started yet, will do it today probably.

Replies - that is going to be tricky. I could update the last post date everytime there is a vote.

thanks for the input!

07-08-2000, 05:15 PM
I did notice that you're setting this up on 1.1.2

do you foresee any compatibility problems with 1.1.3?

07-08-2000, 07:11 PM
I doubt it, but when I have it done, I will install it on 1.1.2 and 3. I doubt though, as 1.1.3 has primarily bug fixes, not changes in architecture

07-08-2000, 08:55 PM
Ok, I got the preview mode and the usergroups working.

to test the usergroups, login as UserNoPoll with password "password". the usergroup he belongs to is not allowed to post polls.

Mind you, the hack has gotten pretty complex.

11 new templates (most are just dupes of existing ones, with "post" changed to "poll")

1 new file (poll.php)

4 files need modification (editpost.php, options.php, showthread.php and usergoup.php)

2 New tables (poll and pollvote)

2 tables need to get an additional column

scared yet? I might provide the 4 files needing modification in various versions (1.1.2, 1.1.3, together with private msg hack) to simplify the hack.

07-09-2000, 09:13 AM
scared yet? I might provide the 4 files needing modification in various versions (1.1.2, 1.1.3, together with private msg hack) to simplify the hack.


Make sure you also include the details as to how to apply the hack rather than just the basic files because I for one have other hacks applied to these.

07-09-2000, 11:39 AM
wow doron... thought the name sounded familiar... it's George from http://theprequels.net :D

cool hack... and as Mark said make sure you add a little install guide for us php illerate folks - me :D

07-09-2000, 01:09 PM
definately, there will be a "how to install" txt file, most files need to be given an additional 5 lines or so, so it ain't hard.

George - yo!

ps: just added some more error checks (ie need to options for a poll)

07-09-2000, 01:26 PM
hi again :)

great to hear... what happens to poll hack when installed and an upgraded version of vbulletin is available ?

does this hack add to the mysql database ?

07-09-2000, 03:11 PM
Hopefully John will include it in the forum.

07-09-2000, 10:47 PM
Originally posted by Martin
I prefer the idea of being able to start a poll in any forum but that's just me...

I agree 110%. I don't want a "polls" forum. I'd rather let my visitors create polls within the topics of the existing forums.

07-09-2000, 11:55 PM
Again, it was an idea :)

07-10-2000, 08:45 AM
I too agree with MArtin and Me2Be :D

it's much more 'interactive' when polls can be put in any forum.

07-11-2000, 12:19 PM
Come on then get it done. I am a very impatient person!

07-11-2000, 06:34 PM
patience is a virtue ;)

I finished off the polledit feature today, and there ain't to much left:

- Close a poll (admin/mod/author)
- closing a thread == close a poll?
- vB code parse in poll options
- email notification for a new vote
- increase post date each time for vote????

07-12-2000, 07:43 AM
- closing a thread == close a poll? Yes, and only display results.
- increase post date each time for vote???? certainly yes.

07-12-2000, 08:14 AM
does everyone agree with a vote causing the last update date being changed? I might toggle this in the cp.

07-12-2000, 08:58 AM
yes toggle it as an option on/off if you can :D

07-12-2000, 07:57 PM
Ok, the polltest board is now running version 0.8 of the poll hack, which is nearly complete.

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 (text on form buttons)
- Fully templateable - you can customise the look of the poll
- Vote History - shows who voted when
- Users who can not post can not vote as well
- Make sure person did not vote, press back, and vote again
- Uses user defined timeoffsets
- 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

ToDo:
- Close poll from Edit page
- email notification when there was a vote

OK, now to the questions:
1. Vote History - you think it is usefull or not? I need to template it and was wondering if it was worth the ffort

2. Update last post when there has been a reply - should I update the "last post" field only of the thread and keep the name of the person who last replied, or change the lastposter to the person who voted? this could cause some confusion...

07-12-2000, 08:07 PM
Originally posted by doron

2. Update last post when there has been a reply - should I update the "last post" field only of the thread and keep the name of the person who last replied, or change the lastposter to the person who voted? this could cause some confusion...

I vote for the last reply.

07-12-2000, 08:08 PM
Originally posted by doron
1. Vote History - you think it is usefull or not? I need to template it and was wondering if it was worth the effort

What would the vote history represent - all closed polls? If so, I think it would be very beneficial.

2. Update last post when there has been a reply - should I update the "last post" field only of the thread and keep the name of the person who last replied, or change the lastposter to the person who voted? this could cause some confusion...

Last Reply - it might confuse the visitors since everything else is last reply

My two cents! ;)
(Can't wait to play with this feature!)

07-12-2000, 08:17 PM
Also I think a link (from fivelinks, or elsewhere) that lists all threads that are polls would be very nice!

07-12-2000, 08:41 PM
Hey Doron

Great script. BTW I don't mean to be a bother but I wanted to tell you that there is a script division by zero error when you select view on a poll that has no votes. I'm sure it's an easy fix :) If anything it's not that important nor would many people be idiotic enough to click on results with no votes (except bug testers) so don't worry about it!

[Edited by SonnetCelestial on 07-12-2000 at 05:43 PM]

07-13-2000, 07:35 AM
vote history shows who voted when for each poll.

division by error - damn, I was sure I was catching that, lemme fix that. (thanks!)

rangersfan - should be easy, I thought of adding a |x posts with y polls to the main template

07-13-2000, 07:45 AM
OK, now to the questions:
1. Vote History - you think it is usefull or not? I need to template it and was wondering if it was worth the ffort


I woudldn't want the users to be able to access it. But just maybe put it and I get take it out in the templates, so only I (and a knowledgeable few) know the address.


2. Update last post when there has been a reply - should I update the "last post" field only of the thread and keep the name of the person who last replied, or change the lastposter to the person who voted? this could cause some confusion...

Yes it is confusing but causes me to worry that if you have a poll which is attracting a lot of people to vote but nobody is actually posting any replies on a busy forum the poll will dissapear off the thread list very very quickly. You have to have some way to "top" the poll thread.

07-13-2000, 09:31 AM
Is it just the way your forums have been set up but I would need non-logged in / unregistered users to be able to view the poll (if not vote in it)

07-13-2000, 10:15 AM
Yes it is confusing but causes me to worry that if you have a poll which is attracting a lot of people to vote but nobody is actually posting any replies on a busy forum the poll will dissapear off the thread list very very quickly. You have to have some way to "top" the poll thread.

same here, maybe something like the announcement thread which stays at the top ?

07-13-2000, 12:36 PM
Originally posted by Mark Hewitt
Is it just the way your forums have been set up but I would need non-logged in / unregistered users to be able to view the poll (if not vote in it)

mark, good catch! I had a verifyusername() where I should not have had one. Should be working now, I added it to the voting process and not the showing of a poll one.

the votehistory will not be in the initial version.

07-13-2000, 01:10 PM
btw, do note that the script is in development, and the test board will often have sql errors as I can't test the code offline

07-14-2000, 08:06 AM
I thought I would post what I want to see a poll hack do on my site, basically the closer the release version is to this the less I will have to hack it myself to make it work :).

Polls should be posted seperately from normal threads i.e. there should be a 'New Poll' button which is seperate from the new thread button.

When someone posts a poll they should not be allowed to select any message icons, instead the poll will be posted with a special icon which is only used for polls - this will help to differentiate it from normal threads and eliminate the need for a POLL: prefix.

Would probably want to use this icon https://vborg.vbsupport.ru/.
Also message icons are meant to convey emotion, the original posting of a poll *should be* impartial.

Once the poll is posted then the last post time of the thread should be updated to the last time someone voted, however the last post by field should be left to the original poster or to the last reply, (may be confusing but hey it's my board I can cause as much confusion as I want :)).

Posting rights, to avoid every newbie coming in and posting the same poll over and over I need to restrict the ability to poll. In my case I would want it restricted to Senior Members only (100 posts or more), Admin and Moderators would have no such restrictions.

Thats all for now ;)

07-14-2000, 08:50 AM
Polls should be posted seperately from normal threads i.e. there should be a 'New Poll' button which is seperate from the new thread button.

100%!! I just have it different on my test board cause I was lazy to create a image. A new poll is generated by poll.php and not newthread.php

When someone posts a poll they should not be allowed to select any message icons, instead the poll will be posted with a special icon which is only used for polls - this will help to differentiate it from normal threads and eliminate the need for a POLL: prefix.

Good idea, I'll do that, I'll try to create a poll icon (or perhaps meanno?)


Once the poll is posted then the last post time of the thread should be updated to the last time someone voted, however the last post by field should be left to the original poster or to the last reply, (may be confusing but hey it's my board I can cause as much confusion as I want :)).

this will be in the hack, and will be togable in the cp

Posting rights, to avoid every newbie coming in and posting the same poll over and over I need to restrict the ability to poll. In my case I would want it restricted to Senior Members only (100 posts or more), Admin and Moderators would have no such restrictions.

every usergroup gets a "canpostpoll" field, which you can set as you heart contents. ;) Try logging in to the test forum with UserNoPoll and password "password". that user can not post polls.

07-14-2000, 10:17 AM
Good idea, I'll do that, I'll try to create a poll icon (or perhaps meanno?)

Wonderful. Whats wrong with http://www.worldmotorsport.com/vote.gif?

every usergroup gets a "canpostpoll" field, which you can set as you heart contents. ;)

Ah but what about on the number of posts a user with 99 posts and a user with 100 posts are in the same usergroup but I would not want the first one to be able to post a poll.

07-14-2000, 02:08 PM
Doron : Perhaps a "Minimum # of posts before one is allowed to Post a Poll" option is in order?

(I hate bringing more changes up cause we want this now!)

07-14-2000, 02:24 PM
mark - ok, your icon will be the defualt. need royalty pay? ;)

the minimum number of posts could be a extra, no problem there, just another if and another variable out of the db.

today, I'll get that and the icon and the update of last reply done, the email notif. will be pushed to a later release.

hopefully this sunday I will have it packaged for releas,e need to get a installer script written too...

07-14-2000, 02:41 PM
mark - ok, your icon will be the defualt. need royalty pay? ;)


Great. No need for royalty pay as I stole it from Craig Antill's site in the first place :D

07-14-2000, 02:55 PM
heh

btw, should the last post in the index.php refelct the last date time or jsut the last reply time

i added the code for the date change on vote, but it does not update the forum last reply.

07-14-2000, 02:58 PM
My personal opinion is that a vote should not update the index.php list.

07-14-2000, 05:48 PM
ok, the last 2 features are implemented - special icon for polls and vote causes last post date to increase. Also fixed the usergroup limitation. Also implemented is the "minimum posts for pollpost" feature.

i'll write the installer next and test it on 1.1.2 and 1.1.3 over the weekend and hopefully release on sunday/monday

[Edited by doron on 07-14-2000 at 02:51 PM]

07-14-2000, 06:44 PM
yay ...can't wait :D

07-14-2000, 07:38 PM
I can't wait to try this out!!!!!!!!!!!