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

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

    Bedlam
    Bedlam
    Forumember


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

    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
    avatar
    meelad_sd
    Forumember


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

    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;
            });
    Bedlam
    Bedlam
    Forumember


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

    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~
    avatar
    meelad_sd
    Forumember


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

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

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

    np ^^
    SLGray
    SLGray
    Administrator
    Administrator


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

    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.

      Current date/time is September 22nd 2024, 8:26 pm