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.
The forum of the forums
3 posters

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

    PE!N
    PE!N
    Forumember


    Posts : 81
    Reputation : 1
    Language : english - arabic

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

    Post by PE!N 30/11/2012, 10:13

    Kaizer Lee
    Kaizer Lee
    Active Poster


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

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

    Post by Kaizer Lee 30/11/2012, 10:27

    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
    PE!N
    PE!N
    Forumember


    Posts : 81
    Reputation : 1
    Language : english - arabic

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

    Post by PE!N 30/11/2012, 10:49

    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
    Kaizer Lee
    Kaizer Lee
    Active Poster


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

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

    Post by Kaizer Lee 30/11/2012, 10:51

    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");
      }
    });
    PE!N
    PE!N
    Forumember


    Posts : 81
    Reputation : 1
    Language : english - arabic

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

    Post by PE!N 30/11/2012, 12:21

    no change Mad
    Kaizer Lee
    Kaizer Lee
    Active Poster


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

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

    Post by Kaizer Lee 30/11/2012, 13:31

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

    Change the background in function of the gender of the poster - phpbb2 8XmSK
    nextlevelgaming
    nextlevelgaming
    Forumember


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

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

    Post by nextlevelgaming 1/12/2012, 23:01

    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
    PE!N
    PE!N
    Forumember


    Posts : 81
    Reputation : 1
    Language : english - arabic

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

    Post by PE!N 2/12/2012, 23:15

    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

      Current date/time is 23/9/2024, 11:19