Xenforo Konunun ilk sayfa postbit'i yatay yapma.

orhan

Moderator
Katılım
5 Ara 2018
Mesajlar
466
Tepkime puanı
93
Puanları
28
Merhaba bu benim xenforo'da ilk paylaşımım umarim birilerinin işine yarar Öncellikle belirteyim bunu yapmanın daha pratik yolu vardır mutlaka örnek sorgu kullanarak maalesef ben kodlara yeni aşina olduğum için biraz uzun bir yol seçtim
1- Not: Herhangi bir şablonu değiştirmeden önce, herhangi bir hata olması durumunda geriye dönmek için şablonun bir kopyasını alın .
2- Yeni bir şablon oluşturun ve ona istediğiniz ismi verin, ben ona message_macros_first adını vereyim ve aşağıdaki kodları içine yapıştıralım
3- post_macros şablonunu açıp şu kodu arıyoruz :
Bul
HTML:
<xf:extension name="full_body">
            <div class="message-inner">
                <xf:extension name="user_cell">
                    <div class="message-cell message-cell--user">
                        <xf:macro template="message_macros" name="user_info" arg-user="{$post.User}"
                            arg-fallbackName="{$post.username}"/>
                    </div>
                </xf:extension>
Bunu şununla değiştiriyoruz:
HTML:
<xf:extension name="full_body">
            <div class="message-inner {{ $post.position == 0 ? 'dis-block': ''}}">
                <xf:extension name="user_cell">
                    <div class="message-cell message-cell--user">
                        <xf:if is="$post.position == 0">
                        <xf:macro template="message_macros_first" name="user_info" arg-user="{$post.User}"
                        arg-fallbackName="{$post.username}"/>
                        <xf:else />
                        <xf:macro template="message_macros" name="user_info" arg-user="{$post.User}"
                    arg-fallbackName="{$post.username}"/>
                </xf:if>
                    </div>
                </xf:extension>

Değişiklikleri Kaydet.

4 - extra.less şablonunu açın ve şu kodu ekleyin:

CSS:
.dis-none{
    display: none !important;
}
.message-user_first_post{
    clear: both;
}
.post_userExtras{
    float: right;
    margin-top: 3px;
    font-size: 12px;
    padding: 5px;
}
.post_userExtras .pairs, .message-userExtras .pairs{
    background: #fff;
    padding: 5px;
    border: 1px olid #000;
    color: #23412e;
    margin-bottom: 2px;
}
.clear{
    clear: both;
}
.message .dis-block {
    flex-direction: column;
}
.message .message-cell.message-cell--user .message-user .message-userDetails {
    margin-left: 0;
    flex: 1;
    min-width: 0;
    padding-left: 15px;
    width: 100%;
}
.message .dis-block .message-cell.message-cell--user {
    flex: 0 0 100%;
}
.message .dis-block .message-cell.message-cell--user .message-user {
    display: flex;
    align-items: center;
}
.message .dis-block .message-cell.message-cell--user .message-user .message-userDetails {
    margin-left: 0;
    flex: 1;
    min-width: 0;
    padding-left: 15px;
    width: 100%;
}
@media (min-width: 650px){
.message .dis-block .message-cell.message-cell--user .message-user .message-name {
    text-align: left;
}
.message .dis-block .message-cell.message-cell--user .message-user .message-userTitle, .message .dis-block .message-cell.message-cell--user .message-user .message-userBanner.userBanner {
    display: inline-block;
    text-align: left;
    margin: 0;
}
}

