MyBB Community Forums

Full Version: 27 - PreventDoublePosting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is this mod supposed to prevent admins from double posting too??

If yes, then its not working. I dont know why, I did the steps correctly and uploaded. And worst of all, no errors to help you.

If no, then Ill have to make a new account and test.

k776
No, this mod does not prevent administrators from double posting. Wink
Hmm, well, can someone test it please?? I cant seem to logout to create a new account Sad Ill delete your account aftarware if you want.

http://www.linuxbox.co.nz/~kieran/Forum/

k776
Are you sure you've set your cookies correctly?
Its ok, I managed to logout, create an account, and it works. thanks for the help.

k776
However, new question.

I want the quick reply box to be there, even if a user has posted before. Currently it doesn't. What part of he code must I change to make it work??
newreply.php

$query = $db->query("SELECT lastposter FROM threads WHERE tid='$tid'");
$lastposter = $db->result($query, 0);
if($mybb[usergroup] != 4 && $lastposter == $mybb[username] || ($lastposter == "Guest" && $mybb[usergroup] == 1))
{
	error("Permission denied", "Please wait for somebody else to reply before attempting to post again in this thread.");
}


showthread.php

$query = $db->query("SELECT lastposter FROM threads WHERE tid='$tid'");
$lastposter = $db->result($query, 0);
if($mybb[usergroup] == 4 || $lastposter != $mybb[username] && ($lastposter == "Guest" && $mybb[usergroup] != 1))
{
	eval("\\$quickreply = \\"".$templates->get("showthread_quickreply")."\\";");
}
So, what page and what part of the code??

k776
If you want the quick reply box to still show, regardless of whether a user has posted or not, then make the above changes to the newreply.php file but not the showthread.php file.
I dont understand. Can you explain this a bit more please??

k776
When you install the mod, do this...

Open: newreply.php

Find:

// Max images check
if($action == "do_newreply")

After add:

$query = $db->query("SELECT lastposter FROM threads WHERE tid='$tid'");
$lastposter = $db->result($query, 0);
if($mybb[usergroup] != 4 && $lastposter == $mybb[username] || ($lastposter == "Guest" && $mybb[usergroup] == 1))
{
	error("Permission denied", "Please wait for somebody else to reply before attempting to post again in this thread.");
}

However, ignore these steps...

Open: showthread.php

Find:

eval("\\$quickreply = \\"".$templates->get("showthread_quickreply")."\\";");

Replace with:

$query = $db->query("SELECT lastposter FROM threads WHERE tid='$tid'");
$lastposter = $db->result($query, 0);
if($mybb[usergroup] == 4 || $lastposter != $mybb[username] && ($lastposter == "Guest" && $mybb[usergroup] != 1))
{
	eval("\\$quickreply = \\"".$templates->get("showthread_quickreply")."\\";");
}

If you have already installed the mod, then simply "undo" the last change.
Cool, thanks. It worked.

k776