Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
#137622 07/10/2001 11:05 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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)

Link: http://www.jordodesigns.com/UbbIntegratedPoll.zip
enjoy

[ July 15, 2001 02:57 PM: Message edited by: jordo ]

[ July 31, 2001: Message edited by: jordo ]

Sponsored Links
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
That is very kewl. I like alot of the features! Good Job!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
lookeeng good jordo! nice work as usual smile


- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 74
Member
Member
Offline
Joined: Mar 2001
Posts: 74
I think you forgot new Poll link

Joined: Mar 2001
Posts: 326
Member
Member
Offline
Joined: Mar 2001
Posts: 326
Jordo,

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?

Sponsored Links
Joined: May 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 13
The post new poll button is missing?

[ July 11, 2001 09:07 AM: Message edited by: Hyabusa ]

Joined: May 2001
Posts: 22
med Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 22
Hi jordo,

I would like to know what changes have to be made to switch from the Username to the Displayed Name in the COMMENTS section of the poll.

Thanks, and keep going, this is a geat asset!

Med

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I think you forgot the new post button as well???

I installed the hack and the code is not conflicting anything however there seems to be something missing?? New poll button.

No one can post a poll without that smile

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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.

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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.

Sponsored Links
Joined: May 2001
Posts: 22
med Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 22
Quote
quote:
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 ?

Thanks in advance,

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
med - in public_display_poll.pl (Template) find:

$this_comment[0]

and replace with :

$comm_poster

then in ubb_poll_lib.cgi after:
$link_name = $this_comment[0];

add:

$comm_poster = &GetPubName(&GetUserNumber($link_name));

that should make all names show up as public names.

Joined: Jun 2001
Posts: 5
A-C Offline
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 5
Hey nice script man,

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

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
A-C - make sure you uploaded public_new_poll_form.pl to the Templates directory in ascii.

Joined: Jun 2001
Posts: 5
A-C Offline
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 5
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.

Joined: Jun 2001
Posts: 70
Member
Member
Offline
Joined: Jun 2001
Posts: 70
Hello jordo

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."

Otherwise..great hack [Linked Image] laugh

[ July 12, 2001 02:26 AM: Message edited by: gaulalauk ]

Joined: Feb 2001
Posts: 110
Member
Member
Offline
Joined: Feb 2001
Posts: 110
i was wondering if there was ever a post made about this hack! and i finally found it! VERY NICE! laugh

Joined: May 2001
Posts: 1
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 1
If I enable all users to post a poll, it disables it. Not even admins/mods can post a poll.

Joined: Jun 2001
Posts: 70
Member
Member
Offline
Joined: Jun 2001
Posts: 70
Quote
quote:
Same problem here [Linked Image]

[ July 12, 2001 05:46 AM: Message edited by: gaulalauk ]

Joined: Feb 2001
Posts: 110
Member
Member
Offline
Joined: Feb 2001
Posts: 110
is there an SSI feature for the poll?? would be nice to have one.. smile

Joined: Jun 2001
Posts: 5
A-C Offline
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 5
Is it normal that it's crashing everytime someone enteres a ' ?

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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?

Joined: Jun 2001
Posts: 5
A-C Offline
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 5
Yea in the comment heh smile

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
k, its fixed A-C, just reupload the ubb_poll_lib.cgi. sorry i thought i had added a check but i guess i hadnt. smirk

Joined: Jun 2001
Posts: 5
A-C Offline
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 5
Ok thanx man, i'll try!

Joined: Jun 2001
Posts: 70
Member
Member
Offline
Joined: Jun 2001
Posts: 70
jordo

dont stress it, take your time man laugh

Joined: Jul 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 6
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.

Oh ya, nice job, I like Jordodesigns wink

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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.

Joined: Jul 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 6
Thanks a lot Jordo, Jordo Designs rock!

Joined: Feb 2001
Posts: 251
Member
Member
Offline
Joined: Feb 2001
Posts: 251
OK The poll worked, like 5 people voted and now I get this error when I want to view the poll:
Code
code:

Joined: Jul 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 6
Jordo, I am still having problems...

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:

);
$submit_target = "submit_new_poll";
} else {
$submit_target = "submit_new_topic";
}


and yet it still won't work, can you help me out?

Joined: Jul 2001
Posts: 109
Member
Member
Offline
Joined: Jul 2001
Posts: 109
jordo

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. laugh

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 laugh

[ July 13, 2001 11:25 AM: Message edited by: kaukagaul ]

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
madcow - before this line:
if (($vars_display{UbbPoll} ne 'None') && ($show_poll eq 'yes')) {

add this:

if ($vars_display{UbbPoll eq 'All') { $show_poll = 'yes'; }

the instructions have been updated with that, im not sure why its not showing up in there for you. smirk

maurice - if you could pm me with the full contents of that file, ill see whats going wrong.

kaukagaul - ill take a look at the preview hack and see where the conflict is.

Joined: Jul 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 6
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:

);
$submit_target = "submit_new_poll";
} else {
$submit_target = "submit_new_topic";
}

Line 130: } # end new_topic_page


Ultimatebb.cgi; Line 414: require "$vars_config{CGIPath}/ubb_new_topic.cgi";


Thanks a lot Jordo, I really appreciate this effort you are putting forth, it is helping my clan greatly.

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
ack, bad typing on my part. this:

if ($vars_display{UbbPoll eq 'All') { $show_poll = 'yes'; }

should be this :

if ($vars_display{UbbPoll} eq 'All') { $show_poll = 'yes'; }


i missed a } smirk

Joined: Jul 2001
Posts: 109
Member
Member
Offline
Joined: Jul 2001
Posts: 109
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.

Hope you understand what I mean laugh

[ July 13, 2001 11:20 PM: Message edited by: kaukagaul ]

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
instructions updated with a fix for the previous/next topic buttons. rehack ubb_get_topic.cgi.

Joined: Jul 2001
Posts: 109
Member
Member
Offline
Joined: Jul 2001
Posts: 109
Bugreport:

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.

laugh

*********
I found the next topic button to work ok, ofcourse if you create a new topic after the polltopic laugh

But it will not show the previous topics created before the polltopic.
Then is says "No furter topics in this direction".

[ July 14, 2001 07:50 PM: Message edited by: kaukagaul ]

Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
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...

maybe another hack causing these?

Joined: Jul 2001
Posts: 109
Member
Member
Offline
Joined: Jul 2001
Posts: 109
hmm..strange, course if I post a topic without a poll, it goes to the top as usual.
[Linked Image]

Page 1 of 5 1 2 3 4 5

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)