PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2005-07-13 12:17:15

Mediator
Member
Registered: 2005-03-19
Posts: 56

Easy Poll 1.1.3

Code:

##
##
##        Mod title:  Easy Poll 
##
##      Mod version:  1.1.3 
##   Works on PunBB:  1.2.3, 1.2.4, 1.2.5, 1.2.6 
##     Release date:  07-13-05 
##           Author:  Caleb Champlin (Mediator) [med_mediator@hotmail.com] 
##
##      Description:  Adds polls to PunBB 
##
##       Affects DB:  Yes 
##
##   Affected files:  viewforum.php 
##                    footer.php 
##                    search.php 
##
##            Notes:      If you ever plan on using global announcements install that first   
##
##     Generated By:  Auto Read-Me(by Caleb Champlin) - http://www.rscheatnet.com/Auto_Readme.zip
##
##       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 here

Offline

 

#2 2005-07-13 12:18:15

Mediator
Member
Registered: 2005-03-19
Posts: 56

Re: Easy Poll 1.1.3

Change Log

Code:

Fixed:
Multiselect yes/no polls would severly error when there were no votes
You were able to enter a space for an option and it would still find it semi valid
Problem with quotes - reported by wrwo 
Fixed a problem with the tab indexes of certain pages - reported by wrwo
Fixed a problem in the upgrade readme with some double coding - reported by Bulgaricus

Changed:


Added:
Nothing New

Adding:
Ability to prevent certain user groupgs from creating new polls - requested by Connorhd (POSTPONED)

Offline

 

#3 2005-07-22 00:28:55

Mohit
New member
From: INDIA
Registered: 2005-07-21
Posts: 5
Website

Re: Easy Poll 1.1.3

Thnx

Offline

 

#4 2005-08-04 00:27:57

Bulgaricus
Member
From: Warsaw, Poland
Registered: 2005-05-12
Posts: 44
Website

Re: Easy Poll 1.1.3

Where can I change the length of the columns displaying graphically the results of voting? I want to make columns showing 0 votes almost unvisible. Now they are almost the same length as small number of votes. Look here: http://bulgaricus.com/forum/viewpoll.php?id=2815

The picture is not clear, 0 votes is almost the same as 1 or 2 votes. It should not be a difficult change, but I can not find the place in the code where it appears. I do not know PHP sad

Thank you in advance!


www.bulgaricus.com
All about Bulgaria in Polish

Offline

 

#5 2005-08-12 05:49:10

Bulgaricus
Member
From: Warsaw, Poland
Registered: 2005-05-12
Posts: 44
Website

Re: Easy Poll 1.1.3

Help me, please! It should not be so difficult...


www.bulgaricus.com
All about Bulgaria in Polish

Offline

 

#6 2005-08-12 11:37:03

Zoltor
Member
From: Minsk, Belarus
Registered: 2005-04-10
Posts: 19
Website

Re: Easy Poll 1.1.3

This is wonderfull mod... but there is one problem.. if topic is poll, on main page of PunBB board link to last post is "viewtopic.php?blablabla". Is there way to change it to viewpoll.php?blablabla if topic is poll?


Sorry for my english! roll

Offline

 

#7 2005-08-20 16:10:41

Arvid
New member
Registered: 2005-08-12
Posts: 9

Re: Easy Poll 1.1.3

I see in Bulgaricus' forum when making a poll only the title of the thread shows in the list of threads. In my forum both the title of the thread and the question asked in the poll shows... How can i get only the thread title to show?

Offline

 

#8 2005-08-21 02:01:12

Jacq
New member
Registered: 2005-08-21
Posts: 2

Re: Easy Poll 1.1.3

There is couple of bugs left:
-In readme.txt (installation instructions) it doesn't say you should upload moderatepoll.php while you should upload it.
-In lang/English/poll.php line 15 there is a typo: 'Mutliselect poll' should read Multiselect poll obviously.

Thanks for this mod!

Offline

 

#9 2005-08-21 02:05:21

Jacq
New member
Registered: 2005-08-21
Posts: 2

Re: Easy Poll 1.1.3

Oh and in the instructions uploading the plugins/AP_polls.php is missing too.

Offline

 

#10 2005-08-21 04:08:03

Bulgaricus
Member
From: Warsaw, Poland
Registered: 2005-05-12
Posts: 44
Website

Re: Easy Poll 1.1.3

Arvid wrote:

I see in Bulgaricus' forum when making a poll only the title of the thread shows in the list of threads. In my forum both the title of the thread and the question asked in the poll shows... How can i get only the thread title to show?

As far as I remember I edited the vewforum.php file (after changing it according to mod's readme). I searched for places where viewpoll.php occurs and changed this:

Code:

$subject = $lang_polls['Poll'].': <a href="viewpoll.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['question']).'</a><br /> <span class="byuser"><b>'.pun_htmlspecialchars($cur_topic['subject']).'</b> '.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';

to this:

Code:

$subject = $lang_polls['Poll'].': <a href="viewpoll.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> '.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';

www.bulgaricus.com
All about Bulgaria in Polish

Offline

 

#11 2005-09-17 23:27:31

Omnisilver
New member
Registered: 2005-09-17
Posts: 3

Re: Easy Poll 1.1.3

The french translation has been done here wink

Thanks for this mod !

Offline

 

#12 2005-10-03 03:21:15

Webber
Guest

Re: Easy Poll 1.1.3

Hi mediator
I've found a bug in the mod. When you, with a shortcut-link from the main-index, enter a thread with a poll, you can't see the poll. But when you're a enterr the thread from the sub-forum you can see the forum...

HELP ME!!!

sorry about my english...

Last edited by Webber (2005-10-03 03:22:09)

 

#13 2005-10-04 20:56:23

terje
New member
Registered: 2005-10-04
Posts: 8

Re: Easy Poll 1.1.3

1.2.8 version supported? I really would like to try this.

thanks ;-)

Offline

 

#14 2005-10-04 21:11:53

Mediator
Member
Registered: 2005-03-19
Posts: 56

Re: Easy Poll 1.1.3

Yes it supported

Offline

 

#15 2005-10-06 13:17:21

Azakur4
New member
Registered: 2004-09-22
Posts: 6

Re: Easy Poll 1.1.3

hey man you can make a script for put the poll in a portal.

and for the people that have a portal modify this in extern.php

Find: Line 243

Code:

$result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

Replace:

Code:

$result = $db->query('SELECT t.id, t.subject, t.question FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

Find: Line 255

Code:

echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";

Replace

Code:

if ($cur_topic['question'] != '') 
    echo '<li><a href="'.$pun_config['o_base_url'].'/viewpoll.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
else
    echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";

Last edited by Azakur4 (2005-10-06 13:51:14)

Offline

 

#16 2005-10-06 14:24:33

terje
New member
Registered: 2005-10-04
Posts: 8

Re: Easy Poll 1.1.3

That would be very usefull, if I could use a forum poll, and put it on my frontpage.. How would one do that?

Offline

 

#17 2005-10-06 15:06:04

terje
New member
Registered: 2005-10-04
Posts: 8

Re: Easy Poll 1.1.3

Mediator wrote:

Yes it supported

If it's support, I shouldn't be getting: You are running a version of PunBB (1.2.8) that this mod does not support. This mod supports PunBB versions: 1.2.3, 1.2.4, 1.2.5, 1.2.6


Should I?

Offline

 

#18 2005-10-06 15:18:38

weasel
New member
Registered: 2005-10-05
Posts: 4

Re: Easy Poll 1.1.3

Yes.

Offline

 

#19 2005-10-06 15:29:38

terje
New member
Registered: 2005-10-04
Posts: 8

Re: Easy Poll 1.1.3

It works, but I  had to change the mod-install.php to support 1.2.8.. Cool mod! Would be cool if I could add permission to who could add polls, or what forums polls can be added too... Future feature requst maybe? cool anyway! Thanks man! :-)

Offline

 

#20 2005-10-06 21:57:33

Azakur4
New member
Registered: 2004-09-22
Posts: 6

Re: Easy Poll 1.1.3

I will try to do script for the frontpage but I don't promise anything

Offline

 

#21 2005-10-07 09:09:57

novasie
New member
Registered: 2005-10-05
Posts: 8

Re: Easy Poll 1.1.3

Hey iam using mod_active_topics.php to show latest posts on news section on website, as some have stated above it redirects u wrong so you cant see the poll in the post.. What do I need to edit here to make it redirect correctly?

Code:

<?php


$ak_limit = 4; // change this to the number of active topics you want to display.

$result = $db->query('
    SELECT t.* 
    FROM '.$db->prefix.'topics AS t 
    INNER JOIN '.$db->prefix.'forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN '.$db->prefix.'forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id='.$pun_user['g_id'].'
    ) 
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) 
    ORDER BY t.last_post DESC
    LIMIT '.$ak_limit
) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

?>
<div id="vf" class="blocktable">
        <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr>
                    <th class="tcl" scope="col"><?php echo $lang_common['::. Active posts'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>
            <tbody>
<?php
// If there are topics in this forum.
if ($db->num_rows($result))
{
    while ($cur_topic = $db->fetch_assoc($result))
    {
        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'icon';

        if ($cur_topic['moved_to'] == null)
            $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
        else
            $last_post = '&nbsp;';

        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        if ($cur_topic['moved_to'] != 0)
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }

        if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
        {
            $icon_text .= ' '.$lang_common['New icon'];
            $item_status .= ' inew';
            $icon_type = 'icon inew';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '<span class="newtext">[&nbsp;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&nbsp;]</span>';
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (1 == 0 && !$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
        {
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<strong>&middot;</strong>&nbsp;'.$subject;
            else
                $subject = '&nbsp;&nbsp;'.$subject;
        }

        if ($cur_topic['sticky'] == '1')
        {
            $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];
        }

        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= '&nbsp; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
        }

?>
                <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
                    <td class="tcl">
                        <div class="intd">
                            <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
                            <div class="tclcon">
                                <?php echo $subject."\n" ?>
                            </div>
                        </div>
                    </td>
                    <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : '&nbsp;' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : '&nbsp;' ?></td>
                    <td class="tcr"><?php echo $last_post ?></td>
                </tr>
<?php

    }
}
else
{

?>
                <tr>
                    <td class="tcl" colspan="4"><?php echo $lang_forum['Empty forum'] ?></td>
                </tr>
<?php

}

?>
            </tbody>
            </table>
        </div>
    </div>
</div>

Offline

 

#22 2005-10-08 12:25:26

Azakur4
New member
Registered: 2004-09-22
Posts: 6

Re: Easy Poll 1.1.3

i make other fix

in the edit.php

Find:

Code:

redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);

Replace:

Code:

// Easy Poll - Fix by Azakur4
$resultpost = $db->query('SELECT p.topic_id, t.question FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t WHERE p.id='.$id.' AND t.id=p.topic_id') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
$cur_question = $db->fetch_assoc($resultpost);
        
if ($cur_question['question'] != '') 
    redirect('viewpoll.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
else
    redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
// Easy Poll - Fix by Azakur4

Last edited by Azakur4 (2005-10-08 12:25:46)

Offline

 

#23 2005-10-09 07:03:47

novasie
New member
Registered: 2005-10-05
Posts: 8

Re: Easy Poll 1.1.3

Azakur4 I changed the code in edit.php but it didnt help it didnt show anyways tongue what is the problem?

Offline

 

#24 2005-10-09 09:26:31

Azakur4
New member
Registered: 2004-09-22
Posts: 6

Re: Easy Poll 1.1.3

well, this fix make that when you edit a post and you send the new message edited, the redirection makes well because if you edit a message with poll before it redirected to the viewtopic.php and you can't to see the poll with my fix this problem is solved.

Offline

 

#25 2005-10-23 12:03:56

Romain63
New member
Registered: 2005-10-22
Posts: 5

Re: Easy Poll 1.1.3

Hi everybody,
I have installed Easy Poll-1.1.3.2 to add polls to my forums but when I want to search a poll-topic, it doesn't find anything (but it works with normal-topics). Can you help me please ?
(I use the 1.2.9 version of PunBB)

Thanks, and excuse me for my english

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.