Customizing SMF > Now Available

Hide the content of [code] tags from guests

<< < (3/5) > >>

Cowley:
Thank you so much for your advice. Exactly what I was looking for!  ;)

Jeet Chowdhury:

--- Quote from: Joker™ on January 09, 2011, 12:29:47 PM ---I was personally having the problem on my forum that people were posting links in code tag which was visible to guests, so as to overcome this problem we can now hide the whole data in code tag from guests.

To do so, you just have to make following edits;

In Themes\Default\Modification.english.php

Find:

--- Code: ---?>
--- End code ---

Add Before:

--- Code: ---$txt['something'] = 'Only registered users can see contents.';
$txt['blabla'] = 'Please click here to <a target="_blank" href="' . $scripturl . '?action=register"">Register</a> or <a target="_blank" href="' . $scripturl . '?action=login">Login</a>';
--- End code ---


In Sources/Subs.php

Find:
--- Code: ---            'tag' => 'code',
            'type' => 'unparsed_content',
            'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
--- End code ---

Replace it with:

--- Code: ---            'tag' => 'code',
            'type' => 'unparsed_content',
            'content' => $user_info['is_guest'] ? '<div class="codeheader">' . $txt['code'] . ': </div><code class="bbc_code">' . $txt['something'] . ' ' . $txt['blabla'] . '</code>' :  '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
--- End code ---


You can change text strings as you like.

--- End quote ---

how to hide quote tag also?


also after login user backto forum index. how to log him back to where he is actually?

Labradoodle-360:
The same way you would with the code tags...only for the quote tags.

Joker™:

--- Quote from: Labradoodle-360 on February 01, 2011, 11:45:28 AM ---The same way you would with the code tags...only for the quote tags.

--- End quote ---
That depends that how the data of quotes is being handled. I may take a look at the file in a bit.

Joker™:
Lol hiding data in quotes seems to bit tricky as last night I was unable to find how that data is supplied in quotes tag, I will this thing a shot tonight for sure.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version