Файл: Arhmobi_esdcms/pages/chit.php
Строк: 33
<?php
include_once '../sys/inc/start.php';
$doc = new document(1); // инициализация документа для браузера
$ank = (empty($_GET ['id'])) ? $user : new user((int) $_GET ['id']);
if (!$ank->group)
$doc->access_denied(__('Нет данных'));
$doc->title = $ank->id == $user->id ? __('Мои читатели') : __('Читатели %s', $ank->login);
$pages = new pages($db->query("SELECT COUNT(*) FROM `chit` WHERE `id_friend` = '" . $ank->id . "'")->fetchColumn());
$pages->this_page();
$listing = new listing();
$q = $db->query("SELECT * FROM `chit` WHERE `id_friend` = '" . $ank->id . "' ORDER BY `time` DESC LIMIT " . $pages->limit);
if ($arr = $q->fetchAll()) {
foreach ($arr AS $chit) {
$chit_ank = new user($chit['id_user']);
$post = $listing->post();
$post->hightlight = $chit['read'];
$post->url = '/profile.view.php?id=' . $chit_ank->id;
$post->image = $chit_ank->ava();
$post->title = $chit_ank->nick();
$res = $db->prepare("UPDATE `mynews` SET `read` = ? WHERE `id` = ? LIMIT 1");
$res->execute(Array(0, $mynews['id']));
}
}
$listing->display(__('Читатели отсутствуют'));
$pages->display('?'); // вывод страниц