Mở forum/index.php
Tìm:
Thêm vào bên trên
Tìm tiếp:
Thêm bên dưới:
Tìm:
PHP:
##########Hết phần thanks!
// Счетчик постов темы
$colmes = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m'$sql AND `refid`='$id'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
if ($start > $colmes) $start = $colmes - $kmess;
PHP:
if ((isset ($_GET['unthank']))&&(isset ($_GET['user']))&&(isset ($_GET['unthanks']))) {
$checkthank = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $_GET['unthanks'] . '" and `user` = "' . $_GET['user'] . '"');
$thankcheck = mysql_result($checkthank, 0);
if ($thankcheck > 0 && $user_id != $_GET['user']) {
mysql_query("DELETE FROM `forum_thank` WHERE `user` = '".trim($_GET['user'])."' AND `userthank` = '$user_id' AND `topic` = '".trim($_GET['unthanks'])."'");
mysql_query("OPTIMIZE TABLE `forum_thank`");
$datathankuser = functions::get_user(trim($_GET['user']));
mysql_query("UPDATE `users` SET `thank_duoc`='" . ($datathankuser['thank_duoc'] - 1) . "' WHERE `id` = '" . trim($_GET['user']) . "'");
mysql_query("UPDATE `users` SET `thank_di`='" . ($datauser['thank_di'] - 1) . "' WHERE `id` = '" . $user_id . "'");
mysql_query("UPDATE `users` SET `postforum`='" . ($datathankuser['postforum'] - 3) . "' WHERE `id` = '" . trim($_GET['user']) . "'");
}
}
PHP:
$checkthank = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $res['id'] . '" and `user` = "' . $res['user_id'] . '"');
if ($user_id && $user_id != $res['user_id'] && (mysql_result($checkthank, 0) < 1)) {
PHP:
echo (mysql_result($checkthank, 0) == 1 ? '<a href="index.php?id=' . $id . '&unthanks=' . $res['id'] . '&user=' . $res['user_id'] . '&start=' . $start . '&unthank"><b><font color="black">Dislike</font></b></a>' : ' ');