• 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.

Hướng dẫn thêm lượt xem chủ đề cho johncms chi tiết

Admin

Well-Known Member
Staff member
Administrator
Vào phpmyadmin, chọn SQL và chạy query sau
PHP:
alter table forum add view int(11) not null default '0';
Mở tập tin forum/index.php tìm
PHP:
echo '<p>' . ($id ? '<a href="index.php">' . $lng['to_forum'] . '</a><br />' : '');
if (!$id) {
echo '<a href="../pages/faq.php?act=forum">' . $lng_forum['forum_rules'] . '</a><br/>';
echo '<a href="index.php?act=moders">' . $lng['moders'] . '</a>';
}
echo '</p>';
if (!$user_id) {
if ((empty($_SESSION['uppost'])) || ($_SESSION['uppost'] == 0)) {
echo '<a href="index.php?id=' . $id . '&page=' . $page . '&newup">' . $lng_forum['new_on_top'] . '</a>';
} else {
echo '<a href="index.php?id=' . $id . '&page=' . $page . '&newdown">' . $lng_forum['new_on_bottom'] . '</a>';
}
}
}

require_once('../incfiles/end.php');
Thay bằng
PHP:
mysql_query("UPDATE forum SET view = view + 1 WHERE id = $id");
echo '<p>' . ($id ? '<a href="index.php">' . $lng['to_forum'] . '</a><br />' : '');
if (!$id) {
echo '<a href="../pages/faq.php?act=forum">' . $lng_forum['forum_rules'] . '</a><br/>';
echo '<a href="index.php?act=moders">' . $lng['moders'] . '</a>';
}
echo '</p>';
if (!$user_id) {
if ((empty($_SESSION['uppost'])) || ($_SESSION['uppost'] == 0)) {
echo '<a href="index.php?id=' . $id . '&page=' . $page . '&newup">' . $lng_forum['new_on_top'] . '</a>';
} else {
echo '<a href="index.php?id=' . $id . '&page=' . $page . '&newdown">' . $lng_forum['new_on_bottom'] . '</a>';
}
}
}

require_once('../incfiles/end.php');
Tìm tiếp
PHP:
echo '<div class="phdr"><a name="up" id="up"></a><a href="#down"><img src="../theme/' . $set_user['skin'] . '/images/down.png" alt="Вниз" width="20" height="10" border="0"/></a>  <b>' . $type1['text'] . '</b></div>';
Thay bằng
PHP:
echo '<div class="phdr"><a name="up" id="up"></a><a href="#down"><img src="../theme/' . $set_user['skin'] . '/images/down.png" alt="Вниз" width="20" height="10" border="0"/></a>  <b>' . $type1['text'] . '|'.$type1['view'].' Lượt xem </b></div>';
Nếu muốn hiện ngoài trang chủ thì vào mainmenu.php
Thêm vào chỗ muốn hiện lượt xem nhớ là phải trong
PHP:
while {
PHP:
Xem: ' . $arr['view'] . '
Còn trong chuyên mục thì
PHP:
Xem: ' . $res['view'] . '
Chúc các bạn thành công!
 

Similar threads

New posts New threads New resources

Back
Top