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.

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

View previous topic View next topic Go down

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

Post by PE!N on November 30th 2012, 10:13 am


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 on November 30th 2012, 10: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
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 on November 30th 2012, 10: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

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 on November 30th 2012, 10: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
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 on November 30th 2012, 12:21 pm

no change Mad

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 on November 30th 2012, 1:31 pm

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


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 on December 1st 2012, 11: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
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 on December 2nd 2012, 11: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 .. thanx

PE!N
Forumember

Posts : 81
Reputation : 1
Language : english - arabic

http://www.ibri.hooxs.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