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\Languages\Modification.english.php
Find:
?>
Add Before:
$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>';
In Sources/Subs.php
Find: '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>',
Replace it with:
'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>',
You can change text strings as you like.
This trick is available as mod also, here (http://custom.simplemachines.org/mods/index.php?mod=2953).
this might be better on the tips board. it is a nice idea for some forums.
arantor had a mod that works for RC3 but it also works on RC4 that did the hide code from guests ;D lucky me i have it now his site is gone.
Quote from: tesser on January 09, 2011, 01:07:43 PM
arantor had a mod that works for RC3 but it also works on RC4 that did the hide code from guests ;D lucky me i have it now his site is gone.
I must have missed that mod.
For working demo of code above you can open any non-sticky post from this board (http://www.freakygurus.com/index.php?board=67.0).
might be slightly more professional to add a space in the code replacement
Only registered users can see contents.Please click here to Register or Login
and replace with
Only registered users can see this content. Please click here to Register or Login.
QuoteI must have missed that mod.
I did a mega version of the 'registered links' mod that did code tags as well, also provided the option to only hide links that aren't internal ones.
Quote from: Illori on January 09, 2011, 01:20:53 PM
might be slightly more professional to add a space in the code replacement
Only registered users can see contents.Please click here to Register or Login
and replace with
Only registered users can see this content. Please click here to Register or Login.
Thanks for the suggestion. Made the changes in above code regarding the space you have mentioned.
Quote from: IncognitoMuse on January 09, 2011, 01:30:55 PM
QuoteI must have missed that mod.
I did a mega version of the 'registered links' mod that did code tags as well, also provided the option to only hide links that aren't internal ones.
Nice to see the biggest spammer back ;D.
I wouldn't call it back, seeing how the support I'm doing is extremely limited, mostly to assess things that I think need to be fixed in SMF, and that none of the mods that were on arantormods.com are being published anywhere by me, in fact the only place to get them now is a paid site I gave them to, so they could sell the mods to folks.
Quote from: IncognitoMuse on January 09, 2011, 01:36:20 PM
I wouldn't call it back, seeing how the support I'm doing is extremely limited, mostly to assess things that I think need to be fixed in SMF, and that none of the mods that were on arantormods.com are being published anywhere by me, in fact the only place to get them now is a paid site I gave them to, so they could sell the mods to folks.
Lol, I myself was busy like hell in past month, even missed to celebrate new year :-X.
Thank you so much for your advice. Exactly what I was looking for! ;)
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:
?>
Add Before:
$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>';
In Sources/Subs.php
Find: '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>',
Replace it with:
'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>',
You can change text strings as you like.
how to hide quote tag also?
also after login user backto forum index. how to log him back to where he is actually?
The same way you would with the code tags...only for the quote tags.
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.
That depends that how the data of quotes is being handled. I may take a look at the file in a bit.
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.
You actually can't directly rewrite quote tags because the contents of the tag is never supplied to the parser (since it can contain other tags)
All you can do is what I used to do in my registered-links mod: rewrite the start and end tags in the validate function to something else, then strip them out in the obsess_rewrite buffer.
Quote from: Arantor on February 02, 2011, 08:32:23 AM
You actually can't directly rewrite quote tags because the contents of the tag is never supplied to the parser (since it can contain other tags)
That's what I thought after seeing "Remove images from quotes tag" mod.
Quote
All you can do is what I used to do in my registered-links mod: rewrite the start and end tags in the validate function to something else, then strip them out in the obsess_rewrite buffer.
Umm that seems to be a bit above my head.
hi this is very useful mod for me and i'm grateful that you share this with us the leechers
however, there is no Themes\Default\Modification.english.php file in my default theme nor my other sub themes.
so how?
smf 2.0 rc5
Try one level down, so:
Themes/default/languages/Modifications.english.php
Quote from: mashby on May 24, 2011, 09:55:26 AM
Try one level down, so:
Themes/default/languages/Modifications.english.php
Thanks for pointing out the error ;).
thank you very much :laugh:
/me points to his mod (http://custom.simplemachines.org/mods/index.php?mod=2861)...is this unsolicited advertising? :P
It depends on your intentions.