Hello,
I wanna know is there any way to hide [code] & external links from guests?
Instead o links & code it will display a custom message? like you have to register to view hidden content?
Any help will be greatly appreciated.
add hook to something that runs before a post loads, then use:
// Guest
if(!$mybb->user['uid'])
{
error("Please die guest.");
}
Can i do this through my templates or any file edit?
Sorry for noob question but how?
PS i want only [code][\code] & link like
http://google.com to hide from guests in posts.
Thanks for help.
Well, you can edit the parser file -
inc/class_parser.php. For [code] and php], try changing:
$message = preg_replace("#\<mybb-code>\n?#", $code, $message, 1);
to:
if(!$mybb->user['uid']) $code = '<strong>Hidden from guests.</strong>';
$message = preg_replace("#\<mybb-code>\n?#", $code, $message, 1);
(2014-04-24, 10:02 AM)Destroy666 Wrote: [ -> ]Well, you can edit the parser file - inc/class_parser.php. For [code] and php], try changing:
$message = preg_replace("#\<mybb-code>\n?#", $code, $message, 1);
to:
if(!$mybb->user['uid']) $code = '<strong>Hidden from guests.</strong>';
$message = preg_replace("#\<mybb-code>\n?#", $code, $message, 1);
DANG that worked!
One more thing how can i do this with external links? like only forum's links will display & others will not if it's like mediafire.com it will not display
Any help about this?
Thanks for the great help so far
BUMP!