Code nội quy đăng bài cho từng mục xenforo

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,829
Được Like
12,687
Chức năng này có tác dụng tạo thông báo cho từng mục trong forum của bạn, cụ thể nó là thông báo cho từng mục trong forum.

Các làm như sau:
Vào ACP => Tempalte => Tạo một template mới với tên thong_bao
Copy đoạn mã bên dưới cho vào tempale mới tạo
Mã:
<xen:if is="{$forum.node_id} ==35">
<div id="notice-3" class="section sectionMain noticeHolder info">
<div class="noticeUserBlock">
<div class="avatarHolder">
<a href="members/admin.1/" class="avatar Av1s Tooltip" data-avatarhtml="true"><img src="data/avatars/s/0/1.jpg?1329137617" width="48" height="48" alt="admin"></a>
</div>
</div>
<div class="noticeContent">
<h3 class="noticeTitle">Quy định khi đăng bài viết trong Box ...</h3>
<div><p style="color: green">1. Bài đăng phải được phân loại theo từng mục</p>
<p style="color: darkred">2. Không đăng những bài đăng vô ích mang tính spam</p>
<p style="color: green">3. Bài viết sao chép dù 01 phần cũng phải ghi nguồn gốc rõ ràng.</p>
<p style="color: darkred">4. Khi chia sẻ nên có hình ảnh và demo giới thiệu.</p>
<p style="color: green">5. Đính kèm lên diễn đàn, hoặc Mediafire.com ... và những trang download free nhanh khác.
</p><p style="color: red; font-style: italic">=&gt; (Nghiêm cấm hình thức đăng bài viết spam, quảng cáo).</p></div>
<div class="afterContent"></div>
</div>
</div>
</xen:if>

Bạn có thể tùy chỉnh id và nội dung phù hợp theo từng chuyên mục của bạn.

Tiếp theo các bạn vào EXTRA.css
Chèn đoạn mã sau vào cuối tempalte này
Mã:
/* --- xfr_bn_notice_holder.css --- */

.noticeHolder
{
min-height: 50px;
}
.noticeHolder.info
{
background-color: rgb(255, 255, 255);
}
.noticeHolder.warning
{
background-color: #f8f8f8;
border: 1px solid #e7e7e7;
}
.noticeHolder.important
{
background-color: #ffeae5;
border: 1px solid #f9c5b0;
}
.noticeHolder.info, .noticeHolder.warning, .noticeHolder.important
{
padding: 10px !important;
margin-bottom: 10px !important;
}
.noticeHolder .noticeUserBlock
{
background: rgb(237, 237, 237) url('styles/baisik/xenforo/gradients/tab-selected-light.png') repeat-x bottom;
border: 1px solid rgb(237, 237, 237);
border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; -khtml-border-radius: 5px;
float: left;
width: 48px;
position: relative;
}
.noticeHolder .noticeUserBlock .avatar img {
height: 32px;
width: 32px;
}
.noticeHolder .noticeUserBlock div.avatarHolder
{
background-color: rgb(250, 250, 250);
padding: 5px;
border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px;
height: 38px;
}
.noticeHolder .noticeUserBlock div.avatarHolder a
{
display: block;
}
.noticeHolder .noticeContent
{
margin-left: 60px;
}
.noticeHolder .noticeContent h3.noticeTitle
{
font-weight: bold;
font-size: 12pt;
margin-bottom: 5px;
border-bottom: 1px solid rgb(237, 237, 237);
}
.noticeHolder .noticeContent .NoticeControls
{
float: right;
font-size: 11px;
}
.noticeHolder .noticeContent .NoticeControls .item
{
margin-left: 10px;
}
.noticeHolder .noticeContent .afterContent
{
clear: both;
}
/* --- xfr_bn_notice_holder_extra.css --- */
.noticeHolder.warning .noticeUserBlock
{
border-color: #e7e7e7;
}
.noticeHolder.warning .noticeUserBlock div.avatarHolder
{
background-color: #f8f8f8;
}
.noticeHolder.warning .noticeUserBlock .avatar img {
border-color: #e7e7e7;
}
.noticeHolder.important .noticeUserBlock
{
border-color: #f9c5b0;
}
.noticeHolder.important .noticeUserBlock div.avatarHolder
{
background-color: #ffeae5;
}
.noticeHolder.important .noticeUserBlock .avatar img {
border-color: #f9c5b0;
}
.noticeHolder.warning .noticeContent h3.noticeTitle
{
border-color: #e7e7e7;
}
.noticeHolder.important .noticeContent h3.noticeTitle
{
border-color: #f9c5b0;
}.noticeHolder.warning .noticeUserBlock
{
border-color: #e7e7e7;
}
.noticeHolder.warning .noticeUserBlock div.avatarHolder
{
background-color: #f8f8f8;
}
.noticeHolder.warning .noticeUserBlock .avatar img {
border-color: #e7e7e7;
}
.noticeHolder.important .noticeUserBlock
{
border-color: #f9c5b0;
}
.noticeHolder.important .noticeUserBlock div.avatarHolder
{
background-color: #ffeae5;
}
.noticeHolder.important .noticeUserBlock .avatar img {
border-color: #f9c5b0;
}
.noticeHolder.warning .noticeContent h3.noticeTitle
{
border-color: #e7e7e7;
}
.noticeHolder.important .noticeContent h3.noticeTitle
{
border-color: #f9c5b0;
}
/* CSS returned from cache. */

Tiếp tục các bạn vào thread_list tìm đoạn
Mã:
<xen:require css="discussion_list.css" />
<xen:require js="js/xenforo/discussion_list.js" />

Thêm vào bên dưới đoạn
Mã:
<xen:include template="thong_bao" />

Xong quay ra và kiểm tra thành quả nhé.


Nguồn: bvn.vn​
 

dinhtung0806

Private
Tham gia
12/06/2015
Bài viết
4
Được Like
4
Tìm từ sáng giờ và mình đã làm được. Cám ơn bạn đã chia sẻ
 
  • Like
Reactions: THB

THB

Founder
Thành viên BQT
Tham gia
25/02/2015
Bài viết
6,643
Được Like
3,929
Sao ko like? Hiii
 

phucdinh997

Private
Tham gia
27/04/2015
Bài viết
26
Được Like
19
:DHay nhưng không có nhiều options bằng advanced forum rule.
 

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

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile/Zalo: 0906081284

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