message_macros_first kodlari
PHP:
<xf:macro name="user_info"
    arg-user="!"
    arg-fallbackName="">
    <section itemscope itemtype="https://schema.org/Person" class="message-user {{ $post.position == 0 ? 'message-user_first_post': '' }}">
        <div class="message-avatar {{ ($xf.options.showMessageOnlineStatus && $user && $user.isOnline()) ? 'message-avatar--online' : '' }}">
            <div class="post_AvatarUserDetails">
         
            <div class="message-avatar-wrapper">
                <xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
                <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
                    <span class="message-avatar-online" tabindex="0" data-xf-init="tooltip" data-trigger="auto" title="{{ phrase('online_now')|for_attr }}"></span>
                </xf:if>
            </div>
     
        <div class="message-userDetails">
            <h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="name" /></h4>
            <xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="jobTitle" />
            <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
        </div>
        </div>
        <xf:if is="$user.user_id">
            <xf:set var="$extras" value="{{ property('messageUserElements') }}" />
            <xf:if contentcheck="true">
                    <div class="post_userExtras">
                <div class="message-userExtras">
                <xf:contentcheck>
                    <xf:if is="$extras.register_date">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('joined') }}</dt>
                            <dd>{{ date($user.register_date) }}</dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.message_count">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('messages') }}</dt>
                            <dd>{$user.message_count|number}</dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.reaction_score">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('reaction_score') }}</dt>
                            <dd>{$user.reaction_score|number}</dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('points') }}</dt>
                            <dd>{$user.trophy_points|number}</dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.age && $user.Profile.age">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('age') }}</dt>
                            <dd>{$user.Profile.age}</dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.location && $user.Profile.location">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('location') }}</dt>
                            <dd>
                                <xf:if is="$xf.options.geoLocationUrl">
                                    <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
                                <xf:else />
                                    {$user.Profile.location}
                                </xf:if>
                            </dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.website && $user.Profile.website">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('website') }}</dt>
                            <dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url('host', phrase('visit_site'))}</a></dd>
                        </dl>
                    </xf:if>
                    <xf:if is="$extras.custom_fields">
                        <xf:macro template="custom_fields_macros" name="custom_fields_values"
                            arg-type="users"
                            arg-group="personal"
                            arg-set="{$user.Profile.custom_fields}"
                            arg-additionalFilters="{{ ['message'] }}"
                            arg-valueClass="pairs pairs--justified" />
                        <xf:if is="$user.canViewIdentities()">
                            <xf:macro template="custom_fields_macros" name="custom_fields_view"
                                arg-type="users"
                                arg-group="contact"
                                arg-set="{$user.Profile.custom_fields}"
                                arg-additionalFilters="{{ ['message'] }}"
                                arg-valueClass="pairs pairs--justified" />
                        </xf:if>
                    </xf:if>
                </xf:contentcheck>
                </div>
                </div><div class="clear"></div>
            </xf:if>
        </xf:if>
        <span class="message-userArrow {{ $post.position == 0 ? 'dis-none': '' }}"></span>
    </section>
    <div class="clear"></div>
</xf:macro>

<xf:macro name="user_info_simple" arg-user="!" arg-fallbackName="">
    <header itemscope itemtype="https://schema.org/Person" class="message-user">
        <meta itemprop="name" content="{{ $user.username ?: $fallbackName }}">
        <div class="message-avatar">
            <div class="message-avatar-wrapper">
                <xf:avatar user="$user" size="s" defaultname="{$fallbackName}" itemprop="image" />
            </div>
        </div>
        <span class="message-userArrow"></span>
    </header>
</xf:macro>

<xf:macro name="attachments" arg-attachments="!" arg-message="!" arg-canView="!">
    <xf:if contentcheck="true">
        <xf:css src="attachments.less" />
        <section class="message-attachments">
            <h4 class="block-textHeader">{{ phrase('attachments') }}</h4>
            <ul class="attachmentList">
                <xf:contentcheck>
                    <xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment)">
                        <xf:macro template="attachment_macros" name="attachment_list_item"
                            arg-attachment="{$attachment}"
                            arg-canView="{$canView}" />
                    </xf:foreach>
                </xf:contentcheck>
            </ul>
        </section>
    </xf:if>
</xf:macro>

<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                {{ bb_code($user.Profile.signature, 'user:signature', $user) }}
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>

postbit.png
 

Yasal Uyarı

İçerik sağlayıcı paylaşım sitesi olarak hizmet veren webtiryakin.com 5651 sayılı kanunun 8. maddesine ve T.C.Knın 125. maddesine göre tüm üyelerimiz yaptıkları paylaşımlardan kendileri sorumludur. Hukuka ve mevzuata aykırı olduğunu düşündüğünüz içeriği BURADAN bildirebilirsiniz. Kısa sürede dönüş yapmaya çalışacağız.
Geri
Üst