background based on gender?
5 posters
Page 1 of 1
background based on gender?
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.
is it this code here ?
and do i put all this in CSS stylesheet ?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
hey mate thxs for get in back to me. ok i did all that u said and it dont work
do i need to just put phpbb2 were u said ?
do i need to just put phpbb2 were u said ?
BL@DE- Forumember
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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:
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.
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.
Re: background based on gender?
ok i have done all u said man still not work in.
i have put all this in Javascript.
and i have put all this code in to CSS stylesheet tab.
and it dont work. what am i not doing right ? how hard can this be lol ?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
Do you have any other JavaScript codes that effect topics?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
i am put in this code in CSS stylesheet.
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.
and it still not work in. what do u think i am doing wrong ?
- 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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
ok mate i have done that and still not work in. i have Profile and Messages displayed.
BL@DE- Forumember
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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.
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
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
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
Could it be because some members have not chosen a gender?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: background based on gender?
i have done it. thxs so much for the help u to are the best.
BL@DE- Forumember
- Posts : 161
Reputation : 10
Language : English
Location : England
Re: background based on gender?
Topic Solved & Locked |
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Similar topics
» New tip : Change the background in function of the gender of the poster
» Change the background in function of the gender of the poster
» Scaling Widget Background Image Based on Widget Size/User Resolution
» Change the background in function of the gender of the poster - phpbb2
» Change the background in function of the gender of the poster, Problem
» Change the background in function of the gender of the poster
» Scaling Widget Background Image Based on Widget Size/User Resolution
» Change the background in function of the gender of the poster - phpbb2
» Change the background in function of the gender of the poster, Problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum