Question Cách trình bày thông tin người post bài đầu

Thảo luận trong 'Add-on Quesions' bắt đầu bởi zuykan, 27/7/13.

1votes
5/5, 1 vote

  1. zuykan

    zuykan New Member

    Bài viết:
    59
    Likes :
    14
    Để thông tin người post bài đầu tiên #1 như hình dưới đây thì làm thế nào các bác ? Ngoài ra để có Bài viết, Lượt thích, Kinh nghiệm cho mỗi thành viên thì chỉnh ở đâu ?

    [​IMG]
     
    Đang tải...
  2. SonTechno

    SonTechno Member

    Bài viết:
    179
    Likes :
    32
    Bạn thử áp dụng cách này xem sao, mình copy từ bạn svlamnghiep :D
    Chỉ áp dụng cho bài viết đầu tiên thôi nhé :)

    1. Vào EXTRA.css thêm đoạn code này vào:

    PHP:
     /*Display Postbit in first post*/.firstPost .messageUserInfo {
     
    floatnone;
     
    }
     
    .
    firstPost .messageUserInfo .messageUserBlock .arrow {
     
    displaynone;
     
    }
     
    .
    firstPost .messageInfo {
     
    margin-left5px !important;
     
    margin-top10px;
     
    }
     
    .
    newIndicator {
     
    displaynone !important;
     
    }
     
    .
    firstPost .messageUserInfo {
     
    width100% !important;
     
    }
     
    .
    firstPost .messageUserInfo .messageUserBlock .arrow {
     
    displaynone;
     
    }
     
    .
    firstPost .messageUserBlock {
     
    -
    moz-border-bottom-colorsnone !important;
     
    -
    moz-border-imagenone !important;
     
    -
    moz-border-left-colorsnone !important;
     
    -
    moz-border-right-colorsnone !important;
     
    -
    moz-border-top-colorsnone !important;
     
    backgroundnone repeat scroll 0 0 transparent !important;
     
    border-color: -moz-use-text-color -moz-use-text-color #CDE5F0 !important;
     
    border-stylenone none dashed !important;
     
    border-width0 0 1px !important;
     
    height64px;
     
    }
     
    .
    firstPost .avatar .img {
     
    margin-left!important;
     
    }
     
    .
    firstPost .avatarHolder {
     
    padding!important;
     
    positionabsolute !important;
     
    }
     
    .
    firstPost .userText {
     
    margin-left58px;
     
    positionabsolute !important;
     
    top18px;
     
    }
     
    .
    firstPost .tt_share_page {
     
    margin-left220px;
     
    positionabsolute;
     
    top34px;
     
    width420px;
     
    }
     
    .
    firstPost .shareControl {
     
    floatright;
     
    }
     
    .
    firstPost .addthis {
     
    padding-left20px;
     
    }
     
    .
    titleBar h1 {
     
    font-size20pt !important;
     
    }[
    PHP]2.vào Templates/creat new template/Tiêu đềmessage_user_info_firstpost
     
    Với Nội Dung Nhứ Sau
    :
     
    [
    PHP]:
     
    <
    xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
     
    <
    h3 class="userText">
     
    <
    xen:username user="$useritemprop="name" rich="true" />
     
    <
    xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle$user}</xen:contentcheck></em></xen:if>
     
    <!-- 
    slotmessage_user_info_text -->
     
    </
    h3>
     
    </
    xen:hook>
     
    </
    xen:if>
     
    <
    span class="tt_share_page">
     
    <
    div class="facebookLike shareControl">
     
    <
    fb:like href="{$url}layout="button_count" action="{$xenOptions.facebookLikeAction}font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
     
    </
    div>
     
    <
    div class="plusone shareControl">
     
    <
    div class="g-plusone" data-size="medium" data-count="true" data-href="{$url}">
     
    </
    div>
     
    <
    div class="tweet shareControl">
     
    <
    a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"
     
    data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
     
    data-url="{$url}"
     
    {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
     
    {
    xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
     
    </
    div>
     
    </
    span>
     
    <
    span class="arrow"><span></span></span>
     
    </
    div>
     
    </
    div>
    template: message
    Tìm:
    PHP:
    <li id="{$messageId}class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <
    xen:include template="message_user_info">
            <
    xen:map from="$messageto="$user/>
        </
    xen:include> 
    Thay bằng :

    Mã:
    <xen:if is="{$post.position} == 0">
    <li id="{$messageId}" class="message firstPost {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info_firstpost">
            <xen:map from="$message" to="$user" />
        </xen:include>
    <xen:else />
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if> 

    Còn để thêm các thông tin như Bài viết, Lượt thích thì bạn vào giao diện => Style properties => Message Elements thích thêm cái nào thì thêm :D
     
    zuykan thích bài này.
  3. ttkhlinh

    ttkhlinh New Member

    Bài viết:
    62
    Likes :
    2
    Làm theo hướng dẫn trên thì bị báo lỗi The following templates contained errors and were not saved: EXTRA.css: 1) Line 137: Template syntax error.
     
  4. karavip.com

    karavip.com Member

    Bài viết:
    80
    Likes :
    14
    Bác ấy copy bài sai rồi.
     
  5. ttkhlinh

    ttkhlinh New Member

    Bài viết:
    62
    Likes :
    2
    thế bài đúng là bài nào bạn?
     
  6. karavip.com

    karavip.com Member

    Bài viết:
    80
    Likes :
    14
    1. Vào EXTRA.css thêm đoạn code này vào:
    Mã:

    /*Display Postbit in first post*/.firstPost .messageUserInfo {float: none;
    }
    .firstPost .messageUserInfo .messageUserBlock .arrow {display: none;
    }
    .firstPost .messageInfo {margin-left: 5px !important;margin-top: 10px;
    }
    .newIndicator {display: none !important;
    }
    .firstPost .messageUserInfo {width: 100% !important;
    }
    .firstPost .messageUserInfo .messageUserBlock .arrow {display: none;
    }
    .firstPost .messageUserBlock {
    -moz-border-bottom-colors: none !important;
    -moz-border-image: none !important;
    -moz-border-left-colors: none !important;
    -moz-border-right-colors: none !important;
    -moz-border-top-colors: none !important;background: none repeat scroll 0 0 transparent !important;border-color: -moz-use-text-color -moz-use-text-color #CDE5F0 !important;border-style: none none dashed !important;border-width: 0 0 1px !important;height: 64px;
    }
    .firstPost .avatar .img {margin-left: 0 !important;
    }
    .firstPost .avatarHolder {padding: 0 !important;position: absolute !important;
    }
    .firstPost .userText {margin-left: 58px;position: absolute !important;top: 18px;
    }
    .firstPost .tt_share_page {margin-left: 220px;position: absolute;top: 34px;width: 420px;
    }
    .firstPost .shareControl {float: right;
    }
    .firstPost .addthis {padding-left: 20px;
    }
    .titleBar h1 {font-size: 20pt !important;
    }



    2.vào Templates/creat new template/Tiêu đề: message_user_info_firstpost
    Với Nội Dung Nhứ Sau:

    <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">

    <h3 class="userText">

    <xen:username user="$user" itemprop="name" rich="true" />

    <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>

    <!-- slot: message_user_info_text -->

    </h3>

    </xen:hook>



    </xen:if>

    <span class="tt_share_page">

    <div class="facebookLike shareControl">

    <fb:like href="{$url}" layout="button_count" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>

    </div>

    <div class="plusone shareControl">

    <div class="g-plusone" data-size="medium" data-count="true" data-href="{$url}">

    </div>

    <div class="tweet shareControl">

    <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"
    data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
    data-url="{$url}"
    {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}

    {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>

    </div>

    </span>

    <span class="arrow"><span></span></span>

    </div>

    </div>


    template: message
    Tìm:

    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
    <xen:include template="message_user_info">
    <xen:map from="$message" to="$user" />
    </xen:include>
    Thay bằng :

    <xen:if is="{$post.position} == 0">
    <li id="{$messageId}" class="message firstPost {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
    <xen:include template="message_user_info_firstpost">
    <xen:map from="$message" to="$user" />
    </xen:include>
    <xen:else />
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
    <xen:include template="message_user_info">
    <xen:map from="$message" to="$user" />
    </xen:include>
    </xen:if>
     
  7. Bvn.vn

    Bvn.vn Active Member

    Bài viết:
    1,832
    Likes :
    401
    Đã làm theo karavip.com nhưng bước 2 làm nó báo lỗi làm bước 1 và 3 thì vào mất thông tin luôn kaka
     
  8. karavip.com

    karavip.com Member

    Bài viết:
    80
    Likes :
    14
    1. Vào EXTRA.css thêm đoạn code này vào:


    Mã:
    /*Display Postbit in first post*/
     
    .firstPost .messageUserInfo {
     
        float: none;
     
    }
     
    .firstPost .messageUserInfo .messageUserBlock .arrow {
     
        display: none;
     
    }
     
    .firstPost .messageInfo {
     
        margin-left: 5px !important;
     
        margin-top: 10px;
     
    }
     
    .newIndicator {
     
        display: none !important;
     
    }
     
    .firstPost .messageUserInfo {
     
        width: 100% !important;
     
    }
     
    .firstPost .messageUserInfo .messageUserBlock .arrow {
     
        display: none;
     
    }
     
    .firstPost .messageUserBlock {
     
        -moz-border-bottom-colors: none !important;
     
        -moz-border-image: none !important;
     
        -moz-border-left-colors: none !important;
     
        -moz-border-right-colors: none !important;
     
        -moz-border-top-colors: none !important;
     
        background: none repeat scroll 0 0 transparent !important;
     
        border-color: -moz-use-text-color -moz-use-text-color #CDE5F0 !important;
     
        border-style: none none dashed !important;
     
        border-width: 0 0 1px !important;
     
        height: 64px;
     
    }
     
    .firstPost .avatar .img {
     
        margin-left: 0 !important;
     
    }
     
    .firstPost .avatarHolder {
     
        padding: 0 !important;
     
        position: absolute !important;
     
    }
     
    .firstPost .userText {
     
        margin-left: 58px;
     
        position: absolute !important;
     
        top: 18px;
     
    }
     
    .firstPost .tt_share_page {
     
        margin-left: 220px;
     
        position: absolute;
     
        top: 34px;
     
        width: 420px;
     
    }
     
    .firstPost .shareControl {
     
        float: right;
     
    }
     
    .firstPost .addthis {
     
        padding-left: 20px;
     
    }
     
    .titleBar h1 {
     
        font-size: 20pt !important;
     
    }
    2.Vào Templates/creat new template/

    Tiêu đề: message_user_info_firstpost

    Với Nội Dung Sau:
    Mã:
    <xen:require css="message_user_info.css" />
    <div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
    <div class="messageUserBlock">
        <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
                    <div class="avatarHolder">
                <span class="helper"></span>
                            <xen:avatar user="$user" size="s"/>
                <!-- slot: message_user_info_avatar -->
            </div>
        </xen:hook>
     
    <xen:if is="!{$isQuickReply}">
        <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            <h3 class="userText">
                <xen:username user="$user" itemprop="name" rich="true" />
                <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>
                <!-- slot: message_user_info_text -->
            </h3>
        </xen:hook>
     
    </xen:if>
    <span class="tt_share_page">
          <div class="facebookLike shareControl">
                <fb:like href="{$url}" layout="button_count" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
          </div>
          <div class="plusone shareControl">
            <div class="g-plusone" data-size="medium" data-count="true" data-href="{$url}">
          </div>
          <div class="tweet shareControl">
                <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"
            data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
            data-url="{$url}"
            {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
            {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
          </div>
    </span>
        <span class="arrow"><span></span></span>
    </div>
    </div>
    
    Template: message
    Tìm:
    Mã:
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    
    Thay=:
    Mã:
    <xen:if is="{$post.position} == 0">
    <li id="{$messageId}" class="message firstPost {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info_firstpost">
            <xen:map from="$message" to="$user" />
        </xen:include>
    <xen:else />
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if>
     
    
     
  9. karavip.com

    karavip.com Member

    Bài viết:
    80
    Likes :
    14
  10. ttkhlinh

    ttkhlinh New Member

    Bài viết:
    62
    Likes :
    2
    Làm y như vậy thì bị mất avatar của người post đầu tiên, chỉnh sao các bạn?

    [​IMG]
     
comments powered by Disqus

Chia sẻ trang này

Đang tải...