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

warning points in postbit

Discussion in 'Styling and Customization Questions' started by optrex, Apr 20, 2013.

  1. optrex

    optrex Active Member

    Is there a way to display a users current warning points level in the postbit or message element?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> message_user_info

    Add the red code:

    Code:
    	<xen:if hascontent="true">
    		<div class="extraUserInfo">
    			<xen:contentcheck>
    			<xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
    
    				<dl class="pairsInline">
    					<dt>Warning Points:</dt>
    					<dd>{$user.warning_points}</dd>
    				</dl>
    
    				<xen:if is="@messageShowRegisterDate">
    					<dl class="pairsInline">
    						<dt>{xen:phrase member_since}:</dt>
    						<dd>{xen:date $user.register_date}</dd>
    					</dl>
    				</xen:if>
    
    Screen shot 2013-04-21 at 2.11.27 AM.png
     
    Antuan and optrex like this.
  3. optrex

    optrex Active Member

    thanks very much Jake (y)
     
  4. optrex

    optrex Active Member

    Could I ask, do you know how I could make this display if they have points, but hide it if they have no points?
     
    abbychase likes this.
  5. RoldanLT

    RoldanLT Well-Known Member

    Xen if/else will do i think..
     
  6. optrex

    optrex Active Member

    true, but what criteria. I'm not a coder, but I can copy/paste ;)
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    	<xen:if hascontent="true">
    		<div class="extraUserInfo">
    			<xen:contentcheck>
    			<xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
    
    				<xen:if is="{$user.warning_points}">
    				<dl class="pairsInline">
    					<dt>Warning Points:</dt>
    					<dd>{$user.warning_points}</dd>
    				</dl>
    				</xen:if>
    
    				<xen:if is="@messageShowRegisterDate">
    					<dl class="pairsInline">
    						<dt>{xen:phrase member_since}:</dt>
    						<dd>{xen:date $user.register_date}</dd>
    					</dl>
    				</xen:if>
    
     
    Antuan, Adam Howard and optrex like this.
  8. denisx04

    denisx04 Active Member


    On mine it displays at the top of the avatar, anyway to bring it down to the postbit?
     

Share This Page