1 (edited by chacmool 2004-01-11 09:19)

Topic: PunPoll v1.2.3

##
##        Mod title:  PunPoll
##
##      Mod version:  1.2.5
##   Works on PunBB:  1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4
##     Release date:  2004-02-26
##           Author:  David 'Chacmool' Djurbäck (chacmool@spray.se)
##
##      Description:  Adds poll-support to PunBB
##
##   Affected files:  admin_options.php
##                    admin_permissions.php
##                    admin_forums.php
##                    common_admin.php
##                    viewforum.php
##                    viewtopic.php
##                    post.php
##                    edit.php
##                    delete.php
##                    header.php
##
##       Affects DB:  New table:
##                       polls
##                    New options:
##                       o_polls
##                       o_poll_change
##                       o_poll_multi
##                       p_guests_poll
##
##            Notes:  You CAN use Mod_punpoll.html instead of this readme,
##                    it's the same process, with the difference that the
##                    html-file not's manually made. Please tell me what
##                    you think about it.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download PunPoll
(If PunRes is down, download from here instead.)

Changelog:

9 juni
· Users now have to press the checkbox to edit poll info.

18 maj
· Added code made by Paul Gregg that fixed PotgreSQL-
   support for PunPoll. Thanks a lot for the help!

26 feb
· Fixed changes between PunBB v1.1.1 and v1.1.2

3 jan
· Chenged the javascript that "opens" the poll-form
    in post.php. (BIG thanx to Elijah for the code!)
· Fixed a problem in admin_polls.php when there
   were no polls in the forum. (thanx Muggen!)
· Fixed a bug where the forum didn't work if the
   "User has posted earlier" options was enabled.
   (thanx Elijah!)

2 jan
· Rewrote some code to work with PunBB v1.1

26 dec
· Options for poll-changes and multipoll added.

11 dec
· Users can no longer change the question.

5 dec
· Added an poll-info-stats page (Admin pages).
· Fixed the quote-bug.

25 oct
· Fixed a bug where users not logged in could vote.

1 oct
· Added gust post poll permission to admin-permissions

28 sept
· Release: PunPoll v1.0

25 sept
· You can't vote when topic or forum is closed.
· Normal users can't edit the poll-type.

24 sept
· Added support for multivote-poll.
· Your'e able to delete the poll, not just hide it.
· Poll form is invisible until a checkbox is pressed.

23 sept
· Normal users can't change their polls.
. Guests can post polls if they're allowed to post topics.

21 sept
· Poll only visible on the first page.
· Polls are deleted when pruning or removing a forum.
· Poll On/Off option added to Admin->Options->Features
· Added poll-bar-images for the PunBB-styles.

20 sept
The work begins! Alot is done today.

Viewtopic:
   http://www.etek.chalmers.se/~e0mool/punbb/Poll_thumb.jpg

Post new topic:
   http://www.etek.chalmers.se/~e0mool/punbb/addpoll.jpg

Any suggestions or comments?

2

Re: PunPoll v1.2.3

Shibby!

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: PunPoll v1.2.3

Don't forget to upload it to PunBB Resource.... when it's released wink

Re: PunPoll v1.2.3

It IS released smile

I'm gonna fix all that when I'm home again (after all this x-mas-stuff smile)

Re: PunPoll v1.2.3

I meant when PunBB Resource is released wink

6

Re: PunPoll v1.2.3

Sorry for this post. But:

I've downloaded this script and look att the readme. Looks like you can use some kinda prog for it?

(How do I install mods?)

Re: PunPoll v1.2.3

Newb3 wrote:

Sorry for this post. But:

I've downloaded this script and look att the readme. Looks like you can use some kinda prog for it?

(How do I install mods?)

Sorry, but no. You'll have to make the changes by hand.

Re: PunPoll v1.2.3

I installed this mod using :

Mod title:  PunPoll
PunBB: 1.1
Mod version:  1.1.3

Here is a quick fix for the error encountered when visiting the Polls Admin Panel.

1. Open up admin_polls.php
2. On line 28, Find: require 'include/commonadmin.php';
3. Replace with: require 'include/common_admin.php';

Elijah wink

9 (edited by Elijah 2004-01-03 00:05)

Re: PunPoll v1.2.3

And another thing:

At: admin_options.php

If "User has posted earlier" is set to "yes" then the error:

An error was encountered
Error: Unable to fetch topic list for forum.

will be outputted when viewing a forum such as: viewforum.php?id=1

Is there any way to fix this?

For reference:

User has posted earlier
This feature displays a dot in front of topics in viewforum.php in case the currently logged in user has posted in that topic earlier. Disable if you are experiencing high server load.      Yes    No


Thanks for making such a cool mod!

Elijah

10 (edited by chacmool 2004-01-03 01:21)

