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.

background based on gender?

View previous topic View next topic Go down

Solved background based on gender?

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

hello all i need a hand doing this. http://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

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

You have to put your version where I have indicated...


and yes, just add that code you have to the bottom of your CSS...

The Lone Ranger
Forumember

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

http://www.tenerifesforumoffun.com

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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 ?

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by The Lone Ranger on 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.


The Lone Ranger
Forumember

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

http://www.tenerifesforumoffun.com

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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 ?

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

What can I say? I've done exactly what I said and I get this...

The Lone Ranger
Forumember

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

http://www.tenerifesforumoffun.com

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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 ?

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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 ?

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

Do you have any other JavaScript codes that effect topics?


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


SLGray
Administrator
Administrator

Male Posts : 36673
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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.

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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 ?


BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

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


BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by runawayhorses on 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.

runawayhorses
Hyperactive

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

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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.

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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");
  }
});

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

Post by BL@DE on 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.

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

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


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


SLGray
Administrator
Administrator

Male Posts : 36673
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: background based on gender?

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

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

BL@DE
Forumember

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

Back to top Go down

Solved Re: background based on gender?

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

Topic Solved & Locked

Sanket
ForumGuru

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

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