The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to "hide" a visible section?

View previous topic View next topic Go down

Solved How to "hide" a visible section?

Post by Cesar on March 9th 2014, 5:43 pm

Hello.
How can i hide a section but remaining visible to members?I know you don't understand so i will show you an image .Laughing
When you are a staff member:
When you are a usual member:

Thank you.

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by JScript on March 9th 2014, 6:28 pm

Hello!

We can adapt my code below to what you want, what do you think?
Code:

    $(function() {
        if (document.getElementById('logout') == null) {
            var sCategory = '4';
            $('.main-content:eq(' + sCategory + ')').addClass('protect');
            var sCSS = '<style>' +
                '.protect:after {' +
                    'background: none repeat scroll 0px 0px rgba(255, 255, 255, 0.8);' +
                    'bottom: 0px;' +
                    'content: "Somente membros";' +
                    'font-size: 30px;' +
                    'left: 0px;' +
                    'line-height: 240px;' +
                    'position: absolute;' +
                    'right: 0px;' +
                    'text-align: center;' +
                    'top: 0px;' +
                    'z-index: 10;' +
                '}' +
                '.protect {' +
                    'position: relative;' +
                '}' +
                '</style>';
            document.head.insertAdjacentHTML('beforeEnd', sCSS);
        }
    });

Result:


What do you think?

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 10th 2014, 6:49 pm

Where to add it?Very Happy

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 11th 2014, 1:00 am

It should probably go in :

Administration panel > modules > javascript codes management > create a new script

placement : in the homepage

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 11th 2014, 1:45 pm

I added there but nothing seems to happen. Must i replace something?

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 12th 2014, 1:58 pm

Bump.blackeye

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 13th 2014, 2:08 am

What version forum are you using and which category do you want to protect ?

Also please provide your forumlink.

Thanks :rose:

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 13th 2014, 6:16 am

I was looking in the code so you must replace "sCategory="4" with number of the category.
But when i'm logged i can't see the category.. i see it like a usual member (hided)
Version of forum: punBB
Link : www.vontechs.board.st

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 13th 2014, 8:07 am

Are you using the default logout navlink ?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 13th 2014, 12:29 pm

I think..
"/login?logout" this is the ending of URL.

I see if i modify in the script logout with login it's seems to appear , but when i log out isn't hiding that section.
Maybe is something wrong in the code?

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by kmack13 on March 13th 2014, 11:24 pm

As a suggestion if you don't want want normal members to be able to view something why not just block it completely. As in not letting them know it's there.


Directions To Do So:

Admin Panel -> General -> Categories and Forums -> "Desired Forum(s)" -> Permissions -> Then uncheck everything for guests and members

kmack13
New Member

Posts : 4
Reputation : 1
Language : english

http://supernatural-rp.forumotion.net/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 14th 2014, 6:49 am

Okay, does your logout link have the id logout ?

ex :
Code:
<a id="logout" href="/login?logout=1">Log out</a>

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 14th 2014, 2:48 pm

I'm not sure , Ange. When i click on "Log out" button , yeah appears "/login?logout"..
Kmack , i know how to hide them , but i want this..

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 14th 2014, 9:07 pm

Could you send me a test account ?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 15th 2014, 2:32 pm

Sented.Very Happy

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 15th 2014, 5:58 pm

See if this works :
Code:
        $(function() {
            if (!$('#user_bar a[href="/login?logout"]').length) {
                var sCategory = '3';
                $('.main-content:eq(' + sCategory + ')').addClass('protect');
                var sCSS = '<style>' +
                    '.protect:after {' +
                        'background: none repeat scroll 0px 0px rgba(255, 255, 255, 0.8);' +
                        'bottom: 0px;' +
                        'content: "Somente membros";' +
                        'font-size: 30px;' +
                        'left: 0px;' +
                        'line-height: 240px;' +
                        'position: absolute;' +
                        'right: 0px;' +
                        'text-align: center;' +
                        'top: 0px;' +
                        'z-index: 10;' +
                    '}' +
                    '.protect {' +
                        'position: relative;' +
                    '}' +
                    '</style>';
                document.head.insertAdjacentHTML('beforeEnd', sCSS);
            }
        });

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Cesar on March 15th 2014, 7:36 pm

You're the best.
Thank you very much!
This topic is solved.

Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: How to "hide" a visible section?

Post by Ange Tuteur on March 15th 2014, 8:17 pm

You're welcome :rose:

Topic solved and archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum