PDA

View Full Version : User Permissions in Showthread.php


MarkB
01-06-2002, 02:07 PM
Hi,

Can anyone please let me know how I will have it set in showthread.php that a particular template is displayed ONLY if the user viewing the thread has permission to post to it?

Thanks.
Mark

Admin
01-06-2002, 02:15 PM
Take a look at newreply.php:
$permissions=getpermissions($threadinfo[forumid]);
if (($bbuserinfo['userid']!=$threadinfo['postuserid']) and (!$permissions['canviewothers'] or !$permissions['canreplyothers'])) {
show_nopermission();
}
if (!$permissions['canview'] or (!$permissions['canreplyown'] and $bbuserinfo['userid']==$threadinfo['postuserid'])) {
show_nopermission();
}
You will need to replace all $threadinfo['xxx'] vars with the $thread array, because that's how it works in showthread.php.

Need I say more? :)

MarkB
01-06-2002, 02:16 PM
Ah! That's where I was going wrong. Thanks!

MarkB
01-06-2002, 02:23 PM
Except it's not working :lol:

Not to matter, as long as I'm on the right track.