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

Some info under the avatar

Discussion in 'XenForo Questions and Support' started by AndreaMarucci, May 2, 2011.

  1. AndreaMarucci

    AndreaMarucci Well-Known Member

    I don't know how to call this zone but I would like to put some user info in the zone under the avatar, under the name and title, like in the picture attached (done with photoshop).

    test.jpg

    Now I've these info under the signature but they mix with the text in the signature so I would like to put them in more evidence there.

    How can I do that?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    ACP -> Style Properties -> Message Elements
     
  3. AndreaMarucci

    AndreaMarucci Well-Known Member

    Btw, I've seen this code inside the template message_user_info
    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="@messageShowRegisterDate">
                        <dl class="pairsInline">
                            <dt>{xen:phrase member_since}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowMessageCount">
                        <dl class="pairsInline">
                            <dt>{xen:phrase message_count}:</dt>
                            <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowTotalLikes">
                        <dl class="pairsInline">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowTrophyPoints">
                        <dl class="pairsInline">
                            <dt>{xen:phrase trophy_points}:</dt>
                            <dd><a href="{xen:link 'members/trophies', $user}" class="OverlayTrigger concealed">{xen:number $user.trophy_points}</a></dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowGender AND {$user.gender}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase gender}:</dt>
                            <dd itemprop="gender"><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowOccupation AND {$user.occupation}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase occupation}:</dt>
                            <dd itemprop="role">{xen:string censor, $user.occupation}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowLocation AND {$user.location}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase location}:</dt>
                            <dd><a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location}'}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="@messageShowHomepage AND {$user.homepage}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase home_page}:</dt>
                            <dd><a href="{xen:string censor, $user.homepage}" rel="nofollow" target="_blank" itemprop="url">{xen:string censor, $user.homepage}</a></dd>
                        </dl>
                    </xen:if>
    
                    <xen:comment>
                    <xen:foreach loop="{$user.identities}" key="$service" value="$account">
                        <dl class="pairsInline">
                            <dt>{$service}</dt>
                            <dd>{$account}</dd>
                        </dl>
                    </xen:foreach>
                    </xen:comment>
    
                </xen:hook>
                </xen:contentcheck>
            </div>
        </xen:if>
    
    </xen:if>
    I don't understand it fully but it seems what I'm searching for. Isn't it? If it what I mean how can I activate it?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. AndreaMarucci

    AndreaMarucci Well-Known Member

    Gotcha!! Thanks!
     
  6. AndreaMarucci

    AndreaMarucci Well-Known Member

    Now that's the result

    Schermata 2011-05-02 a 23.07.26.png

    And I like it but I would like to put the value on the same line of the label (say Località: Roma that is Location: Rome) but when I've tried to modify the template code from this
    Code:
                    <xen:if is="@messageShowTotalLikes">
                        <dl class="pairsInline">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
    to this
    Code:
                    <xen:if is="@messageShowTotalLikes">
                        <dl class="pairsInline">
                            <dt>{xen:phrase likes_received}: {xen:number $user.like_count}</dt>
    
                        </dl>
                    </xen:if>
    I've lost the formatting of the values.

    How can I keep this style puttig the value just after the label?
     
  7. AndreaMarucci

    AndreaMarucci Well-Known Member

    I would like to reduce the height of the box doing this...
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Try adding a float: left to the dt component.
     
  9. borbole

    borbole Well-Known Member

    Try this to have those fields on the same line:

    Change this code:

    Code:
    <xen:if is="@messageShowTotalLikes">
                        <dl class="pairsInline">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
    To this:

    Code:
    <xen:if is="@messageShowTotalLikes">
    <dl class="pairsInline">
    <dt>{xen:phrase likes_received}&nbsp{xen:number $user.like_count}</dt>
    </dl>
    </xen:if>
    That should do it. And follow the same example for any other fields that you want to have it on the same line.

    Whereas to change the height, have a look at the message_user_info template.
     
  10. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks Borbole but this is exactly what I've done before loosing all the formatting on the values that got the same style of the label. I was searching for a mean to retain the style of the values.

    Brogan I understand wht you mean but I really don't know how to to what you suggest. If you can show me the code I'll appreciate...
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Add this to EXTRA.css

    Code:
    .messageUserBlock .extraUserInfo dt {
    float: left;
    padding-right: 4px;
    }
     
  12. AndreaMarucci

    AndreaMarucci Well-Known Member

    Brogan you're the best. This do the trick. Now one more info, if you can. Now the date appear as "25 gennaio 2010" and I would like it to appear as "25/01/06". I know I've to use the php date function and this is the code but I really don't know how to modify it

    Code:
                    <xen:if is="@messageShowRegisterDate">
                        <dl class="pairsInline">
                            <dt>{xen:phrase member_since}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

  14. AndreaMarucci

    AndreaMarucci Well-Known Member

    I don't want to change the date format for all my board, just for this value. If I follow your method I think that the date format will change everywhere. Am I correct?
     
  15. AndreaMarucci

    AndreaMarucci Well-Known Member

    A little fix. As you can see in the picture attached, if the location value goes on two lines, the vertical alignment is correct (look at Casalecchio sul reno)
    Screenshot 2011-05-03 a 11.09.58.jpg
    If the location goes on one line (Look at Como) the vertical alignment is not correct. The same, if you look, also for other values...

    Thanks again
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    if you play with the CSS you should be able to get it looking exactly as you want.
     
  17. AndreaMarucci

    AndreaMarucci Well-Known Member

    Unfortunately I really don't know it...:(
     
  18. borbole

    borbole Well-Known Member

    That was not exactly what you did. If you will look closer to my code you will see the difference :)
     
  19. AndreaMarucci

    AndreaMarucci Well-Known Member

    The Brogan's method is better anyway since doesn't involve any change to the template code and this is better for the upgrades... If only someone could suggest me how to fix the veritcal alignment :rolleyes:
     
  20. Brogan

    Brogan XenForo Moderator Staff Member

    Code:
    .messageUserBlock .extraUserInfo dt {
    float: left;
    padding: 2px 4px 0 0;
    vertical-align: bottom;
    }
    Change the padding to suit your style.
     

Share This Page