Switch user page out with a html page Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
3 posters

    Switch user page out with a html page

    IdaTR
    IdaTR
    Forumember


    Female Posts : 547
    Reputation : 1
    Language : Danish, english
    Location : Denmark

    Solved Switch user page out with a html page

    Post by IdaTR February 13th 2015, 6:07 am

    Hellow!

    I'm currently making a html page for my roleplay character on my website, but i was wondering, if it was possible for people who clicked on my userlink were transferred to the html page link instead?

    I haven't heard anyone doing this before. So i was just wondering if might be possible.
    Ikerepc
    Ikerepc
    Active Poster


    Male Posts : 1187
    Reputation : 167
    Language : Who cares...
    Location : Where web help & support is needed

    Solved Re: Switch user page out with a html page

    Post by Ikerepc February 13th 2015, 6:34 am

    You mean when you click on your username url what usually lead to your profile?
    IdaTR
    IdaTR
    Forumember


    Female Posts : 547
    Reputation : 1
    Language : Danish, english
    Location : Denmark

    Solved Re: Switch user page out with a html page

    Post by IdaTR February 13th 2015, 7:13 am

    Yup!
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Switch user page out with a html page

    Post by Ange Tuteur February 13th 2015, 7:45 am

    Hello @IdaTR,

    Should be possible with some JavaScript. Go to Administration Panel > Modules > JavaScript codes management > Create a new script

    Placement : In all the pages
    Paste the code below :
    Code:
    $(function() {
      changeURL('/u1', '/h1-');
      changeURL('/u2', '/h2-');
      changeURL('/u3', '/h3-');
     
      function changeURL(url,newurl){$('a[href="'+url+'"]').attr('href',newurl)}
    });

    I have 3 examples by default in the script, you can remove or modify them. Here's an explanation :

    It basically changes the old url with the new one you supply. You write it as : changeURL('OLD URL', 'NEW URL')

    OLD URL : The URL of the link you want to replace. e.g. /u1, /u2, /u3
    NEW URL : The new URL that replaces the old one.

    You can paste the same thing in the script above as much as you want.
    IdaTR
    IdaTR
    Forumember


    Female Posts : 547
    Reputation : 1
    Language : Danish, english
    Location : Denmark

    Solved Re: Switch user page out with a html page

    Post by IdaTR February 13th 2015, 7:55 am

    Works perfectly!! thx!!
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Switch user page out with a html page

    Post by Ange Tuteur February 13th 2015, 7:59 am

    You're welcome Smile

    Topic archived