Файл: Arhmobi_esdcms/pages/mynews.php
Строк: 31
<?php
include_once '../sys/inc/start.php';
$doc = new document(1); // инициализация документа для браузера
$pages = new pages($db->query("SELECT COUNT(*) FROM `mynews` WHERE `id_kont` = '" . $user->id . "'")->fetchColumn());
$pages->this_page();
$listing = new listing();
$q = $db->query("SELECT * FROM `mynews` WHERE `id_kont` = '" . $user->id . "' ORDER BY `time` DESC LIMIT " . $pages->limit);
if ($arr = $q->fetchAll()) {
foreach ($arr AS $mynews) {
$ank2 = new user($mynews['id_user']);
$post = $listing->post();
$post->hightlight = $mynews['read'];
$post->url = '/profile.view.php?id=' . $ank2->id;
$post->image = $ank2->ava();
$post->title = $ank2->nick();
$post->content = text::toOutput($mynews['msg']);
$res = $db->prepare("UPDATE `mynews` SET `read` = ? WHERE `id` = ? LIMIT 1");
$res->execute(Array(1, $mynews['id']));
}
}
$listing->display(__('Новостей нет'));
$pages->display('?'); // вывод страниц