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 Thu May 15, 2014 12: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 Fri May 16, 2014 11:54 pm; edited 1 time in total
avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Thu May 15, 2014 12:42 pm

Thats a good question, id ask the same but i lost the link from this forum Smile lets wait
avatar
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 Thu May 15, 2014 1:56 pm

Hi Very Happy

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

Regards,
Pizza Boi
avatar
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 Fri May 16, 2014 1: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?
avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 1:54 pm

Just copy the same js but change the category id.
<i>what did u put in 'position of category??</i>
avatar
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 Fri May 16, 2014 6: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.
avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 6:23 pm

I want to hide my second category. I tried these codes but didnt work. I put "/c2" ...
avatar
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 Fri May 16, 2014 8:38 pm

avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 8: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
avatar
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 Fri May 16, 2014 8:44 pm

So modify the js like this:

Code:

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

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 9:48 pm

Good Smile
now its working but its getting 'hidden' when im logged in aswell :S
avatar
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 Fri May 16, 2014 10: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.
avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 10:22 pm

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





avatar
Luffy
Manager
Manager

Male Posts : 4478
Reputation : 453
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 Fri May 16, 2014 10: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.
avatar
Van-Helsing
Hyperactive

Male Posts : 2261
Reputation : 85
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 Fri May 16, 2014 11:57 pm

Topic Solved & Archived


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

avatar
SLGray
Administrator
Administrator

Male Posts : 38228
Reputation : 2576
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