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.

Switch user page out with a html page

View previous topic View next topic Go down

Solved Switch user page out with a html page

Post by IdaTR on February 12th 2015, 7:07 pm

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.

IdaTR
Forumember

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

http://nionevrien.forumq.net/

Back to top Go down

Solved Re: Switch user page out with a html page

Post by Ikerepc on February 12th 2015, 7:34 pm

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

Ikerepc
Active Poster

Male Posts : 1114
Reputation : 152
Language : Croatian, HTML, CSS, jQuery, JavaScript, PHP, SQL, Bascom, Python, C, FBD & LAD for PLC and more... Little English :D
Location : Around electronics and progmamming ;)

http://help.forumotion.com

Back to top Go down

Solved Re: Switch user page out with a html page

Post by IdaTR on February 12th 2015, 8:13 pm

Yup!

IdaTR
Forumember

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

http://nionevrien.forumq.net/

Back to top Go down

Solved Re: Switch user page out with a html page

Post by Ange Tuteur on February 12th 2015, 8:45 pm

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.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Switch user page out with a html page

Post by IdaTR on February 12th 2015, 8:55 pm

Works perfectly!! thx!!

IdaTR
Forumember

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

http://nionevrien.forumq.net/

Back to top Go down

Solved Re: Switch user page out with a html page

Post by Ange Tuteur on February 12th 2015, 8:59 pm

You're welcome Smile

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.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