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

    Deactivate link in contact fields

    Hert
    Hert
    Forumember


    Posts : 81
    Reputation : 3
    Language : Dutch and English

    Solved Deactivate link in contact fields

    Post by Hert September 5th 2015, 3:23 pm

    Hello,

    I've posted a question before that was solved: https://help.forumotion.com/t141861-is-it-possible-for-the-user-to-put-an-image-in-the-contact-field
    However, there have been some complains about something regards this option: if one clicks on the image that is put in it will link them to a page where only the image is shown (the URL of the image I guess).
    I was wondering if this could be somehow disabled or if it's even possible to let it link to the user in question profile's?

    Greetings,
    Hert


    (I will tagg @Ange Tuteur, since you helped me in the previous topic so maybe you already know the answer ^^)


    Last edited by Hert on September 5th 2015, 6:46 pm; edited 1 time in total
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Deactivate link in contact fields

    Post by brandon_g September 5th 2015, 3:39 pm

    Hello,

    I do not think there is a way to do this via the default options in the ACP.

    Have you removed the image itself from that profile field yet?

    -Brandon



    Deactivate link in contact fields Brando10
    Remember to mark your topic Deactivate link in contact fields Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Deactivate link in contact fields Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Deactivate link in contact fields

    Post by Ange Tuteur September 5th 2015, 3:43 pm

    Hi @Hert,

    Replace your script with this :
    Code:
    $(function() {
      for (var a = document.getElementsByTagName('A'), i = 0, j = a.length, c; i < j; i++) {
        c = a[i].firstChild;
        if (c && c.tagName == 'IMG' && a[i].href == c.alt) {
          c.src = c.alt;
          c.className += ' contactImage';
         
          a[i].href = '';
          a[i].onclick = function(e) { e.preventDefault() };
        }
      }
    });

    It'll remove the link URL, and should prevent any clicking events that normally occur. Smile
    Hert
    Hert
    Forumember


    Posts : 81
    Reputation : 3
    Language : Dutch and English

    Solved Re: Deactivate link in contact fields

    Post by Hert September 5th 2015, 6:46 pm

    Yes it worked, thank you very much!

    This is solved now :>
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: Deactivate link in contact fields

    Post by SLGray September 5th 2015, 7:42 pm

    Topic solved and archived



    Deactivate link in contact fields Slgray10

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

      Current date/time is November 11th 2024, 9:34 pm