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.

Change the background in function of the gender of the poster - phpbb2

3 posters

Go down

Solved Change the background in function of the gender of the poster - phpbb2

Post by PE!N Fri Nov 30, 2012 9:13 am

PE!N
PE!N
Forumember

Posts : 81
Reputation : 1
Language : english - arabic

http://www.ibri.hooxs.com

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by Kaizer Lee Fri Nov 30, 2012 9:27 am

Alright, let's do this:

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");
  }
});

Put this in ACP < Modules < Javascript Management < Enable Javascript < Save < Create a New Javascript < Title it anything you want < Check: In all Topics < Paste the provided code above < Save

Also in this code in the one given above:

Code:
  //Indicate here the version of your forum.
  var version = "phpBB3";

Change it to this:

Code:
  //Indicate here the version of your forum.
  var version = "phpBB2";

And lastly:

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;
}

ACP < Display < Colors < CSS < Paste the code anywhere < Save
Kaizer Lee
Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by PE!N Fri Nov 30, 2012 9:49 am

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() == "phpbb2"){
          $(".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() == "phpbb2"){
          $(".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() == "phpbb2"){     
          $(".postprofile img[title='Male']").closest('.post-container').addClass("fa_postbody_xy");
          $(".postprofile img[title='Female']").closest('.post-container').addClass("fa_postbody_xx");
      }
    });

not working Change the background in function of the gender of the poster - phpbb2 465297
PE!N
PE!N
Forumember

Posts : 81
Reputation : 1
Language : english - arabic

http://www.ibri.hooxs.com

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by Kaizer Lee Fri Nov 30, 2012 9:51 am

Eh... you changed everything to phpBB2...

Try this one instead:

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");
  }
});
Kaizer Lee
Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by PE!N Fri Nov 30, 2012 11:21 am

no change Mad
PE!N
PE!N
Forumember

Posts : 81
Reputation : 1
Language : english - arabic

http://www.ibri.hooxs.com

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by Kaizer Lee Fri Nov 30, 2012 12:31 pm

The error in this might be affecting that Javascript code provided:

Change the background in function of the gender of the poster - phpbb2 8XmSK
Kaizer Lee
Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by nextlevelgaming Sat Dec 01, 2012 10:01 pm

To change the background you can use my tutorial located here

http://easybbtutorials.forumotion.com/t10-post-background-effect

just edited this to include by gender. Sorry for that, I thought we had that already. All fixed now.

open for guest so its not advertising, and the full code is there
nextlevelgaming
nextlevelgaming
Forumember

Male Posts : 989
Reputation : 38
Language : English|CSS|HTML5|javascript|
Location : New York

http://www.easybbtutorials.forumotion.com

Back to top Go down

Solved Re: Change the background in function of the gender of the poster - phpbb2

Post by PE!N Sun Dec 02, 2012 10:15 pm

Rideem3 wrote:Question, do you have a heavily modified view topic body template? If you do, then that could be the reason why it's not working.

i guess that the reason .. thanxChange the background in function of the gender of the poster - phpbb2 306531
PE!N
PE!N
Forumember

Posts : 81
Reputation : 1
Language : english - arabic

http://www.ibri.hooxs.com

Back to top Go down

Back to top

- Similar topics

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