see my post on page 9 for instructions on updating this hack from version 1.7 to 1.8
Ok, this is a script i was working on a while ago, but put in the freezer for a bit. what it does is allow users to post polls in their threads that are displayed above the post (like on vB) rather than in the post like the other integrated polls hack. before you ask "where is the new poll button?" click here . Features:
CP control over who can post polls
Comments on polls, as well as viewing of results before voting
closeing of polls
known bugs:
Not wordletized at all yet (there are templates though)
user permissions a little finicky in conjunction with calendar user permissions
ToDo:
cleanup of code
wordlets
timed polls (ie: run for a week then automatically close)
Is this the same v1.5 after you fixed that bug with the " ' " stopping polls from working just recently? Or have there been some other changes since then?
There is not supposed to be a post new poll button. Once you install it go to your control panel and choose "General Display Options", near the bottom you can select who can post polls. When you click the new topic button, if you can post a poll (if the who can post option is set to all members, then all members see this), you will see at the bottom of the new topic form, a checkbox that has "Post Poll?" next to it, and an input box for number of options you want your poll to have. Check the box and put in some number (like 3 or something) for the number of options, then fill in the rest of your post (topic, message, etc) as normal. when you click Add New Topic, it will take you to a page that lets you set up your poll with the number of options you selected. Then when you submit that page, your post will be made and your poll created.
mark99 - the only addition has been changing of the poll options, you can now set it so that you can give only selected users permission to post polls (the same as you give them permission to access private forums), or have only admins/mods allowed to post polls, or have all members allowed, or have nobody allowed (effectivly turning them off).
med - ill work on a better cp interface next, and ill include an option in there to have login or public names displayed on comments.
Ok, that would be appreciated, specially that every where it's the public names that are so called...public.
What are the changes to be made if i want to do this manually. Our customer want that change to be made quickly. Should i maybe unistall the MOD and wait ? Or the change is straight forward ?
I have added all files and did the modifications as well as the chmod for the files but when i check the add poll check box and enter the number of poll options and click add new topic it goes to a blank page and nothing happens after that, just a blank page, i wonder what can cause that.. if i check my server log error its a Premature end of script headers in ultimatebb.cgi
Hey thanx for the quick reply man, i found out i only copied one of the 3 template files lol i was reading the instructions and didn't give attention to the dir duh!. Thanx again nice job later.
I have installed your latest version today. I think there must be a bug.
I made a poll question containing this characters; ejt aiu fadk i "¤#¤&%&!!????***''¨ø'´´~~~||
The poll got accepted, but later when I triad to open the message containing this poll, I got the following error message:
Content-type: text/html Software error: Unrecognized character xB4 at /home/ubbtest/www/cleanubb/ubb/Forum1/000003.poll line 2.
Software error: [Thu Jul 12 02:50:49 2001] ultimatebb.cgi: Unrecognized character xB4 at /home/ubbtest/www/cleanubb/ubb/Forum1/000003.poll line 2. Compilation failed in require.
Also, when someone open the message, and want to view the poll result before they vote themself, in the resultpage there is no link back to the message. Maybe there should be a link called "Vote" or "Take me back to vote" or something?
Another one is, when you view the comments, and click on the namelink of the author of the comment, you dont get to the authors profile or something. All I get is the error message saying - "You are attempting to reach a page that does not exist."
sorry i missed adding a part to the instructions. to fix nobody being able to post polls when "All users allowed" is selected, delete and readd the large section from the instructions for ubb_new_topic.cgi.
there is no ssi.
gaulalauk - thanks ill get those bugs fixed today if possible.
A-C - do you mean when they enter an apostrophe in their comment?
Hey Jordo, could you tell me the instructions so that, if all users are allowed, polls can be posted. What do you mean delete and read?
Also, I keep on getting double software errors. When I make a poll, i view it and it is ok, then an hour later, I try to view the topic and there are two software errors.
the 2 software errors are most likely from someone putting a ' in their comments. to fix that download the zipfile again and upload ubb_poll_lib.cgi overwriting the old one.
what i mean by delete and readd, is go through the old directions for what you added to that file, and delete the larger section that you had added to the file (ubb_new_topic.cgi). then look at the new instructions and re-add the large section from those new, updated, instructions.
The add poll still won't won't appear on the add topic.
The new and old code are exactly the same, even the modified date. This is what I did...
###########find:
# show signature? if (($vars_display{AllowSignature} eq 'YES') && ($username ne '')) { $show_sig = qq( $vars_wordlets{show_signature}); }
########### add this before:
# show poll? if ($vars_display{UbbPoll} eq 'Admin') { # user must be an admin or mod #verify cookie id @user_profile = &verify_id_num($username, $password, $user_number);
# make sure user is an admin or moderator of this forum my $is_one = &is_admin_or_mod($in{f}, @user_profile);
if ($is_one ne "true") { $show_poll = 'no'; } else { $show_poll = 'yes'; } }
if ($vars_display{UbbPoll} eq 'individ_user_level') { # user must be an admin or mod #verify cookie id @user_profile = &verify_id_num($username, $password, $user_number);
# make sure user is an admin or moderator of this forum my $is_one = &is_admin_or_mod($in{f}, @user_profile);
# get user perms ($j, $perms) = split(/&/, $user_profile[4]); if ($perms =~ /p/) { $is_one = "true"; }
if ($is_one ne "true") { $show_poll = 'no'; } else { $show_poll = 'yes'; }
} if (($vars_display{UbbPoll} ne 'None') && ($show_poll eq 'yes')) { $show_poll_add = qq(  Poll: Check to Create a Poll With Topic     Number of Poll Options:
There is some problem if one has the Preview hack installed. When filling in the subject, the body, then put a mark for creating a poll, and put the number of poll options, and THEN push the PRIVIEW button, you then will be sendt to the site where you define your poll questions and options. When hitting submit you are sendt back to the preview message window and can preview your message. If you then hit "Add New Topic", all you get is your topic and the message body. The poll isnt there anymore.
To avoid this, people have to make their subject, fill in the message body, and then make a preview of it. AFTER THAT they can make the poll, but I dont think this will be understandable for the ordinary user.
Any idea what to do?
BTW, "Allow anyone to post a poll" now seems to work well.
And making only admins and mods able to edit the poll was a good thing I think. Actually a poll should not be edited at all, but its good for admin and mods to be able to do it, if some sick person like me try to post a poll containing some bad words, or making a poll about some animated brain
Sorry Jordo, now when I even click on Add new Topic, I get this error:
syntax error at /d02/sec/s17/a0004xsu/cgi-bin/ubb_new_topic.cgi line 98, near "'All') " syntax error at /d02/sec/s17/a0004xsu/cgi-bin/ubb_new_topic.cgi line 130, near "}" Compilation failed in require at ultimatebb.cgi line 414.
Line 71 to 101 ubb_new_topic.cgi: # show poll? if ($vars_display{UbbPoll} eq 'Admin') { # user must be an admin or mod #verify cookie id @user_profile = &verify_id_num($username, $password, $user_number);
# make sure user is an admin or moderator of this forum my $is_one = &is_admin_or_mod($in{f}, @user_profile);
if ($is_one ne "true") { $show_poll = 'no'; } else { $show_poll = 'yes'; } }
if ($vars_display{UbbPoll} eq 'individ_user_level') { # user must be an admin or mod #verify cookie id @user_profile = &verify_id_num($username, $password, $user_number);
# make sure user is an admin or moderator of this forum my $is_one = &is_admin_or_mod($in{f}, @user_profile);
# get user perms ($j, $perms) = split(/&/, $user_profile[4]); if ($perms =~ /p/) { $is_one = "true"; }
if ($is_one ne "true") { $show_poll = 'no'; } else { $show_poll = 'yes'; }
} if ($vars_display{UbbPoll eq 'All') { $show_poll = 'yes'; } if (($vars_display{UbbPoll} ne 'None') && ($show_poll eq 'yes')) { $show_poll_add = qq(  Poll: Check to Create a Poll With Topic     Number of Poll Options:
jordo another bug, not a problem, but thought I should tell you.
Lets say we are in Forum 1. Create topic A without a poll then Create topic B with a poll (poll B)
View poll B, vote in poll B, view poll B...THEN..if you want to view the previous topic(topic A), and push the arrow image(next oldest topic), you get back to the next oldest topic(topic A), thats ok. BUT poll B from the former topic B(the one you just view before puching the arrow to next oldest topic) comes a long. So now you are viewing topic A with poll B on top of it, as if it was a poll that belonged to topic A.
I only rehacked ubb_get_topic.cgi as you suggested.
When making a topic with a poll, the topic dont place itself on the top of the topiclist, but in the bottom.(Usually a new topic is automaticly topped)
When viewing the poll, and hitting the next/previous button to view other topics I get the error message saying "No furter topics in this direction" or something like that, even if there are other topics to view.
********* I found the next topic button to work ok, ofcourse if you create a new topic after the polltopic
But it will not show the previous topics created before the polltopic. Then is says "No furter topics in this direction".
kaukagaul - the poll being at the bottom of the thread list cant have anything to do with this hack. i cant seem to replicate the problem with the previous topic button though - works fine on my test board, and again it couldnt be this hack causing that as i didnt touch the routines that handle that...
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.