Файл: user/notification/count.php
Строк: 25
<?php
/* DCMS Special
* Дата последнего редактирования 15.12.2015
* Модифицировал densnet
*/
$k_p = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_kont` = '$user[id]'"), 0);
$k_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `notification` WHERE `id_kont` = '$user[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$k_p1 = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notifications` WHERE `id_kont` = '$user[id]'"), 0);
$k_n1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `notifications` WHERE `id_kont` = '$user[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$kp = $k_p + $kp1;
$kn = $k_n + $kn1;
if ($kn == 0) {
$kn = NULL;
} else {
$kn = " +$kn";
}
echo "$kp$kn";