Version: 1.00, by Gary King
Developer Last Online: Jun 2020
Version: 3.0.0
Rating:
Released: 01-06-2004
Last Update: Never
Installs: 89
No support by the author.
Yes I know that there is already a a feature to stop guests from viewing threads, but then this also shows all the posts and threads counters to zero, and under Last Post it will say never (which sucks ). But, with my hack, it just asks guests to either login or register when viewing a thread and still shows all the right numbers
There is still a problem if your vB is closed for guest and a user registers at the forum without click on the activation eMail, he can still read threads in the forum!
I found the solution for one usergroupID in the thread.
PHP Code:
if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 1)
But for more usergroupID's it should look like:
PHP Code:
//if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 1 or $bbuserinfo['usergroupid'] == 3 or $bbuserinfo['usergroupid'] == 4 or $bbuserinfo['usergroupid'] == 8 or $bbuserinfo['usergroupid'] == 11 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
Is there a solution to reduce the line with the usergroupid checks like or $bbuserinfo['usergroupid'] == in array[1, 3, 4, 8, 11] or something like that ?
I've gotten all turned around in this thread, I'm wondering if someone can help me please?
I have one forum that I don't want ANYONE to see in any way (through searches, archives, nothing) unless they have special permission (admin or access masking).
One forum that I want registered members to have access to, and guests at least be able to see that there ARE threads in there, just not be able to view the actual threads.
And one forum that I want guests to be able to participate in.
So basically, I want the "can't view at all" AND the "open" options... pain in the rear, aren't I?
I am feeling really stupid cos i cant get this hack to work: my postcount remains at 0 at all forums.
Stupid i was. Again.
Of course i did not change the permissions for unregistered guests, i assumed they should see the posts automatically after applying this hack.
But since i had not given them rights to view the forum topics, i could not get this to work at all.
But now that i changed the forum rights settings they are allowed to see the topics, i get the right number of posts for them as well.
(But they still cant read the threads, only view them, as it was meant too).
I'm using this to keep out some determined fools on my site. For the benefit of anyone else who may be doing this, make sure you follow similar instructions as described in post #1 of this thread and apply the change to the following files in the same place:
printthread.php
search.php (it's possible to "find all posts by this user" and read posts that way)
showpost.php (in case a direct url is "guessed" or otherwise)
ALSO - we have all new registrants moderated, however these hacks only considered unregistered users. This meant people could "apply" to join the board and thereby skip all of these measures (by virtue of moving from the "guest" usergroup to the COPPA or "wait for email confirmation" usergroup).
As a result, all pages that I changed had a longer line added to them to cover all the appropriate usergroups:
Code:
if (($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 1 or $bbuserinfo['usergroupid'] == 3 or $bbuserinfo['usergroupid'] == 4) AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))
{
print_no_permission();
}
Don't forget to also amend the usergroup permissions for these usergroups so that they are the same as guests.
Of course, this all depends on your motives for keeping people out. Threads in our board are private so this was appropriate for us