Help xin hướng dẫn tạo Widget giống xfnews

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
  • Like
Reactions: THB

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
hix thánh nào đi ngang qua help e 1 phát
 

2L.Ohayo

Moderator
Thành viên BQT
Tham gia
08/03/2015
Bài viết
761
Được Like
835
thêm vào wf_default_EXTRA.CSS

Mã:
.WidgetFramework_WidgetRenderer_Threads ul > li > span {
width: 30px;
display: block;
text-align: center;
float: left;
background-color: rgb(1, 151, 116);
font-size: 23px;
color: #fff;
text-shadow: none;
font-weight: 700;
margin-right: 10px;
padding:15px 0;
}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(2) > span {background-color: #1c1c1c;}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(3) > span {background-color: #666;}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(4) > span {background-color: #bbb;}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(5) > span {background-color: #ccc;}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(6) > span {background-color: #ccc;}
.WidgetFramework_WidgetRenderer_Threads ul > li:nth-child(7) > span {background-color: #ccc;}
.WidgetFramework_WidgetRenderer_Threads ul > li > span:before{
counter-increment: subsection;
content: counter(subsection);
}
.WidgetFramework_WidgetRenderer_Threads ul > li .entry > a{font-size:14px;line-height: 18px;font-weight:700}

Thay toàn bộ code trong wf_widget_threads_thread_full bằng

Mã:
<li class="thread-{$thread.thread_id} thread-node-{$thread.node_id}">
    <span></span>
    <div class="entry">
    <xen:if is="{$widget.options.display.show_prefix}">{xen:helper threadprefix, $thread}</xen:if>

    <a {xen:if '{$thread.title} != {xen:helper snippet, $thread.title, @wf_threads_titleMaxLength}', 'title="{$thread.title}" class="Tooltip"'}
        href="{xen:if '{$_threadLink}', {xen:raw $_threadLink}, {xen:link threads, $thread}}">
        {$thread.title}
    </a>

    <div class="userTitle">{xen:raw $_secondRow}</div>
   
    </div>   
</li>
 

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
không tác dụng lão ơi hay ta dùng WF 2.6 ta
 

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
chọn hết layout cũng thế lun lão
 
  • Like
Reactions: THB

2L.Ohayo

Moderator
Thành viên BQT
Tham gia
08/03/2015
Bài viết
761
Được Like
835
thử thay template wf_widget_threads xem
Mã:
<xen:if is="{$layout} == 'sidebar'">

    <xen:if hascontent="true">
        <div class="avatarList">
            <ul>
                <xen:contentcheck>
                    <xen:if is="{$widget.options.type} == 'recent' OR {$widget.options.type} == 'latest_replies'">

                        <xen:foreach loop="$threads" value="$thread">
                            <xen:set var="$user"><xen:username user="$thread" rich="@wf_threads_rich" /></xen:set>
                            <xen:include template="wf_widget_threads_thread_sidebar">
                                <xen:set var="$_threadLink">{xen:if '{$visitor.user_id} > 0', {xen:link threads/unread, $thread}, {xen:link posts, {xen:array 'post_id={$thread.last_post_id}'}}}</xen:set>
                                <xen:set var="$_secondRow">
                                    {xen:phrase wf_x_replied} <xen:datetime time="{$thread.last_post_date}" />
                                </xen:set>
                            </xen:include>
                        </xen:foreach>

                    <xen:elseif is="{$widget.options.type} == 'most_replied'" />

                        <xen:foreach loop="$threads" value="$thread">
                            <xen:set var="$user"><xen:username user="$thread" rich="@wf_threads_rich" /></xen:set>
                            <xen:include template="wf_widget_threads_thread_sidebar">
                                <xen:set var="$_secondRow">
                                    {xen:phrase wf_x_posted, 'user={xen:raw $user}'}, {xen:phrase replies}: {xen:number $thread.reply_count}
                                </xen:set>
                            </xen:include>
                        </xen:foreach>

                    <xen:elseif is="{$widget.options.type} == 'most_viewed'" />

                        <xen:foreach loop="$threads" value="$thread">
                            <xen:include template="wf_widget_threads_thread_full" />
                        </xen:foreach>

                    <xen:else />

                        <xen:foreach loop="$threads" value="$thread">
                            <xen:include template="wf_widget_threads_thread_full" />
                        </xen:foreach>

                    </xen:if>
                </xen:contentcheck>
            </ul>
        </div>

       
    </xen:if>
<xen:elseif is="{$layout} == 'full'" />
    <xen:include template="wf_widget_threads_thread_full" />

</xen:if>
 
  • Like
Reactions: THB

2L.Ohayo

Moderator
Thành viên BQT
Tham gia
08/03/2015
Bài viết
761
Được Like
835
đã test nhưng ko đc thks lão
Xem template bác đang dùng cho widget là template nào, chỉ cần thêm <span></span> vào sau chỗ <li class=.....
Rồi thêm đoạn css ở trên vào template wf_default_EXTRA.CSS
 

Hướng dẫn sử dụng

Dịch vụ XenForo của VNXF

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom