FontAwesome Icons trong Message Buttons

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
17,142
Được Like
12,745
FontAwesome Icons trong Message Buttons

Thêm biểu tượng FontAwesome trong Message Buttons.

1. Trước tiên vào template PAGE_CONTAINER và thêm vào sau <head> đoạn code sau:
Mã:
<link href="//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css" rel="stylesheet">

2. Vào template post và thay thế tất cả mọi thứ với:
Mã:
<xen:include template="message">

    <xen:map from="$post" to="$message" />
    <xen:set var="$messageId">post-{$post.post_id}</xen:set>
    <xen:set var="$likesUrl">{xen:link posts/likes, $post}</xen:set>
    <xen:set var="$messageContentAfterTemplate"><xen:if is="{$post.attachments}"><xen:include template="attached_files" /></xen:if></xen:set>
    <xen:set var="$messageAfterTemplate">
            
        <div class="messageMeta">
        
            <div class="privateControls">
                <xen:if is="{$post.canInlineMod}"><input type="checkbox" name="posts[]" value="{$post.post_id}" class="InlineModCheck item" data-target="#post-{$post.post_id}" title="{xen:phrase select_this_post_by_x, 'name={$post.username}'}" /></xen:if>
                <span class="item muted">
                    <xen:username user="$post" class="author" />,
                    <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a>
                </span>
                <xen:hook name="post_private_controls" params="{xen:array 'post={$post}'}">
                <xen:if is="{$post.canEdit}">
                    <a href="{xen:link posts/edit, $post}" class="item control edit {xen:if $xenOptions.messageInlineEdit, OverlayTrigger}"
                        data-href="{xen:link posts/edit-inline, $post}" data-overlayOptions="{&quot;fixed&quot;:false}"
                        data-messageSelector="#post-{$post.post_id}"><span><i class="icon-pencil icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase edit}</a>
                    <xen:require js="js/xenforo/discussion.js" />
                </xen:if>
                <xen:if is="{$post.canDelete}"><a href="{xen:link posts/delete, $post}" class="item control delete OverlayTrigger"><span><i class="icon-remove icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase delete}</a></xen:if>
                <xen:if is="{$post.canCleanSpam}"><a href="{xen:link spam-cleaner, $post}" class="item control deleteSpam OverlayTrigger"><span><i class="icon-remove-sign icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase spam}</a></xen:if>
                <xen:if is="{$canViewIps} AND {$post.ip_id}"><a href="{xen:link posts/ip, $post}" class="item control ip OverlayTrigger"><span><i class="icon-user icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase ip}</a></xen:if>
            
                <xen:if is="{$post.canWarn}">
                    <a href="{xen:link members/warn, $post, 'content_type=post', 'content_id={$post.post_id}'}" class="item control warn"><span><i class="icon-warning-sign icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase warn}</a>
                <xen:elseif is="{$post.warning_id} && {$canViewWarnings}" />
                    <a href="{xen:link warnings, $post}" class="OverlayTrigger item control viewWarning"><span></span>{xen:phrase view_warning}</a>
                </xen:if>
                <xen:if is="{$post.canReport}">
                    <a href="{xen:link posts/report, $post}" class="OverlayTrigger item control report" data-cacheOverlay="false"><span><i class="icon-exclamation-sign icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase report}</a>
                </xen:if>
            
                </xen:hook>
            </div>
        
            <div class="publicControls">
                <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="item muted postNumber hashPermalink OverlayTrigger" data-href="{xen:link posts/permalink, $post}">#{xen:calc '{$post.position} + 1'}</a>
                <xen:hook name="post_public_controls" params="{xen:array 'post={$post}'}">
                <xen:if is="{$post.canLike}">
                    <a href="{xen:link posts/like, $post}" class="LikeLink item control {xen:if $post.like_date, unlike, like}" data-container="#likes-post-{$post.post_id}"><span><i class="icon-thumbs-up icon-large icon-fixed-width" style="padding-right:4px;"></i></span><span class="LikeLabel">{xen:if $post.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
                </xen:if>
                <xen:if is="{$canReply}">
                    <a href="{xen:link threads/reply, $thread, 'quote={$post.post_id}'}" data-postUrl="{xen:link posts/quote, $post}" class="ReplyQuote item control reply" title="{xen:phrase reply_quoting_this_message}"><span><i class="icon-reply icon-large icon-fixed-width" style="padding-right:4px;"></i></span>{xen:phrase reply}</a>
                </xen:if>
                </xen:hook>
            </div>
        </div>
    </xen:set>
</xen:include>

Bạn có thể thêm color:x; trong style= cho phù hợp với nhu cầu của bạn.

messageicons.png

Chúc các bạn thành công.


Nguồn: xenforo.com​
 

Top Bottom