76 (edited by whiteh0rs3 2005-04-05 12:30)

Re: Easy Poll - 1.1.3

Yeah... that good suggestions, but I think Mediator still working on it right now.. then you just have to wait for it right now...

Re: Easy Poll - 1.1.3

Dexus theres no point in asking people to totally rewrite their mod the way you want it, if you have to make some modifications twice then its just life,

I guess my suggestions about topic/polls hybrid php (one, common, not two different) with independently linked TOPICS TO POLLS, not vice-versa, as now, were ignored sad.

as for your suggestions... where were they?

78

Re: Easy Poll - 1.1.3

post#72 wrote:

In the same time you could be able to moderate polls in more flexible ways, i.e. to unlink polls from topic; to list polls (with links to topics); to search in poll's questions; to open/close poll (without influence on topic's open state); to clear poll state; to add poll to existed topic, etc.
It's not a secret, that "polling" idea come when topic with related subject is already created. Also "re-vote" ability will be important (or maybe revotable checkbox in poll options). For topic's author this "add poll" ability will be fascinating.

Re: Easy Poll - 1.1.3

lol well thats no good is it, you have to make the suggestion before the mod has been written

80

Re: Easy Poll - 1.1.3

i wasn't here.. and didn't even know about punbb at all:)
as usual, good idea comes afterwards smile

Re: Easy Poll - 1.1.3

yeh but as i said you can't expect people to rewrite their mods the way you want them too

82

Re: Easy Poll - 1.1.3

sure. so I have two ways - 1) to write my own, from scratch. 2) to wait someone who already started to use my ideas.

83 (edited by Mediator 2005-04-11 00:36)

Re: Easy Poll - 1.1.3

1.1.0 has been released

Release Notes:

1.1.0 fixes serveral flaws including one major security flaw, it is strongly recommended that everyone upgrades.

ChangeLog:

Fixed:
Language problem with new multiselect (yes/no) polls
Possible bug with new poll options
Problem with user being able to create poll with 1 or no options
Serious problem when poll was created with errors
Fixed unlikely but possible xss bug
Message in new polls is no longer optional, as it wasn't possible to delete them without a first message
Many problems with viewpoll.php for colored usergroups
Fixed SERIOUS exploit where users could possibly create polls with 100s of options

Changed:
Percent and # format for votes displayed - requested by Evilman

Added:
Graphical bars to represent percents - requested by many

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

Re: Easy Poll - 1.1.3

Yess... this is what I realy want it smile I've already upgrade and everything works perfectly. Thanks dude..

Mediator wrote:

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

I've already take a look at Admin Plugin but there is no options that let me do that. In where you adding it?

Re: Easy Poll - 1.1.3

I had to postpone that addition because of the security flaw I found.

I enjoy pie :)

Re: Easy Poll - 1.1.3

Added:
Graphical bars to represent percents - requested by many

wooo! big_smile good job

87 (edited by Lim-Dul 2005-04-12 08:44)

Re: Easy Poll - 1.1.3

Taken from PunBB Resource:

When I apply the very last set of changes to my viewforum.php (line 155 and up) my PunBB suddenly starts acting weird. I've installed only your Global Announcements MOD before this one. What I mean by weird is: Once I enter any forum ALL the topics from ALL the forums get listed there. This happens in all the forums... I have double, triple and quadruple checked my edits.

Could you just send me the modified viewforum.php and footer.php with those 2 MODs (Global Announcements + Easy Poll) installed?

I could compare my changes with the correct ones and tell you if that was my fault, or yours in the readme. smile

http://www.punres.org/viewtopic.php?id=312

88

Re: Easy Poll - 1.1.3

A big big request ...

how to implement a poll on a website ???

It would be great a poll can be choose in admin panel, generates a code to copy/paste on the main page for example ...

Re: Easy Poll - 1.1.3

I would like to thank you for this mod, and provide a link for a Russian translation of this mod:
ru-polls.php-Easy.Poll-1.1.0

90

Re: Easy Poll - 1.1.3

Today I am upgrading my forum from 1.1.5 to 1.2.5. I have got PunPoll v1.2.8 which I would like to change to EasyPoll 1.1.0. Can you give me any hints how to do it?

Re: Easy Poll - 1.1.3

Not sure what the problem is, but everytime I install this mod, I get "unable to fetch topic list" when trying to open forums. I can't say if there are any other errors, as that one preceeds anything else.

Re: Easy Poll - 1.1.3

Edward wrote:

Today I am upgrading my forum from 1.1.5 to 1.2.5. I have got PunPoll v1.2.8 which I would like to change to EasyPoll 1.1.0. Can you give me any hints how to do it?

i'm pretty sure the way it is now you will lose all your polls, but i haven't looked properly at both databases so i can't really help you move them accross and keep them

93

Re: Easy Poll - 1.1.3

Daimon Link wrote:

Not sure what the problem is, but everytime I install this mod, I get "unable to fetch topic list" when trying to open forums. I can't say if there are any other errors, as that one preceeds anything else.

Seconding this issue, any suggestions?

94

Re: Easy Poll - 1.1.3

Any suggestions.  I installed this mod and if there isn't a poll no problem, but if there is a poll in the forum then in viewforum I there is this notice:

Notice: Undefined index: question in /homepages/8/d123815915/htdocs/member/viewforum.php on line 158

95

Re: Easy Poll - 1.1.3

