Your ultimate PunBB resource!
You are not logged in.
## ## ## 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. ##
Offline
Change Log
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
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 ![]()
Thank you in advance!
Offline
Help me, please! It should not be so difficult...
Offline
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?
Offline
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
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
Oh and in the instructions uploading the plugins/AP_polls.php is missing too.
Offline
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:
$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>';
to this:
$subject = $lang_polls['Poll'].': <a href="viewpoll.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
Offline
The french translation has been done here ![]()
Thanks for this mod !
Offline
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)
1.2.8 version supported? I really would like to try this.
thanks ;-)
Offline
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
$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:
$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
echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
Replace
if ($cur_topic['question'] != '')
echo '<li><a href="'.$pun_config['o_base_url'].'/viewpoll.php?id='.$cur_topic['id'].'&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'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";Last edited by Azakur4 (2005-10-06 13:51:14)
Offline
That would be very usefull, if I could use a forum poll, and put it on my frontpage.. How would one do that?
Offline
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
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
I will try to do script for the frontpage but I don't promise anything
Offline
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?
<?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'].' '.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['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 (1 == 0 && !$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>Offline
i make other fix
in the edit.php
Find:
redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);Replace:
// 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 Azakur4Last edited by Azakur4 (2005-10-08 12:25:46)
Offline
Azakur4 I changed the code in edit.php but it didnt help it didnt show anyways
what is the problem?
Offline
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
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