hi marco,
can you tell me why this does not work?
Code:
function handle_bbcode_noguest($code)
{
global $bbuserinfo;
// remove empty codes
if (trim($code) == '')
{
return '';
}
// Prevent caching if a BB-code is used that is userdependent
// Uncomment the following 2 lines if the parsing of the bb-code is user dependent.
// So:
// - If user permissions are checked
// - If usergroup is checked
// - if userid is checked
// - .....
// Leave commented if:
// - No checking is done
// - Checking is done based on forumid
// - ....
global $bbcodeparse_nopostcache;
$bbcodeparse_nopostcache = 1;
if ($bbuserinfo['userid'] == 0 OR $bbuserinfo['usergroupid'] == 2) // Guest
{
$code = "no guest!";
}
return $code;
}
usergroup 2 are those with 0 posts. i dont know why they still can see what lies beneath the tag. it still works for guests with this code but not for registered users with 0 posts. (usergroup id 2)
haha, i solved the "problem" myself. i just added usergroupid instead of userid.
thanks a lot for this great hack. everything works fine now!