Various modifications for phpBB3Hide code from guests

Snippets for phpBB3
Previous topicNext topic
User avatar

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6365
Joined: Jan 13th, '14, 20:45
    unknown unknown

Hide code from guests

Post by dmzx »

Hide code from guests

Open language/xx/viewtopic.php
Find This may be a partial find and not the whole line

Code: Select all

$lang = array_merge($lang, array(
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

'NO_CODE_FOR_GUESTS_1'    => 'Je kan dit alleen zien als je bent ',
        'NO_CODE_FOR_GUESTS_2'    => 'Ingelogd',
        'NO_CODE_FOR_GUESTS_3'    => ' of ',
        'NO_CODE_FOR_GUESTS_4'    => 'Registreer',
        'NO_CODE_FOR_GUESTS_5'    => ' een account.',
Open viewtopic.php
Find This may be a partial find and not the whole line

Code: Select all

$message = censor_text($row['post_text']);
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

if ($user->data['user_id'] == ANONYMOUS){
    $message = preg_replace("/\[code:(.*?)\](.*?)\[\/code:(.*?)\]/s", '[code:$1]' . $user->lang['NO_CODE_FOR_GUESTS_1'] . '<a href="ucp.php?mode=login">' . $user->lang['NO_CODE_FOR_GUESTS_2'] . '</a>' . $user->lang['NO_CODE_FOR_GUESTS_3'] . '<a href="ucp.php?mode=register">' . $user->lang['NO_CODE_FOR_GUESTS_4'] . '</a>' . $user->lang['NO_CODE_FOR_GUESTS_5'] . '[/code:$3]', $message);}
Credit to 4_seven and phpbb.com
User avatar

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5060
Joined: Apr 6th, '14, 14:12
    Windows 8 Chrome

Re: Hide code from guests

Post by martin »

Note this will not work on 3.1.2 yet ;)
Previous topicNext topic