Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: vbgamer45 on March 29, 2011, 09:50:16 PM

Title: Hide the content of [code] tags from guests
Post by: vbgamer45 on March 29, 2011, 09:50:16 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2953)

This mod will hide the content of code tags from guests.

Instead of content of code tags, guests will be shown a default message saying -
"Only registered users can see contents. Please click here to Register or Login."

With the admin panel provided by the mod, an admin can:
- Enable/disable the mod
- Select the boards on which mod should be enabled
- Change the message to be shown to guests


Note - By default none of the boards is selected, after installing the mod, please enable the mod on the boards as you desire.


Change Log


Version 1.2
- A major overhaul of mod.
- Added an admin panel where one can select board on which mod should be activated
- Option to change the text to be shown to the guests, when guests view content of code tags
- Minor bug fixes


Version 1.1
- Mod updated for SMF 2.0 final.
- License added to the mod.


Github Link (https://github.com/Joker-SMF/SMF-HideCodeTagsFromGuests)


License
* This SMF Modification is subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this SMF modification except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on April 07, 2011, 01:40:18 PM
Great mod thanks for sharing but joker bhai main colors change karna chahata hoon kya yeah possible hai aur jo font hai woh bold and red karana chahata hoon kon sa file modify karan padega please help me
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on April 07, 2011, 01:45:05 PM
Your SMF version and theme?

Also, please ask questions in English as if someone faces the same issue he can read your question and find the appropriate answer :).
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on April 07, 2011, 02:23:02 PM
RC5 and theme is default
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on April 07, 2011, 02:26:17 PM
So if I'm correct you want to make text-font bold and red in color in code tags?
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on April 07, 2011, 02:27:26 PM
yes u r right just look like your forum freakygurus
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on April 07, 2011, 02:29:42 PM
go to

themes\default\css\index.css

Code (Find:) Select
code.bbc_code {
    background: none repeat scroll 0 0 #EEEEFF;
    border-bottom: 2px solid #999999;
    border-top: 2px solid #999999;
    display: block;
    font-family: "dejavu sans mono","monaco","lucida console","courier new",monospace;
    font-size: x-small;
    line-height: 1.5em;
    max-height: 24em;
    overflow: auto;
    padding: 3px 1em;
    white-space: pre;
}



Code (Replace it with:) Select
code.bbc_code {
    background: none repeat scroll 0 0 #EEEEFF;
    border-bottom: 2px solid #999999;
    border-top: 2px solid #999999;
    color: red;
    display: block;
    font-family: "dejavu sans mono","monaco","lucida console","courier new",monospace;
    font-size: x-small;
    font-weight: bold;
    line-height: 1.5em;
    max-height: 24em;
    overflow: auto;
    padding: 3px 1em;
    white-space: pre;
}



It has been ages since I properly went to that forum and made any changes to it.
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on April 07, 2011, 02:36:29 PM
Sorry to say but i'am not able to find that code here is my index.css file please check
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on April 07, 2011, 02:41:58 PM
Try attached file
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on April 07, 2011, 03:00:33 PM
Great Joker Bhai it's work Thank you gain
Title: Re: Hide the content of [code] tags from guests
Post by: mariusfv on April 08, 2011, 02:19:59 AM
Hi,

I like your mod, but I suggest you if possible to add an exception:
"Admin to have possibility to post code tag without hide the content from guest" I think Admin always know what are doing with his forum.
10x
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on April 08, 2011, 04:11:03 AM
Quote from: mariusfv on April 08, 2011, 02:19:59 AM
Hi,

I like your mod, but I suggest you if possible to add an exception:
"Admin to have possibility to post code tag without hide the content from guest" I think Admin always know what are doing with his forum.
10x
Sorry I can't understand what are you saying exactly. This mod mainly encourages user to register irrespective of member ranks.
Title: Re: Hide the content of [code] tags from guests
Post by: jaisi on May 16, 2011, 03:19:13 PM
Joker bro it is possible to instal both mod  Hide Tag Special and your mod ??
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on May 16, 2011, 03:24:13 PM
Quote from: jaisi on May 16, 2011, 03:19:13 PM
Joker bro it is possible to instal both mod  Hide Tag Special and your mod ??
I've not seen that mod yet so not sure whether it will work with this mod or not.
Title: Re: Hide the content of [code] tags from guests
Post by: OCJ on May 31, 2011, 11:03:37 AM
Been waiting for this for a while as all the old mods no longer work - thanks.
After installing I expected to see bbcode but nothing there - do the tags have to be typed in manually?

I can put it in a boiler plate anyway but  would like to confirm which way it works - bbcode from editor or manual.

Andy

