• 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

AndreaMarucci

Well-known member
#1
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?
 

AndreaMarucci

Well-known member
#3
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?
 

AndreaMarucci

Well-known member
#6
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?
 

borbole

Well-known member
#9
I would like to reduce the height of the box doing this...
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.
 

AndreaMarucci

Well-known member
#10
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...
 

Brogan

XenForo moderator
Staff member
#11
Add this to EXTRA.css

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

AndreaMarucci

Well-known member
#12
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>
 

AndreaMarucci

Well-known member
#14
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?
 

AndreaMarucci

Well-known member
#15
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
 

AndreaMarucci

Well-known member
#19
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:
 

Brogan

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