background based on gender? 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.
5 posters

    background based on gender?

    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved background based on gender?

    Post by BL@DE February 17th 2013, 12:32 pm

    hello all i need a hand doing this. https://help.forumotion.com/t115828-change-the-background-in-function-of-the-gender-of-the-poster#757421

    what bit of code do i put in here Javascript i have a phpbb2 site.

    Code:

    $(function() {
     
      //Indicate here the version of your forum.
      var version = "phpBB3";
     
      if(version.toLowerCase() == "phpbb2"){ 
          $(".postdetails img[title='Male']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xy");
          $(".postdetails img[title='Female']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xx");
      }else if(version.toLowerCase() == "phpbb3"){ 
          $(".postprofile img[title='Male']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "punbb"){ 
          $(".user-info img[title='Male']").closest('.postmain').addClass("fa_postbody_xy");
          $(".user-info img[title='Female']").closest('.postmain').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "invision"){       
          $(".postprofile img[title='Male']").closest('.post-container').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.post-container').addClass("fa_postbody_xx");
      }
    });

    is it this code here ?

    Code:
    (version.toLowerCase() == "phpbb2"){ 
          $(".postdetails img[title='Male']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xy");
          $(".postdetails img[title='Female']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xx");

    and do i put all this in CSS stylesheet ?

    Code:

    .fa_postbody_xy{
      background: url("http://i45.servimg.com/u/f45/17/45/19/77/xy10.png");
    min-height: 500px;
    }
     
    .fa_postbody_xx {
      background: url("http://i45.servimg.com/u/f45/17/45/19/77/xx10.png");
    min-height: 500px;
    }


    Last edited by BL@DE on February 19th 2013, 1:04 am; edited 1 time in total
    The Lone Ranger
    The Lone Ranger
    Forumember


    Male Posts : 443
    Reputation : 37
    Language : English
    Location : Scotland

    Solved Re: background based on gender?

    Post by The Lone Ranger February 17th 2013, 1:50 pm

    You have to put your version where I have indicated...
    background based on gender? Captur13

    and yes, just add that code you have to the bottom of your CSS...
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 17th 2013, 4:08 pm

    hey mate thxs for get in back to me. ok i did all that u said and it dont work Sad

    do i need to just put phpbb2 were u said ?
    The Lone Ranger
    The Lone Ranger
    Forumember


    Male Posts : 443
    Reputation : 37
    Language : English
    Location : Scotland

    Solved Re: background based on gender?

    Post by The Lone Ranger February 17th 2013, 4:50 pm

    Yeah, just put phpbb2 where it shows on my screenshot.

    I'll try to walk you through it but I'm using Invision so it might be slightly different.

    To put the code into Javascript, go to: AP>Modules>HTML & Javascript>Javascript codes management. Enable Javascript code management: "Yes". "Save". Click on "Create a new Javascript" button.

    Next, for "Title" Call it "Gender change" or something.

    Next, for "Placement" click "In the Topics".

    Now, paste the Javascript code, (the one you put phpbb2 into), into the Javascript code box and hit "Submit".

    That's you done here. Go to AP>Display>Pics & Colours>Colours. CSS stylesheet tab.

    Scroll down to the bottom of your CSS and add this part:
    Code:

        .fa_postbody_xy{
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xy10.png");
        min-height: 500px;
        }
       
        .fa_postbody_xx {
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xx10.png");
        min-height: 500px;
        }

    Click on the "Submit" button and that should be it.

    You can change the images to anything you want by changing the URLs in the CSS you just added and replace them with your own. The ones that are there just now will show the background pictures in the tutorial.

    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 17th 2013, 9:50 pm

    ok i have done all u said man still not work in.

    i have put all this in Javascript.

    Code:

    $(function() {
     
      //Indicate here the version of your forum.
      var version = "phpBB2";
     
      if(version.toLowerCase() == "phpbb2"){ 
          $(".postdetails img[title='Male']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xy");
          $(".postdetails img[title='Female']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xx");
      }else if(version.toLowerCase() == "phpbb3"){ 
          $(".postprofile img[title='Male']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "punbb"){ 
          $(".user-info img[title='Male']").closest('.postmain').addClass("fa_postbody_xy");
          $(".user-info img[title='Female']").closest('.postmain').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "invision"){       
          $(".postprofile img[title='Male']").closest('.post-container').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.post-container').addClass("fa_postbody_xx");
      }
    });

    and i have put all this code in to CSS stylesheet tab.

    Code:
    .fa_postbody_xy{
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xy10.png");
        min-height: 500px;
        }
       
        .fa_postbody_xx {
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xx10.png");
        min-height: 500px;
        }

    and it dont work. what am i not doing right ? how hard can this be lol ?
    The Lone Ranger
    The Lone Ranger
    Forumember


    Male Posts : 443
    Reputation : 37
    Language : English
    Location : Scotland

    Solved Re: background based on gender?

    Post by The Lone Ranger February 17th 2013, 10:27 pm

    What can I say? I've done exactly what I said and I get this...
    background based on gender? Captur15
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 18th 2013, 1:14 am

    i dont no then The Lone Ranger. but thxs for the help mate. and Rideem3 yes it is. i just dont get y this is not work in. and do i have to put the full code in JavaScript ?
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 18th 2013, 1:47 am

    it is here is the link to my forum. http://ws-clan.forumcanadien.org/ . can u log in as me and have a look if i pm u my name and pw ?
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: background based on gender?

    Post by SLGray February 18th 2013, 3:12 am

    Do you have any other JavaScript codes that effect topics?



    background based on gender? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 18th 2013, 11:49 am

    no i dont. i went on my test forum as well and i can not get it work in on there to.
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 18th 2013, 9:10 pm

    i am put in this code in CSS stylesheet.

    Code:
    .fa_postbody_xy{
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xy10.png");
        min-height: 500px;
        }
       
        .fa_postbody_xx {
          background: url("http://i45.servimg.com/u/f45/17/45/19/77/xx10.png");
        min-height: 500px;
        }

    yes i am put in 'Use in topics' is that all i need to put that one 'Use in topics' ? and i am put in this code in Javascript.

    Code:

    $(function() {
     
      //Indicate here the version of your forum.
      var version = "phpbb2";
     
      if(version.toLowerCase() == "phpbb2"){ 
          $(".postdetails img[title='Male']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xy");
          $(".postdetails img[title='Female']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xx");
      }else if(version.toLowerCase() == "phpbb3"){ 
          $(".postprofile img[title='Male']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "punbb"){ 
          $(".user-info img[title='Male']").closest('.postmain').addClass("fa_postbody_xy");
          $(".user-info img[title='Female']").closest('.postmain').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "invision"){       
          $(".postprofile img[title='Male']").closest('.post-container').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.post-container').addClass("fa_postbody_xx");
      }
    });

    and it still not work in. what do u think i am doing wrong ?

    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 19th 2013, 12:01 am

    ok mate i have done that and still not work in. i have Profile and Messages displayed.

    avatar
    runawayhorses
    Hyperactive


    Male Posts : 2537
    Reputation : 166
    Language : English
    Location : United States

    Solved Re: background based on gender?

    Post by runawayhorses February 19th 2013, 12:04 am

    Edit the "Gender" section and make sure its set to display in the profile and messages. Click that yellow round circle next to gender to edit that field.
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 19th 2013, 12:12 am

    i have mate. i have ticked Profile and Messages. and save it. and still not work in if u go on my forum and look in Visitors and Guests Area u will see what it as done i just have the male image next to Posts: 168. that it have i not done this right ? i need some one to log in as me and look for me.
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 19th 2013, 12:29 am

    can u please edit the code for me as i dont no what u mean as i am new to this code in stuff.

    Code:
    $(function() {
     
      //Indicate here the version of your forum.
      var version = "phpbb2";
     
      if(version.toLowerCase() == "phpbb2"){ 
          $(".postdetails img[title='Male']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xy");
          $(".postdetails img[title='Female']").closest('.postdetails').parent('td').next('td').addClass("fa_postbody_xx");
      }else if(version.toLowerCase() == "phpbb3"){ 
          $(".postprofile img[title='Male']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.postprofile').prev('.postbody').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "punbb"){ 
          $(".user-info img[title='Male']").closest('.postmain').addClass("fa_postbody_xy");
          $(".user-info img[title='Female']").closest('.postmain').addClass("fa_postbody_xx"); 
      }else if(version.toLowerCase() == "invision"){       
          $(".postprofile img[title='Male']").closest('.post-container').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.post-container').addClass("fa_postbody_xx");
      }
    });
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 19th 2013, 12:41 am

    ok got it work in on my test site. thxs for the help. now i just need to no y it not work in on my site be a code like u just said.
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: background based on gender?

    Post by SLGray February 19th 2013, 2:26 am

    Could it be because some members have not chosen a gender?



    background based on gender? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: background based on gender?

    Post by BL@DE February 19th 2013, 9:02 am

    i have done it. thxs so much for the help Very Happy u to are the best.
    Sanket
    Sanket
    ForumGuru


    Male Posts : 48766
    Reputation : 2830
    Language : English
    Location : Mumbai

    Solved Re: background based on gender?

    Post by Sanket February 19th 2013, 9:28 am

    Topic Solved & Locked