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.

Adding a background onto a specific member's profile page.

3 posters

Go down

Solved Adding a background onto a specific member's profile page.

Post by Bedlam May 28th 2015, 11:57 pm

Hi so I recently discovered this code to add a background onto a specific member's page:

Code:
jQuery(document).ready(function(){
        if(window.location.pathname.indexOf("/u68")!==-1){
    jQuery('<style>body{background: url("http://media.tumblr.com/6233adc1e97adcc10105f1988b8a2465/tumblr_inline_mns3reYdBr1qz4rgp.gif"); </style>').appendTo(document.head);
        } else return;
        });

It works like a charm, except there are a lot of members on my forum so instead of adding it just to user68 it's adding it to user 681, 682, 683 etc

How do you make it only add it to user 68?

Thank you


http://www.gasrforum.com/


Last edited by Bedlam on May 29th 2015, 12:24 am; edited 1 time in total
Bedlam
Bedlam
Forumember

Female Posts : 62
Reputation : 4
Language : English
Location : Canada

http://www.gasrforum.com/

Back to top Go down

Solved Re: Adding a background onto a specific member's profile page.

Post by meelad_sd May 29th 2015, 12:17 am

change this:
Code:

if(window.location.pathname.indexOf("/u68")!==-1)
to this:
Code:

if (window.location.pathname == "/u68")

So:

Code:

jQuery(document).ready(function(){
        if(window.location.pathname == "/u68"){
    jQuery('<style>body{background: url("http://media.tumblr.com/6233adc1e97adcc10105f1988b8a2465/tumblr_inline_mns3reYdBr1qz4rgp.gif"); </style>').appendTo(document.head);
        } else return;
        });
avatar
meelad_sd
Forumember

Posts : 50
Reputation : 13
Language : English, Swedish, Assyrian, Arabic

http://www.exhclan.com/

Back to top Go down

Solved Re: Adding a background onto a specific member's profile page.

Post by Bedlam May 29th 2015, 12:23 am

Wow thank you so much!! It really was that easy I just couldn't figure it out~
Bedlam
Bedlam
Forumember

Female Posts : 62
Reputation : 4
Language : English
Location : Canada

http://www.gasrforum.com/

Back to top Go down

Solved Re: Adding a background onto a specific member's profile page.

Post by meelad_sd May 29th 2015, 12:26 am

np ^^
avatar
meelad_sd
Forumember

Posts : 50
Reputation : 13
Language : English, Swedish, Assyrian, Arabic

http://www.exhclan.com/

Back to top Go down

Solved Re: Adding a background onto a specific member's profile page.

Post by SLGray May 29th 2015, 4:11 am

Topic solved and archived


Adding a background onto a specific member's profile page. Slgray10

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

Male Posts : 51463
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum