Тема: Код счетчика (Движок DCMS-Social/Поиск скриптов) Nnm (1 May 2016 в 12:37) таблу оценок в студию Snork_Francev (1 May 2016 в 14:22) --Цитата-- Nnm (1 May 2016 в 12:37): таблу оценок в студию ---------- 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; ?> Zed (1 May 2016 в 14:24) --Цитата-- Snork_Francev (1 May 2016 в 14:22): 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, дцмс? [i]Добавлено:[/i] ---------------------- Все оценки ------------------------ <? 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) ; ?> Snork_Francev (1 May 2016 в 19:32) Zed, спасибо большое! Nnm (1 May 2016 в 19:43) Zed, а по фото идентификатор не вписал... без id_foto выведет общее число для всех фото юзверя Zed (1 May 2016 в 20:10) --Цитата-- Nnm (1 May 2016 в 19:43): Zed, а по фото идентификатор не вписал... без id_foto выведет общее число для всех фото юзверя ---------- Nnm, он сказал всех я то не знаю как ему надо. Источник: http://www.dcms-social.ru/forum/13/23/61542/