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
4 posters

    Hide links in code from guest?

    avatar
    bedazzled
    New Member


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Hide links in code from guest?

    Post by bedazzled August 6th 2014, 8:38 am

    My englesh is not so good Sad I understand and know how to read English, but I do not know grammar and writing very well  Wink So,my problem its... How to hide links in code tags,For example url links from guests? I put it in the control panel links can only be seen by members and visitors again see the this links? I use a version of phpbb2! If you need somewhere to put the script please clarify it easier because I'm new at this  Embarassed
    And how do I remove the text from sticky and Global announcement???


    My forum adress: http://bedazzledupload.serbianforum.info/


    Last edited by bedazzled on August 6th 2014, 9:28 am; edited 1 time in total
    SLGray
    SLGray
    Administrator
    Administrator


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

    In progress Re: Hide links in code from guest?

    Post by SLGray August 6th 2014, 8:50 am

    You will need to use the hide tags.



    Hide links in code from guest? Slgray10

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


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Re: Hide links in code from guest?

    Post by bedazzled August 6th 2014, 9:26 am

    I've tried hiding it but then they do not see for registered members? How should I put the url link? Maybe I'm mistaken here?





    Code:
    [hide]Url link[/hide]

    or?
    Japorized
    Japorized
    Forumember


    Male Posts : 310
    Reputation : 3
    Language : English
    Location : Malaysia

    In progress Re: Hide links in code from guest?

    Post by Japorized August 6th 2014, 11:50 am

    Code:
    <!-- BEGIN switch_user_logged_in -->
    Put in code that you wish to hide from guests here. This tag actually means that it's only visible to logged-in users.
    <!-- END switch_user_logged_in -->

    Put this code in your template and it should work like a charm. Very Happy
    avatar
    bedazzled
    New Member


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Re: Hide links in code from guest?

    Post by bedazzled August 6th 2014, 5:34 pm

    I want to not see any link to the forum! Since I do not know where exactly to copy this code... Whether you can tell me where exactly do I copy this? I'm sorry but I have no idea where to go, I just started to learn this...
    Japorized
    Japorized
    Forumember


    Male Posts : 310
    Reputation : 3
    Language : English
    Location : Malaysia

    In progress Re: Hide links in code from guest?

    Post by Japorized August 6th 2014, 11:03 pm

    You're actually wanting to hide links that are posted by your users in posts right?
    avatar
    bedazzled
    New Member


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Re: Hide links in code from guest?

    Post by bedazzled August 6th 2014, 11:23 pm

    No. Only my links that can not be seen! That's what I want!
    SLGray
    SLGray
    Administrator
    Administrator


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

    In progress Re: Hide links in code from guest?

    Post by SLGray August 7th 2014, 2:49 am

    So you want only the links you posted to be hidden?



    Hide links in code from guest? Slgray10

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


    Male Posts : 310
    Reputation : 3
    Language : English
    Location : Malaysia

    In progress Re: Hide links in code from guest?

    Post by Japorized August 7th 2014, 5:28 am

    Hmm... If so, then you can try this.
    Every time you post a certain link, add a class to it, like this.
    Code:
    <a href="url" class="your_class">Link</a>

    Then add this to your javascript. Unselect all the placements, as we will be grabbing the link of the js manually.
    Code:
    $(document).ready(function(){
    $('.your_class').parent().append('You must be logged in to view this link.').end().remove();
    });

    Then add this to your overall_header template.
    Code:
    <!-- BEGIN switch_user_logged_out -->
    <script type="text/javascript" src="JS_LINK_HERE" />
    <!-- END switch_user_logged_out -->

    This would make the javascript file be loaded and ran if the user isn't logged in.
    It should now hide your link every time but you'll have to remember adding that particular class to it.
    This also has another advantage. If you decide that you can publish the link for guests, then just don't add in the class.
    SSYT
    SSYT
    Forumember


    Male Posts : 77
    Reputation : 15
    Language : RO-10, EN-3, FR-1
    Location : Romania

    In progress Re: Hide links in code from guest?

    Post by SSYT August 7th 2014, 3:17 pm

    try my code Wink
    Code:
    jQuery(function(a){
      msg = 'Your guest message ! \b You have a not logged account !';
      if(_userdata.session_logged_in == '0')
          return a('.codebox dd code').html(msg);
    });
    avatar
    bedazzled
    New Member


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Re: Hide links in code from guest?

    Post by bedazzled August 9th 2014, 8:18 pm

    Tell me exactly where to put this? Because I do not understand where that to copy?
    SLGray
    SLGray
    Administrator
    Administrator


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

    In progress Re: Hide links in code from guest?

    Post by SLGray August 10th 2014, 10:13 am

    Administration Panel > Modules > HTML/JavaScript > JavaScript Management
    Make sure that it is activated.



    Hide links in code from guest? Slgray10

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


    Posts : 15
    Reputation : 1
    Language : Serbian,English

    In progress Re: Hide links in code from guest?

    Post by bedazzled August 13th 2014, 4:25 pm

    Not working  Confused   How to: only registered users can see all forum???

    And how to have like this scrolling widget???


    Hide links in code from guest? Untitl10

      Current date/time is November 11th 2024, 2:24 pm