1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Gender Message Indicators [Deleted]

Discussion in 'Template Modifications' started by John L., Sep 27, 2012.

  1. John L.

    John L. Well-Known Member

    LP-John submitted a new resource:

    Gender Message Indicators (version 1.0) - Add gender icons to your name in message and change the color of the message bit.

    Read more about this resource...
     
    aiman.h.kallaf and Adam Howard like this.
  2. aiman.h.kallaf

    aiman.h.kallaf Active Member

    look very nice but would this add any queries
     
  3. Adam Howard

    Adam Howard Well-Known Member

    None that I can tell. This is only a template edit.

    A very creative and well thought out original code. Very nicely done LP-John (y)
     
    aiman.h.kallaf likes this.
  4. xIsabel38

    xIsabel38 Well-Known Member

    I'm confused. You say "Right before the question mark to close the class, add this:"

    Are you talking about this line?
    Code:
    <div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
    Which question mark? Do you mean the Quotation Mark?

    So would I replace the above code with this?
    Code:
    <div class="messageUserInfo <xen:if is="{$user.gender} == 'male'"> male<xen:else /> female</xen:if>" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
    I'm not a coder so I need very very specific instructions.
     
  5. John L.

    John L. Well-Known Member

    Sorry about that, it's a typo. It should "quotation mark". Simply replace:
    HTML:
    <div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
    With this:
    HTML:
    <div class="messageUserInfo<xen:if is="{$user.gender} == 'male'"> male<xen:else /> female</xen:if>" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
     
  6. John L.

    John L. Well-Known Member

  7. Adam Howard

    Adam Howard Well-Known Member

    PHP:
    .male .messageUserBlock{background-color:#FFBFED!important;border:1px solid #ECF7FF!important;}
    .male .messageUserBlock div.avatarHolder{background-color:#FFDFF6!important;}
    .male .messageUserBlock .extraUserInfo{background-color:#FFDFF6!important;}
    .male .messageUserBlock .arrow{border-color:transparent -moz-use-text-color transparent #ECF7FF;}
    .male .messageUserBlock .arrow span{border-color:transparent -moz-use-text-color transparent #FFDFF6;}
    Depending on your theme / skin / style (whichever you call it) .... The above should give your men (males) their own pre-define colors. You can of course change them to fix your own needs.
     
  8. xIsabel38

    xIsabel38 Well-Known Member

    So many applications of this, can it be changed based on usergroup?
     
  9. Adam Howard

    Adam Howard Well-Known Member

    Small heads up. There is a small graphic conflict if you are an admin and using this

    http://xenforo.com/community/resources/user-edit-menu-in-postbit.796/

    www.sociallyuncensored.eu 2012-9-27 14:34:8.png
    ^^^ You'll notice the male / female symbols are hidden under the user name and not on the right side. This only is viewable to Administrators only and so, no general worries for the rest of your users.

    This is also not a flaw with either modification. Just how the layout finally renders with them together.
     
  10. John L.

    John L. Well-Known Member

    Right now I have the CSS applying to the a tag for the username in the Extra.css template. Try attaching the image to the h3 instead, like so:
    Code:
    .male .messageUserBlock h3.userText{background: url(styles/default/xenforo/gender/male.png) right center no-repeat;}
    .female .messageUserBlock h3.userText{background: url(styles/default/xenforo/gender/female.png) right center no-repeat;}
     
    Adam Howard likes this.
  11. Cal

    Cal Well-Known Member

  12. Adam Howard

    Adam Howard Well-Known Member

    Success :)

    Thank you :D
     
  13. John L.

    John L. Well-Known Member

    I suppose if you edit the gender field and add that option you can then adjust the template conditional like so:
    PHP:
    <xen:if is="{$user.gender} == 'male'"male<xen:elseif is="{$user.gender} == 'male_female'" />male-female<xen:else /> female</xen:if>
    Hope that helps. I don't have an icon for that but I'm sure you can find one :)
     
    Cal likes this.
  14. xIsabel38

    xIsabel38 Well-Known Member

    On a light Background it should work fine, if you need a dark background version we would have to black matte it.

    Save As ---------------------------------> [​IMG] <------------------------------------ Save As
     
    Adam Howard and Cal like this.
  15. Adam Howard

    Adam Howard Well-Known Member

    unspecified .... Seems to still be pink
     
  16. Roberto Bilić

    Roberto Bilić Active Member

    What if a gender is not chosen? :) ... In my forum a user has not configured their gender automatic is set as female :)
     
  17. John L.

    John L. Well-Known Member

    Adam Howard likes this.
  18. John L.

    John L. Well-Known Member

    This should be fixed, try applying this update as I've specified in the conditional that they have to be either male or female to have a class applied. If they are neither, they get nothing and will be the default style of your forum :).

    I also added a few fixes to this one to make it look better and included a male color since some people may have custom styles that can be any color. This way you have at least a pink and blue version.
     
  19. Roberto Bilić

    Roberto Bilić Active Member

    Now is OK :) ... Thanks
     
  20. Adam Howard

    Adam Howard Well-Known Member

    a suggestion from a lot of my members was that unspecified should be a green color
     

Share This Page