Re: PunPoll v1.2.3

Elijah wrote:

I installed this mod using :

Mod title:  PunPoll
PunBB: 1.1
Mod version:  1.1.3

Here is a quick fix for the error encountered when visiting the Polls Admin Panel.

1. Open up admin_polls.php
2. On line 28, Find: require 'include/commonadmin.php';
3. Replace with: require 'include/common_admin.php';

Elijah wink

True, my mistake. I _REALLY_ should have tested the admin-poll-stuff before releasing the mod smile

Elijah wrote:

Is there any way to fix this?

I'm gonna fix it tomorrow sometime. Thanx alot for telling me, most people just take the fact that it's not working...

11 (edited by Elijah 2004-01-03 02:25)

Re: PunPoll v1.2.3

Currently Mod PunPoll does not work with the following browsers:
Mozilla 1.5
Netscape 7.1
Mozilla Firebird 0.7

This is because of a Javascript issue which keeps the pollform div hidden, even after the showpoll check box is checked.

Here is a way to fix this:

Open: header.php

Search for:

pollform.style.display = (box.checked == true) ? 'block' : 'none';

Replace with:

document.getElementById('pollform').style.display = (document.getElementsByName('showpoll')[0].checked == true) ? 'block' : 'none';

Now this great mod should work with all those browsers. wink

Elijah

Re: PunPoll v1.2.3

Woh! Thanx ALOT! big_smile

Really great!

13 (edited by chacmool 2004-01-03 11:00)

Re: PunPoll v1.2.3

Elijah wrote:

And another thing:

At: admin_options.php

If "User has posted earlier" is set to "yes" then the error:

An error was encountered
Error: Unable to fetch topic list for forum.

will be outputted when viewing a forum such as: viewforum.php?id=1

Is there any way to fix this?

For reference:

User has posted earlier
This feature displays a dot in front of topics in viewforum.php in case the currently logged in user has posted in that topic earlier. Disable if you are experiencing high server load.      Yes    No


Thanks for making such a cool mod!

Elijah

Fixed this now:
Find in viewforum.php:

$result = $db->query('SELECT DISTINCT p.poster_id AS has_posted, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, t.poll FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' WHERE t.id IN('.$threadids.') ORDER BY t.sticky DESC, t.last_post DESC') or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error());

Replace with:

$result = $db->query('SELECT DISTINCT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, t.poll FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' WHERE t.id IN('.$topic_ids.') ORDER BY t.sticky DESC, t.last_post DESC') or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error());

The variable $threadids was changed to $topic_ids, which I missed...

14

Re: PunPoll v1.2.3

Thanks! It works great now! smile

15

Re: PunPoll v1.2.3

http://vifta.missvogue.net/~fabian/punpoll.jpg

?

Re: PunPoll v1.2.3

Muggen:
Thanx! Fixed the problem. It occures beqause I don't check if there are any polls in the forum before dividing with the amount of polls.

Download this file and replace the admin_polls-file to fix the problem.

Thanx for telling me!

17 (edited by chacmool 2004-01-07 11:57)

Re: PunPoll v1.2.3

I've rewritten some parts of the code today. Made it much easier to install by lowering the number of steps from 64 to 44! smile Was alot of stuff which I could do in the same step... also put some code in files instead of copy-pasting it into PunBB-files.

I've not tested it enought yet though, so I've not uploaded it to PunRes yet. But if someone is interested in testing it, it's availible for download here. Please tell me if somethings wrong.

Edit: Updated the zip-file.

18 (edited by Muggen 2004-01-07 14:51)

Re: PunPoll v1.2.3

Where is the colour? ("The old code")

http://vifta.missvogue.net/~fabian/poll.JPG
http://vifta.missvogue.net/~fabian/poll2.jpg

Re: PunPoll v1.2.3

Muggen wrote:

Where is the colour? ("The old code")
http://vifta.missvogue.net/~fabian/poll.JPG

Hmm, what do you mean?

20 (edited by Muggen 2004-01-07 14:52)

Re: PunPoll v1.2.3

edited my last post.

When I change style.. yeah you know.

Re: PunPoll v1.2.3

Muggen wrote:

Let me edit the picture.

Ah, you mean how to change the color? There's one image for each style in img/poll.

22

Re: PunPoll v1.2.3

I've got the pictures, but it aint changing?

23

Re: PunPoll v1.2.3

Try making a new picture and replace it with the old one.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

24

Re: PunPoll v1.2.3

chacmool wrote:

Changelog:11 dec
· Users cannot longer change the question.

Don't you mean... "Users can no longer change the question."

Auron

25 (edited by chacmool 2004-01-07 19:47)

Re: PunPoll v1.2.3

Auron wrote:

Don't you mean... "Users can no longer change the question."
Auron

True! I'll change it!