Sorry... Ive just found it! #
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on May 31, 2011, 11:49:10 AM
Quote from: Joker™ on March 29, 2011, 09:50:16 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2953)

This mod will hide the content of code tags from guests. Instead of content of code tags guests will be shown a message saying -

Only registered users can see contents. Please click here to Register or Login.

See the screen shot attached below.
It will simply hide the code tag for guests. Have you seen the screen shots yet?
Title: Re: Hide the content of [code] tags from guests
Post by: Bugo on July 09, 2011, 12:36:15 AM
Unfortunately, the contents of the code tag appears in forum rss feed => guests see it.
Title: Re: Hide the content of [code] tags from guests
Post by: bruce86 on July 09, 2011, 07:58:53 AM
this applies only to the first post and the others? thanks
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on July 09, 2011, 10:20:11 AM
Quote from: Bugo on July 09, 2011, 12:36:15 AM
Unfortunately, the contents of the code tag appears in forum rss feed => guests see it.
Nice catch, will try to see it later tonight.
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on July 11, 2011, 04:47:20 AM
Quote from: Bugo on July 09, 2011, 12:36:15 AM
Unfortunately, the contents of the code tag appears in forum rss feed => guests see it.
Bugo I'm pretty sure that in News.php this function is getting data parsed for rss

function cdata_parse($data, $ns = '')


I might take some time to crack that function, but TBH seems to be a tough task :P.
Title: Re: Hide the content of [code] tags from guests
Post by: bruce86 on July 11, 2011, 04:57:44 AM
no answer? ...:)
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on July 11, 2011, 05:24:16 AM
Quote from: bruce86 on July 09, 2011, 07:58:53 AM
this applies only to the first post and the others? thanks

Quote from: bruce86 on July 11, 2011, 04:57:44 AM
no answer? ...:)
Missed it in hurry :P. It applies to all, i.e first post and all follow up replies.
Title: Re: Hide the content of [code] tags from guests
Post by: Kimmie on September 06, 2011, 09:57:35 PM
Quote from: Joker™ on May 16, 2011, 03:24:13 PM
Quote from: jaisi on May 16, 2011, 03:19:13 PM
Joker bro it is possible to instal both mod  Hide Tag Special and your mod ??
I've not seen that mod yet so not sure whether it will work with this mod or not.


would love to know the answer to this as well. As with the hide tag special, what is seen by guests is simply nothing at all where those tags would normally be and the hide tag mod gives no option (that I am aware of), to display any sort of message to the guest such as "please register to see content" etc and this mod does just that.

(of course for those of us who use the hide tag mod, it would be much easier if that aspect was incorporated into it)  8)
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on October 02, 2011, 03:57:14 AM
Quote from: Kimmie on September 06, 2011, 09:57:35 PM
would love to know the answer to this as well. As with the hide tag special, what is seen by guests is simply nothing at all where those tags would normally be and the hide tag mod gives no option (that I am aware of), to display any sort of message to the guest such as "please register to see content" etc and this mod does just that.

(of course for those of us who use the hide tag mod, it would be much easier if that aspect was incorporated into it)  8)
Ok I've just tested the mod with Hide tag special (http://custom.simplemachines.org/mods/index.php?mod=118) and both seems to be running fine. Can you people tell me detail what is not working for on your side?


Quote from: Bugo on July 09, 2011, 12:36:15 AM
Unfortunately, the contents of the code tag appears in forum rss feed => guests see it.
Bugo does it happen now also, as for me the posts made after installing the mod were able to hide there data on guest mode.
Title: Re: Hide the content of [code] tags from guests
Post by: soulgeek on October 02, 2011, 11:31:32 PM
If this mod hides contents from Guests, then even Spider is Guest, will it hide Content from it also, (Which defeats the Whole Purpose of SEO).

Or is there Bot or Visitor identification mechanism in this Mod?

Will this Mod hide Contnet in just some JS tabs so that Spiders can Read it or something like that? Will it cause any Anti-SEO impact on Our Forum?
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on October 06, 2011, 07:25:15 AM
Quote from: soulgeek on October 02, 2011, 11:31:32 PM
If this mod hides contents from Guests, then even Spider is Guest, will it hide Content from it also, (Which defeats the Whole Purpose of SEO).

Or is there Bot or Visitor identification mechanism in this Mod?
The mod simply hides the codes tag data from guests and as spiders crawls as guests so data must be hidden from them as well.


Quote from: soulgeek on October 02, 2011, 11:31:32 PM
Will this Mod hide Contnet in just some JS tabs so that Spiders can Read it or something like that? Will it cause any Anti-SEO impact on Our Forum?
That is known as clocking and most search engines are deadly against it.
Title: Re: Hide the content of [code] tags from guests
Post by: MarkoKg on September 19, 2012, 04:55:15 PM
Great mod Joker! :)

