03-12-2016
Tên MOD: Kiểm duyệt diễn đàn
Cài đặt: unzip tất cả vào root của diễn đàn. Thực hiện chạy domain/users/kiemduyet_install.php
Mở pages/mainmenu.php
Tìm Code sau:
<?php
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1' ORDER BY `time` DESC LIMIT 10");
while ($arr = mysql_fetch_array($req)) {
$q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "'");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "'");
$frm = mysql_fetch_array($q4);
?>
Copy code
Chú thích: nếu không tìm thấy thì tìm đoạn tương tự nha.
Thay thế bằng:
<?php
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `kiemduyet` = '1' AND `close`!='1' ORDER BY `time` DESC LIMIT 10");
while ($arr = mysql_fetch_array($req)) {
$q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "'");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "'");
$frm = mysql_fetch_array($q4);
?>
Copy code
Mở Forum/index.php
Find:
ADD đoạn sau vào:
Tìm:
<?php
echo '<div class="gmenu"><form action="index.php?act=nt&id=' . $id . '" method="post"><input type="submit" value="' . $lng_forum['new_topic'] . '" /></form></div>';
}
if ($total) {
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " AND `refid`='$id' ORDER BY `vip` DESC, `time` DESC LIMIT $start, $kmess");
?>
Copy code
Thay bằng:
<?php
echo '<div class="gmenu"><form action="index.php?act=nt&id=' . $id . '" method="post"><input type="submit" value="' . $lng_forum['new_topic'] . '" /></form></div>';
}
if ($total) {
$req = mysql_query("SELECT * FROM `forum` WHERE kiemduyet = '1' AND `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " AND `refid`='$id' ORDER BY `vip` DESC, `time` DESC LIMIT $start, $kmess");
?>
Copy code
Tìm:
<?php
echo isset($topic_vote) && $topic_vote > 0 ? '<a href="index.php?act=editvote&id=' . $id . '">' . $lng_forum['edit_vote'] . '</a>
<a href="index.php?act=delvote&id=' . $id . '">' . $lng_forum['delete_vote'] . '</a>
'
: '<a href="index.php?act=addvote&id=' . $id . '">' . $lng_forum['add_vote'] . '</a>
';
echo '<a href="index.php?act=ren&id=' . $id . '">' . $lng_forum['topic_rename'] . '</a>
';
?>
Copy code
Thay bằng:
<?php
if(!$type1['kiemduyet']) {
echo "<a href='index.php?act=kiemduyet&id=" . $id . "&kiemduyet'>Kiểm duyệt</a> | <a href='index.php?act=deltema&id=" . $id . "'>Loại bỏ</a>
";
}
echo isset($topic_vote) && $topic_vote > 0 ? '<a href="index.php?act=editvote&id=' . $id . '">' . $lng_forum['edit_vote'] . '</a>
<a href="index.php?act=delvote&id=' . $id . '">' . $lng_forum['delete_vote'] . '</a>
'
: '<a href="index.php?act=addvote&id=' . $id . '">' . $lng_forum['add_vote'] . '</a>
';
echo '<a href="index.php?act=ren&id=' . $id . '">' . $lng_forum['topic_rename'] . '</a>
';
?>
Copy code
Tìm tiếp:
<?php
if ($type1['close'])
echo '<div class="rmenu">' . $lng_forum['topic_delete_who'] . ': <b>' . $type1['close_who'] . '</b></div>';
elseif (!empty($type1['close_who']) && $rights >= 7)
echo '<div class="gmenu"><small>' . $lng_forum['topic_delete_whocancel'] . ': <b>' . $type1['close_who'] . '</b></small></div>';
?>
Copy code
Thay bằng:
<?php
if ($type1['close'])
echo '<div class="rmenu">' . $lng_forum['topic_delete_who'] . ': <b>' . $type1['close_who'] . '</b></div>';
elseif (!empty($type1['close_who']) && $rights >= 7)
echo '<div class="gmenu"><small>' . $lng_forum['topic_delete_whocancel'] . ': <b>' . $type1['close_who'] . '</b></small></div>';
// hien thi user kiem duyet
if (!empty($type1['kiemduyet_who'])) {
echo '<div class="gmenu">Chủ đề được kiểm duyệt bởi: <b>' . $type1['kiemduyet_who'] . '</b></div>';
}
?>
Copy code
Mở incfiles/head.php
Tìm:
<?php
if (!empty($ban))
echo '<div class="alarm">' . $lng['ban'] . ' <a href="' . $set['homeurl'] . '/users/profile.php?act=ban">' . $lng['in_detail'] . '</a></div>';
?>
Copy code
Chèn dưới:
<?php
if ($headmod != "kiemduyet" && $rights > 3) {
$kiemduyet = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' and kedit='0' AND `kiemduyet` != '1' AND `close`!='1'"), 0);
if ($kiemduyet > 0) {
echo "<div class=\"rmenu\" style='text-align: center'><a href='../users/kiemduyet.php'><b><font color='red'>Có $kiemduyet chủ đề đang chờ kiểm duyệt</font></b></a></div>";
}
}
?>
Copy code
Xong!