Log in

View Full Version : Restricted forum problem (involving the Search)


mindbuster
10-31-2002, 03:58 PM
Hi.

I have placed this piece of code on line 63 in forumdisplay.php

if ($bbuserinfo[posts]<5 AND $forumid==19) {show_nopermission();exit;}

to deny access for forum guests and members with less than 5 posts.
It works fine except that if a guest uses the search function, threads in that forum shows up too and they can just click one of the search results to get access to the forum.

How do i prevent that?

Xenon
10-31-2002, 04:03 PM
well you can add
if ($bbuserinfo[posts]<5 AND $threadinfo[forumid]==19) {show_nopermission();exit;}

to showthread.php

but user can always see posts in the searchengine.
functions to completly secure vb forums through postcounter isn't so easy, because you have to edit more file.

vb3 will have this feature as a built in

mindbuster
10-31-2002, 04:12 PM
Ahh, thanks, that makes it even better, the forum is a "sign up and make some posts to get access to the goods" forum, all can see the forum is there but not all can access it, it's only for the good that the threads show up in a search as long as they cant be accessed.

But, umm, where in showthread.php do i include the line. :lick:

Xenon
10-31-2002, 04:18 PM
i'd put it after this:
$forum=getforuminfo($thread['forumid']);

$getperms=getpermissions($thread['forumid'],-1,-1,$forum['parentlist']);
if (!$getperms['canview']) {
show_nopermission();
}
if (!$getperms['canviewothers'] and $thread['postuserid']!=$bbuserinfo['userid']) {
show_nopermission();
}

mindbuster
10-31-2002, 04:44 PM
Hmm, didnt work, and i did log out first.

I placed the line where you mentioned.

NTLDR
10-31-2002, 04:57 PM
Use $thread[forumid] and not $threadinfo[forumid] ;)

mindbuster
10-31-2002, 05:20 PM
Just tried that too NTLDR, didnt work either.

Erwin
10-31-2002, 05:46 PM
Mmm... are you sure... it should work... Try placing the code ABOVE that piece of code Xenon told you to find.

mindbuster
10-31-2002, 06:15 PM
Nope, didnt work either Erwin.