The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
5 posters

    How can I hide forum categories from guests like this?

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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
    J0k3R^
    J0k3R^
    Forumember


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

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

    Post by J0k3R^ 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
    Pizza Boi
    Pizza Boi
    Hyperactive


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

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

    Post by Pizza Boi 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
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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?
    J0k3R^
    J0k3R^
    Forumember


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

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

    Post by J0k3R^ 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>
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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.
    J0k3R^
    J0k3R^
    Forumember


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

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

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

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


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

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

    J0k3R^
    J0k3R^
    Forumember


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

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

    Post by J0k3R^ 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
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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');
    }
    });
    J0k3R^
    J0k3R^
    Forumember


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

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

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

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


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

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

    Post by TheCrow May 16th 2014, 11:22 pm

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



    How can I hide forum categories from guests like this? Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

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

    Post by Van-Helsing 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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

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

    Topic Solved & Archived



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

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

      Current date/time is September 22nd 2024, 8:18 pm