Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 15:27

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 15 Oct 2011, 19:54 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
No Code Content 4 Guests

Ok, here is a very smart and lite version to hide code-content from guests :idea:

with link to login or register..

Screen

Image

Instruction

open

language/xx/viewtopic.php

find

Code:
     $lang = array_merge($lang, array


after add

Code:
     // No Code Content 4 Guests / 4seven / 2009
        'NO_CODE_FOR_GUESTS_1'    => 'Please ',
        'NO_CODE_FOR_GUESTS_2'    => 'Login',
        'NO_CODE_FOR_GUESTS_3'    => ' or ',
        'NO_CODE_FOR_GUESTS_4'    => 'Register',
        'NO_CODE_FOR_GUESTS_5'    => ', to see this Content',
    // No Code Content 4 Guests / 4seven / 2009      


open

viewtopic.php

find

Code:
     $message = censor_text($row['post_text']); 


after add

Code:
     // No Code Content 4 Guests / 4seven / 2009
    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);}
    // No Code Content 4 Guests / 4seven / 2009        


clear all board-caches

enjoy

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.031s | 21 Queries | GZIP : Off ]