MyBB Community Forums

Full Version: enable regular members to edit polls ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I didn't see any settings to enable Registered member to edit polls Angel
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;
		// 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&amp;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&amp;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 Wink
This should be a core for MyBB Smile

Thank you so much Yaldaram !
(2011-11-22, 04:31 PM)phwebmaster.net Wrote: [ -> ]Thank you so much Yaldaram !

Thank You.