2011-11-22, 03:39 PM
2011-11-22, 03:59 PM
By default, only mods and admins are allowed to edit polls, here is how you can allow mods, admins and thread authors to edit polls.
Open ./showthread.php and find;
Save.
Now open ./polls.php and find;
Within the same file, find;
Save the file.
Now thread authors are able to edit their own polls along with Admins and Mods
Open ./showthread.php and find;
// Check if user is allowed to edit posts; if so, show "edit poll" link.
if(!is_moderator($fid, 'caneditposts'))
{
$edit_poll = '';
}
else
{
$edit_poll = " | <a href=\"polls.php?action=editpoll&pid={$poll['pid']}\">{$lang->edit_poll}</a>";
}
and Change it into; // Check if user is allowed to edit posts; if so, show "edit poll" link.
if(!is_moderator($fid, 'caneditposts') && $thread['uid'] != $mybb->user['uid'])
{
$edit_poll = '';
}
else
{
$edit_poll = " | <a href=\"polls.php?action=editpoll&pid={$poll['pid']}\">{$lang->edit_poll}</a>";
}
Save.
Now open ./polls.php and find;
if(!is_moderator($fid, "caneditposts"))
{
error_no_permission();
}
and Change it into; if(!is_moderator($fid, "caneditposts") && $thread['uid'] != $mybb->user['uid'])
{
error_no_permission();
}
Within the same file, find;
if(!is_moderator($thread['fid'], "caneditposts"))
{
error_no_permission();
}
and Change it into; if(!is_moderator($thread['fid'], "caneditposts") && $thread['uid'] != $mybb->user['uid'])
{
error_no_permission();
}
Save the file.
Now thread authors are able to edit their own polls along with Admins and Mods

2011-11-22, 04:31 PM
This should be a core for MyBB 
Thank you so much Yaldaram !

Thank you so much Yaldaram !