phpBB3 Hide Code from Guests

Posted on October 19th, 2009
Written by Richard
Posted in: N/A (old archives)

I’m playing with phpBB3, and I wanted to make it so that only logged-in users could see blocks of code in the posts. Guests will see everything but the code block. After looking around a bit, here’s what I finally did: In includes/bbcode.php, find the function bbcode_second_pass_code, and add this to the top of it:

global $user;
if(empty($user->data['is_registered']) ||
!empty($user->data['is_bot']))
{ $code = “You must be logged in to see code blocks.”; }

I wanted to do this for url links as well, but it wasn’t as obvious where one would put a similar piece of code…

Comments

blog comments powered by Disqus