MyBB Community Forums

Full Version: Hiding code & links from guests?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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. Big Grin
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? Big Grin
PS i want only [code][\code] & link like http://google.com to hide from guests in posts.

Thanks for help.
(2014-04-24, 08:25 AM)Vanz Wrote: [ -> ]TRY THESE OUT

http://mods.mybb.com/view/hide-content-until-reply

OR

http://mods.mybb.com/view/links-on-post

OR

http://mods.mybb.com/view/hideuntilpost

OR

http://mods.mybb.com/view/scd-code-hide-...d-plugin-2

I am not talking about these plugins. (i already know these)

The thing i want is that if someone posts a link or [code] it will automatically hide it from guests & it will display a message instead of link & code. hope anyone can reply Toungue
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 Big Grin

BUMP!