• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Mod tiêu điểm johncms

wap5v

New Member
Giới thiệu: Mod giúp thành viên đưa bài viết lên làm tiêu điểm trong 1 thời gian nhất định
Hướng dẫn:
+ Gõ các đoạn code sau vào sql
Code:
            ALTER TABLE  `forum` ADD  `tieudiem` INT( 1 ) NOT NULL DEFAULT  '0' AFTER  `curators`
            ALTER TABLE  `forum` ADD  `timeout` INT( 11 ) NOT NULL DEFAULT  '0' AFTER  `curators`

Code:
            ALTER TABLE  `users` ADD  `tieudiem` INT( 1 ) NOT NULL DEFAULT  '1' AFTER  `smileys`

+ Mở mainmenu/pages.php tìm đoạn
PHP:
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1'....

(Chú ý đoạn code trên là mình lấy tương đối, đằng sau dấu .... đang là một đoạn code nữa, nhưng do mỗi người mod mỗi khác nên mình để dấu ...., các bạn tìm tương đương và nhớ là cái đầu tiên tìm được nhé)

Thêm vào trên nó:
PHP:
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1' AND `tieudiem`='1' ORDER BY `time` DESC LIMIT 3");
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);
$frm = mysql_fetch_array($q4);
$nikuser = mysql_query("SELECT `from`,`id`, `time` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $arr['id'] . "'ORDER BY time DESC");
$colmes1 = mysql_num_rows($nikuser);
$cpg = ceil($colmes1 / $kmess);
$nam = mysql_fetch_array($nikuser);
////////////////
$realtime = time();
if (($realtime - $arr['timeout']) > 7200)
mysql_query("UPDATE `forum` SET `timeout` = '0', `tieudiem`='0' WHERE `id` = '" . $arr['id'] . "'");
////////////////
$arr['text'] = html_entity_decode($arr['text'],ENT_QUOTES,'UTF-8');
echo is_integer($i / 2) ? '<div class="list1">' : '<div class="list2">';
echo '&raquo;';
if ($arr['realid'] == 1)
echo '&nbsp;<img src="../theme/' . $set_user['skin'] . '/images/hot.gif" alt=""/>';
echo '&nbsp;<a href="/forum/index.php?id=' . $arr['id'] . ($cpg > 1 && $_SESSION['uppost'] ? '&amp;clip&amp;page=' . $cpg : '') . '">' . bbcode::tags($arr['text']) . '</a>&nbsp;[' . $colmes1 . ']';
if ($cpg > 1)
echo '&nbsp;<a href="/forum/index.php?id=' . $arr['id'] . ($_SESSION['uppost'] ? '' : '&amp;clip&amp;page=' . $cpg) . '#' . $nam['id'].'">&gt;&gt;</a>';
echo '<div class="sub">';
echo '<font color="#ff00ff">';
echo $arr['from'];
echo '</font>';
if (!empty ($nam['from']))
{
echo '&nbsp;↔&nbsp;<font color="blue">' . $nam['from']. '</font><br/>';
}
echo '<span class="gray">(' . functions::display_date($res['time']) . ')</span></div></div>';
}
Thay số 7200 thành thời gian bạn muốn tiêu điểm hết tác dụng, thay file hot.gif

+ Upload files tieudiem.php vào forum/includes/
+ Mở forum/index.php tìm:
PHP:
    'restore',
    'say',
Thay thành
PHP:
    'restore',
    'say',
    'tieudiem',
Tìm tiếp:
PHP:
                if ($rights == 3 || $rights >= 6) {
                    if ($rights >= 7)
Thêm vào trên nó:
PHP:
                    if ($datauser['tieudiem'] != 0) echo '<a href="index.php?act=tieudiem&amp;id=' . $id . '">Đưa lên làm tiêu điểm</a><br />';
+ Save và test :D

Lẽ ra thôi chả ghi nguồn nữa, nhưng share cái mod này đồng thời open lại Forum support John nên các mod cho phép em ghi cái nguồn JohnCms.Cc :D
Cái mod này mình mới tách ra rồi share không biết có lỗi không, các bác test giúp :D
tieudiem.zip
 
Last edited by a moderator:
co phai giong wapvn ko thot. vao dau de chon chu de tieu diem.:)
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top