<?php

/* DCMS Special
 * Дата последнего редактирования 23.12.2015
 * Модифицировал densnet
 */

$k_p = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `gifts` WHERE `id_kont` = '$user[id]'"), 0);
$k_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts` WHERE `id_kont` = '$user[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);

$k_p1 = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `gifts` WHERE `id_kont` = '$user[id]'"), 0);
$k_n1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts` 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";
