MyBB Central

Full Version: CODE content hidden to guests
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. Is there any possibility to make a plugin that CODE content will be hidden to guests?
A code change is 'easier' =P

Open ./inc/class_parser.php

Find
PHP Code:
    function mycode_parse_code($code$text_only=false)
    {
        global 
$lang

Change into
PHP Code:
    function mycode_parse_code($code$text_only=false)
    {
        global 
$mybb$lang;

        if(!
$mybb->user['uid'])
        {
            return 
"<div class=\"codeblock\">\n<div class=\"title\">".$lang->code."\n</div><div class=\"body\" dir=\"ltr\"><code><em>Content Hidden For Guests</code></div></div>\n";
        } 
LeX, thanks a lot. Works perfect.