PDA

View Full Version : Whats the code for only some people can see the button?


Exo
04-05-2003, 07:35 PM
Hi,

i want make a special delete Button in the showthread.php and i want that only the thread starter, admin, mods of this forum can see the button, how can i do it?


thanks :)

mr e
04-05-2003, 08:36 PM
you would do

if ($bbuserinfo['userid'] == $post['userid'] or $bbuserinfo['usergroupid'] == 6 or $bbuserinfo['usergroupid'] == 7 or $bbuserinfo['usergroupid'] == 5) {
// do button stuff//
}

Exo
04-07-2003, 06:00 PM
hi thanks but i have many self made mod groups and so i must always change the IDs.

is there no other way so that the board looks if the mod can delete in his forum?

Boofo
04-07-2003, 06:18 PM
You could also add this to that line.

$permissions[ismoderator]

mr e
04-08-2003, 04:11 AM
i think this will work too


if ($bbuserinfo['userid'] == $post['userid'] or ismoderator()) {
// do button stuff//
}

Boofo
04-08-2003, 04:23 AM
If you use just ismoderator(), then any mod can delete the message. If you use $permissions[ismoderator], then just the moderators of that forum can delete the message (as well as Admins and Supermods, of course).