Добро пожаловать, Гость!
Код счетчика
Поиск скриптов | Код счетчика

Код счетчика
1 Мая 2016Реябта, Всем привет!
Это снова я

У кого есть код счетчика "все оценки" чтоб показывало например не только новые а еще и общее количество оценок пользователю?
Комментарии:



Nnm (1 Мая 2016):
Zed, а по фото идентификатор не вписал... без id_foto выведет общее число для всех фото юзверя
Nnm, он сказал всех я то не знаю как ему надо.Zed, а по фото идентификатор не вписал... без id_foto выведет общее число для всех фото юзверя


Zed, а по фото идентификатор не вписал... без id_foto выведет общее число для всех фото юзверя



Snork_Francev (1 Мая 2016):
Nnm,
<?
CREATE TABLE IF NOT EXISTS `gallery_rating` (
`id_foto` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`like` int(11) NOT NULL DEFAULT '0',
`avtor` int(11) NOT NULL DEFAULT '0',
`ready` int(11) NOT NULL DEFAULT '1',
`time` int(11) NOT NULL DEFAULT '0',
`read` int(1) DEFAULT '1',
KEY `id_foto` (`id_foto`,`id_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
?>
Snork_Francev, дцмс?Nnm,
<?
CREATE TABLE IF NOT EXISTS `gallery_rating` (
`id_foto` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`like` int(11) NOT NULL DEFAULT '0',
`avtor` int(11) NOT NULL DEFAULT '0',
`ready` int(11) NOT NULL DEFAULT '1',
`time` int(11) NOT NULL DEFAULT '0',
`read` int(1) DEFAULT '1',
KEY `id_foto` (`id_foto`,`id_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
?>
Добавлено:
----------------------
Все оценки
------------------------
<?
echo mysql_query(mysql_result("SELECT COUNT * FROM `gallery_rating` WHERE `id_user` = '".$ank['id']."' "),0) ;
?>
-------------------------------
Новые
------------------------------
<?
echo mysql_query(mysql_result("SELECT COUNT * FROM `gallery_rating` WHERE `id_user` = '".$ank['id']."' AND `time` > '".(time() - (3600 * 24))."' "),0) ;
?>

Автор темы
Nnm (1 Мая 2016):
таблу оценок в студию
Nnm, таблу оценок в студию
<?
CREATE TABLE IF NOT EXISTS `gallery_rating` (
`id_foto` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`like` int(11) NOT NULL DEFAULT '0',
`avtor` int(11) NOT NULL DEFAULT '0',
`ready` int(11) NOT NULL DEFAULT '1',
`time` int(11) NOT NULL DEFAULT '0',
`read` int(1) DEFAULT '1',
KEY `id_foto` (`id_foto`,`id_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
?>