And now that I look at it the poll isn't working at all.  When I create a poll, I then see it.  I choose and answer and I see the results, but when I go back to the forum I see that notice and then if I go back to the topic I don't see anything about the poll.  If I log in as another user, I don't see anything about the poll in the topic.

Suggestions?  There is also an extranious < above the footer.

96

Re: Easy Poll - 1.1.3

In case you want to take a look it is at http://www.bvtest.com/member/viewforum.php?id=8

97

Re: Easy Poll - 1.1.3

I tried to install the mod and I got the message:

An error was encountered
File: /home/bulgaricus/public_html/forum/install_mod.php
Line: 22

PunBB reported: Unable to add columns to table

Database reported: Duplicate column name 'question' (Errno: 1060)

What is wrong?

Re: Easy Poll - 1.1.3

Edward: you either have another poll mod installed, or already installed Easy Poll

Spud: What Database type do you use, and are you sure you followed the readme correctly. If so please email or upload your viewforum.php file somewhere as a text file

ted: Exactly the same as spud, I need to know what type of database you use, and if you are sure you followed the readme correctly.

I enjoy pie :)

99

Re: Easy Poll - 1.1.3

I am using mysql.  I checked a few times so I think I am following the readme correctly, in fact I am pretty sure that I did but you never know.  I also saw in another place code posted to replace one of the sections and I tried that and get the same result.  I think that was for if you had the global announcement mod, but wasn't clear so I thought I would try it.   Here is my viewforum.php:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';


if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);


$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id < 1)
    message($lang_common['Bad request']);

// Load the viewforum.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

// Load poll language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/polls.php';

// Fetch some info about the forum
$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics FROM '.$db->prefix.'forums AS f 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) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
    message($lang_common['Bad request']);

$cur_forum = $db->fetch_assoc($result);

// Is this a redirect forum? In that case, redirect!
if ($cur_forum['redirect_url'] != '')
{
    header('Location: '.$cur_forum['redirect_url']);
    exit;
}

// Sort out who the moderators are and if we are currently a moderator (or an admin)
$mods_array = array();
if ($cur_forum['moderators'] != '')
    $mods_array = unserialize($cur_forum['moderators']);

$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;

// Can we or can we not post new topics?
if (($cur_forum['post_topics'] == '' && $pun_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod)
    $post_link = "\t\t".'<p class="postlink conr"><a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a> <BR /> <a href="poll.php?fid='.$id.'">'.$lang_polls['New poll'].'</a></p>'."\n";
else
    $post_link = '';


// Determine the topic offset (based on $_GET['p'])
$num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = $pun_user['disp_topics'] * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id);


$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_forum['forum_name']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink conl"><?php echo $paging_links ?></p>
<?php echo $post_link ?>
        <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
        <div class="clearer"></div>
    </div>
</div>

<div id="vf" class="blocktable">
    <h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>
    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr>
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></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

// Fetch list of topics to display on this page
if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
{
    // Without "the dot"
    $sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
}
else
{
    // With "the dot"
    switch ($db_type)
    {
        case 'mysql':
        case 'mysqli':
            $sql = 'SELECT 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.question FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
            break;

        case 'sqlite':
            $sql = 'SELECT 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.question FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.id IN(SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'].') GROUP BY t.id ORDER BY t.sticky DESC, t.last_post DESC';
            break;

        default:
            $sql = 'SELECT 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.question FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY 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.question, p.poster_id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
            break;

    }
}

$result = $db->query($sql) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

// 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'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
        else
            $last_post = ' ';

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

if ($cur_topic['question'] != '') {
            if ($pun_config['o_censoring'] == '1')
                $cur_topic['question'] = censor_words($cur_topic['question']);
        
        
            if ($cur_topic['moved_to'] != 0)
                $subject = $lang_forum['Moved'].': '.$lang_polls['Poll'].': <a href="viewpoll.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['question']).'</a><br /> <span class="byuser"><b>'.pun_htmlspecialchars($cur_topic['subject']).'</b> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            else if ($cur_topic['closed'] == '0')
                $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'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            else
            {
                $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'].' '.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">[ <a href="viewpoll.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
            }
            else
                $subject_new_posts = null;
    
            // Should we display the dot or not? :)
            if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
            {
                if ($cur_topic['has_posted'] == $pun_user['id'])
                    $subject = '<strong>·</strong> '.$subject;
                else
                    $subject = '  '.$subject;
            }
        } else {
            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'].' '.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'].' '.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'].' '.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">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
            }
            else
                $subject_new_posts = null;
    
            // Should we display the dot or not? :)
            if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
            {
                if ($cur_topic['has_posted'] == $pun_user['id'])
                    $subject = '<strong>·</strong> '.$subject;
                else
                    $subject = '  '.$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 .= '  '.(!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'] : ' ' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></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>

<div class="linksb">
    <div class="inbox">
        <p class="pagelink conl"><?php echo $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id) ?></p>
<?php echo $post_link ?>
        <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
        <div class="clearer"></div>
    </div>
</div>
<?php

$forum_id = $id;
$footer_style = 'viewforum';
require PUN_ROOT.'footer.php';

100 (edited by ted 2005-04-21 01:42)

Re: Easy Poll - 1.1.3

To be clear, I do not use the global announcement mod.  I just wasn't sure if that piece of code I saw was just for if you had it or not.

And if you were asking the version of mysql, it is 4.0.20