Can i ask if there's a chance to apply this only in one/few specific boards? I tried to add manually code (if board['id'] = xx...blabla) but it didn't worked for me. Any suggestions? I need code content to be hidden only in 3 boards though, if that's possible by any chance.

Thanks! :)
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on October 03, 2012, 09:08:32 AM
Quote from: MarkoKg on September 19, 2012, 04:55:15 PM
Great mod Joker! :)

Can i ask if there's a chance to apply this only in one/few specific boards? I tried to add manually code (if board['id'] = xx...blabla) but it didn't worked for me. Any suggestions? I need code content to be hidden only in 3 boards though, if that's possible by any chance.

Thanks! :)
Will try to work on it in next version :).
Title: Re: Hide the content of [code] tags from guests
Post by: FragaCampos on March 04, 2013, 04:14:35 PM
Hi, Joker™.

Any news about the board selection method in this mod?

Thanks a lot for this.
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on March 07, 2013, 12:28:00 PM
Noted (https://github.com/Joker-SMF/SMF-Mods/issues/1).

Adding my mods to github, as it is more easy to track issues/features over there, rather than searching them throughout the topics over here.
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on June 30, 2013, 10:04:26 AM
A newer version rolled out. Checkzz outzz :P.
Title: Re: Hide the content of [code] tags from guests
Post by: gomzy on October 24, 2013, 09:28:07 AM
i have tried this mod, it work fine on smf 2.0 but problem is that when i view the most recent articles , it does not work... any fix for that?
Title: Re: Hide the content of [code] tags from guests
Post by: OCJ on November 23, 2013, 05:53:15 AM
I have 1 problem with it. When there is bbcode and links inside the tags it doesn't display properly - just shows all the tags and bbcode directly. Guess nothing can be done about that?

Other than that it works perfectly
Title: Re: Hide the content of [code] tags from guests
Post by: Arantor on November 23, 2013, 11:22:08 AM
Quote from: igirisjin on November 23, 2013, 05:53:15 AM
I have 1 problem with it. When there is bbcode and links inside the tags it doesn't display properly - just shows all the tags and bbcode directly. Guess nothing can be done about that?

Other than that it works perfectly

Um, because that's what the code bbcode does? Designed for posting *code* and therefore negates bbcode...
Title: Re: Hide the content of [code] tags from guests
Post by: llmfit on July 08, 2014, 02:50:25 PM
Quotei have tried this mod, it work fine on smf 2.0 but problem is that when i view the most recent articles , it does not work... any fix for that?
Any news?
Title: Re: Hide the content of [code] tags from guests
Post by: Joker™ on July 13, 2014, 04:35:49 AM
Quote from: llmfit on July 08, 2014, 02:50:25 PM
Quotei have tried this mod, it work fine on smf 2.0 but problem is that when i view the most recent articles , it does not work... any fix for that?
Any news?
Oppss, missed that somehow. Can you provide me a link or point me towards the section where content is still visible :)
Title: Re: Hide the content of [code] tags from guests
Post by: Abhijit1030 on October 03, 2014, 05:25:40 AM
using code tag also in link. can I use hide tag

Using code tag forum looks odd
Title: Re: Hide the content of [code] tags from guests
Post by: llmfit on October 06, 2014, 03:33:47 PM
Please FIX this!
./index.php?action=recent
Content of CODE still visible for everyone in this page regardless of the settings!!!!
Title: Re: Hide the content of [code] tags from guests
Post by: OCJ on October 14, 2014, 12:13:43 AM
QuoteContent of CODE still visible for everyone in this page regardless of the settings!!!!

This should work, I have similar problem with a mod that hides things. It is a very simple code edit.

http://www.simplemachines.org/community/index.php?topic=316841.msg2104330#msg2104330

Title: Re: Hide the content of [code] tags from guests
Post by: vbgamer45 on October 14, 2014, 08:45:45 AM
Thanks igirisjin that is a good tip. Will look into it though also why recent.php for some reason isn't hidding it. I think the issue probably is if the code tag isn't completely shown.
Title: Re: Hide the content of [code] tags from guests
Post by: llmfit on November 04, 2015, 06:31:17 AM
Hi, many users reports that after logging in the forum the content of CODE tag still not visible, as if they are guest. The problem does not occur in all treads but for few number of treads: in particular I noticed that the problem appears when the tread is very very long and when are used a large number of CODE tags. Another thing is that the problem not always occur.

YOU HAVE PM !!

Thx