1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice
  3. What happens when the XF 2.0 is out? See the discussion here: http://www.sonnb.com/threads/what-happens-when-xf-2-0-is-out.1146/
    Dismiss Notice

Question How To Add Photo/album Count Below Avatar On Threads?

Discussion in 'XenGallery' started by schroeffu, Jan 29, 2014.

  1. schroeffu

    schroeffu Authorized Member Authorized

    Usually its in Style Properties > Message Elements.
    But there is nothing for XenGallery.

    On Profile Page it's correct:

    Registred since: 29.01.2014

    Likes: 6
    Albums: 1
    Photos: 6

    How to add this Albums: and Photos: count on threads below the avatar of users?

    Edit: 2nd Question: How to disable the drop-down function on startpage?

    no_dropdown.png
     
    Last edited: Jan 30, 2014
  2. sonnb

    sonnb Administrator Staff Member

    1. You need to edit templates to display these information to that place. You can use
    - {$user.sonnb_xengallery_album_count}
    - {$user.sonnb_xengallery_photo_count}

    2. You need to edit template: sonnb_xengallery_navbar_template.
     
    otto and Acid like this.
  3. snoopy5

    snoopy5 Authorized Member Authorized

    I bookmark this for me.
     
  4. snoopy5

    snoopy5 Authorized Member Authorized

    Which template exactly?
     
  5. snoopy5

    snoopy5 Authorized Member Authorized

    Where exactly? Or do I need to use a different template?

    This is template
    message_user_info


    Code:
    <xen:if is="
        {$xenOptions.uix_enableCollapseUserInfo}
        && !@uix_classicPostbit
        && {$user.uix_can_collapse}
        && !({$xenOptions.uix_noCollapseStaffPost} && {$user.is_staff})
        && ( {$visitor.uix_collapse_user_info} || !{$visitor.user_id} )
    ">
    
        <xen:if is="@uix_threadSlidingAvatar">
            <xen:set var="$avatarIsCollapsible" value="1" />
        </xen:if>
    
        <xen:if is="@uix_threadSlidingExtra">
            <xen:set var="$extraIsCollapsible" value="1" />
        </xen:if>
    
    <xen:else />
        <xen:set var="$avatarIsCollapsible" value="0" />
        <xen:set var="$extraIsCollapsible" value="0" />
    </xen:if>
    
    <xen:set var="$userBlockHasCollapsibleElements" value="{xen:if '{$avatarIsCollapsible} == 1 || {$extraIsCollapsible} == 1', '1', '0'}" />
    
    <xen:set var="$userBlockCollapseStateClass" value="{xen:if '{$avatarIsCollapsible} == 1 || {$extraIsCollapsible} == 1', 'is-collapsed', 'is-expanded'}" />
    
    <xen:set var="$avatarCollapseStateClass" value="{xen:if '{$avatarIsCollapsible} == 1', 'is-collapsed', 'is-expanded'}" />
    
    <xen:set var="$extraCollapseStateClass" value="{xen:if '{$extraIsCollapsible} == 1', 'is-collapsed', 'is-expanded'}" />
    
    
    <xen:require css="message_user_info.css" />
    
    <div class="messageUserInfo" {xen:if $user.user_id, 'itemscope="itemscope" itemtype="http://data-vocabulary.org/Person"'}>  
    
    <div class="messageUserBlock {xen:if $userBlockHasCollapsibleElements, 'messageUserBlock--hasCollapsibleElements'} {$userBlockCollapseStateClass} {xen:if $user.isOnline, online}">
    
        <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            <div class="avatarHolder {$avatarCollapseStateClass}">
                <div class="uix_avatarHolderInner">
                <span class="helper"></span>
                <xen:avatar user="$user" size="@uix_postbit_avatarSize" img="true" />
    
                <xen:if is="{$user.isOnline}"><span class="Tooltip onlineMarker" title="{xen:phrase online_now}" data-offsetX="-22" data-offsetY="-8"><xen:if is="@uix_messageOnlineMarker_circlePulse"><span class="onlineMarker_pulse"></span></xen:if></span></xen:if>
                <!-- slot: message_user_info_avatar -->
                </div>
            </div>
        </xen:hook>
    <xen:if is="!{$isQuickReply}">
        <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            <h3 class="userText">
                <div class="uix_userTextInner">
    
                    <xen:if is="{$userBlockHasCollapsibleElements} == 1">
                    <div class="js-messageUserBlockToggle messageUserBlockToggle">
                        <i class="uix_icon uix_icon-expand Tooltip" title="{xen:phrase uix_expand}" data-tipclass="iconTip"></i>
                        <i class="uix_icon uix_icon-collapse Tooltip" title="{xen:phrase uix_collapse}" data-tipclass="iconTip"></i>
                    </div>
                    </xen:if>
    
                    <xen:username user="$user" itemprop="name" rich="true" />
                    <xen:if hascontent="true"><em class="userTitle" {xen:if $user.user_id, 'itemprop="title"'}><xen:contentcheck>{xen:helper userTitle, $user, 1, 1}</xen:contentcheck></em></xen:if>
                </div>
                {xen:helper userBanner, $user, 'wrapped'}
                <!-- slot: message_user_info_text -->
            </h3>
        </xen:hook>
        <xen:if hascontent="true">
            <div class="extraUserInfo {$extraCollapseStateClass}">
                <xen:contentcheck>
                <xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
                    <xen:if is="@messageShowRegisterDate AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase joined}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowMessageCount AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase messages}:</dt>
                            <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed" rel="nofollow">{xen:number $user.message_count}</a></dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowTotalLikes AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowTrophyPoints AND {$user.user_id} AND {$xenOptions.enableTrophies}">
                        <dl class="pairsJustified">
                            <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="pairsJustified">
                            <dt>{xen:phrase gender}:</dt>
                            <dd><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="pairsJustified">
                            <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="pairsJustified">
                            <dt>{xen:phrase location}:</dt>
                            <dd>
                                <xen:if is="{$xenOptions.geoLocationUrl}">
                                    <a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location, '-'}'}" target="_blank" rel="nofollow noreferrer" itemprop="address" class="concealed">{xen:string censor, $user.location}</a>
                                <xen:else />
                                    {xen:string censor, $user.location}
                                </xen:if>
                            </dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowHomepage AND {$user.homepage}">
                        <dl class="pairsJustified">
                            <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:hook>
               
                <xen:if is="@messageShowCustomFields AND {$user.customFields}">          
                <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
                    <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                        <xen:if is="{$fieldInfo.viewable_message} AND ({$fieldInfo.display_group} != 'contact' OR {$user.allow_view_identities} == 'everyone' OR ({$user.allow_view_identities} == 'members' AND {$visitor.user_id}))">
                            <xen:if hascontent="true">
                                <dl class="pairsJustified userField_{$fieldId}">
                                    <dt>{xen:helper userFieldTitle, $fieldId}:</dt>
                                    <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                                </dl>
                            </xen:if>
                        </xen:if>
                    </xen:foreach>
                </xen:hook>
                </xen:if>
                </xen:contentcheck>
            </div>
        </xen:if>
    </xen:if>
    
        <span class="arrow"><span></span></span>
    </div>
    </div>
     
  6. sonnb

    sonnb Administrator Staff Member

    Yes, you need to edit message_user_info
     
  7. snoopy5

    snoopy5 Authorized Member Authorized

    Yes, I know. I posted the code of that template above.

    My question was, where in that quoted code do I have to put the

    into?

    I mean in which line exactly?
     
  8. sonnb

    sonnb Administrator Staff Member

    You should put inside the block below. Make a new dl tag without if condition, something like

    <dl class="pairsJustified">
    <dt>{xen:phrase my_album_count_phrase}:</dt>
    <dd>{$user.sonnb_xengallery_album_count}</dd>
    </dl>

    HTML:
    <xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
                    <xen:if is="@messageShowRegisterDate AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase joined}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowMessageCount AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase messages}:</dt>
                            <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed" rel="nofollow">{xen:number $user.message_count}</a></dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowTotalLikes AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowTrophyPoints AND {$user.user_id} AND {$xenOptions.enableTrophies}">
                        <dl class="pairsJustified">
                            <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="pairsJustified">
                            <dt>{xen:phrase gender}:</dt>
                            <dd><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="pairsJustified">
                            <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="pairsJustified">
                            <dt>{xen:phrase location}:</dt>
                            <dd>
                                <xen:if is="{$xenOptions.geoLocationUrl}">
                                    <a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location, '-'}'}" target="_blank" rel="nofollow noreferrer" itemprop="address" class="concealed">{xen:string censor, $user.location}</a>
                                <xen:else />
                                    {xen:string censor, $user.location}
                                </xen:if>
                            </dd>
                        </dl>
                    </xen:if>
                    <xen:if is="@messageShowHomepage AND {$user.homepage}">
                        <dl class="pairsJustified">
                            <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:hook>
     

Share This Page