Quote:
Originally Posted by MarcoH64
Yes 2 things are wrong:
1. Since this condition is user dependant, you will need to uncomment the line:
PHP Code:
// $bbcodeparse_nopostcache = 1;
2. You will need to change the line:
PHP Code:
// global $neededglobalvarnames;
to:
PHP Code:
global $bbuserinfo;
in top of the function i think. See also the provided [noguest] example.
|
It's still not working, here is what I have now. I log in as guest and can still see the custom bbcode (I am using 'media' as my bbcode' it's been changed in all instances).
PHP Code:
// Start Hack Conditional BB-Codes (MarcoH64)
// ###################### Start bbcodehandler_noguest #######################
function handle_bbcode_media($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) // Guest
{
// You can change the following to whatever suits you, text and/or html
$code = "Sorry this text is not viewable by guests.";
}
return $code;
}
// End Hack Conditional BB-Codes (MarcoH64)