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 can I hide forum categories from guests like this?

View previous topic View next topic Go down

Solved How can I hide forum categories from guests like this?

Post by Van-Helsing on May 15th 2014, 1:12 pm

Hi dear all,
How can I hide some forum categories from guests like this http://prntscr.com/3je8uq ?

Best Regards,
Dark-Avenger


Last edited by Dark-Avenger on May 17th 2014, 12:54 am; edited 1 time in total

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by J0k3R^ on May 15th 2014, 1:42 pm

Thats a good question, id ask the same but i lost the link from this forum Smile lets wait

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Pizza Boi on May 15th 2014, 2:56 pm

Hi Very Happy

Check JScript's profile, he distributed his code for that I love you

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 2:27 pm

Hi all,
Ok I found the codes for PunBB

Javascript: [In the homepage]

Code:

$(function() {
if (document.getElementById('logout') == null) {
var sCategory = 'POSITION OF THE CATEGORY';
$('.main-content:eq(' + sCategory + ')').addClass('hanckiprotected');
}
});

CSS:
Code:

        .hanckiprotected:after {
              background: none repeat scroll 0px 0px rgba(255, 255, 255, 0.7);
              bottom: 0px;
              content: "Forum Protected";
              font-size: 30px;
              left: 0px;
              line-height: 310px;
              position: absolute;
              right: 0px;
              text-align: center;
              top: 0px;
              z-index: 10;
        }
        .hanckiprotected {
              position: relative;
        }

How can I add multiple categories?

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by J0k3R^ on May 16th 2014, 2:54 pm

Just copy the same js but change the category id.
<i>what did u put in 'position of category??</i>

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 7:14 pm

I think if i copy-paste the js code it should be reaches the request limit due firing the server port but I am not sure for that. I think the better solution is to declare the sCategory variable as an array. In the number just put the number of forum category by start count them from the beginning the categories.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by J0k3R^ on May 16th 2014, 7:23 pm

I want to hide my second category. I tried these codes but didnt work. I put "/c2" ...

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 9:38 pm


Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by J0k3R^ on May 16th 2014, 9:42 pm

yeah..
if u type myplanet.forumgreek.com/c2-category
u see its the correct link but the codes from SocialAcademy arent working for me :S

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 9:44 pm

So modify the js like this:

Code:

$(function() {
if (document.getElementById('logout') == null) {
var sCategory = '2';
$('.main-content:eq(' + sCategory + ')').addClass('hanckiprotected');
}
});

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by J0k3R^ on May 16th 2014, 10:48 pm

Good Smile
now its working but its getting 'hidden' when im logged in aswell :S

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 11:13 pm

Are you sure? Probably another js conflict it. I try it on my forum and its working. Try to clear the cookies on your browser.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Luffy on May 16th 2014, 11:22 pm

To me also works fine. Probably its an other js making the error to you Jok3R^






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by Van-Helsing on May 16th 2014, 11:33 pm

Try to check your js console for errors or warnings in js.
Ok I found how to protect more than one forum categories.
Problem solved.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I hide forum categories from guests like this?

Post by SLGray on May 17th 2014, 12:57 am

Topic Solved & Archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36751
Reputation : 2449
Language : English
Location : United States

http://ztwds.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