Файл: Arhmobi_esdcms/pages/actions.php
Строк: 36
<?php
include_once '../sys/inc/start.php';
$doc = new document();
$doc->title = __('Действия');
if (!isset($_GET ['id']) || !is_numeric($_GET ['id'])) {
$doc->toReturn('./');
$doc->err(__('Ошибка выбора сообщения'));
exit();
}
$id_message = (int) $_GET ['id'];
$q = $db->prepare("SELECT * FROM `stena` WHERE `id` = ? LIMIT 1");
$q->execute(Array($id_message));
if (!$message = $q->fetch()) {
$doc->toReturn('./');
$doc->err(__('Сообщение не найдено'));
exit();
}
$listing = new listing;
$ank = new user($message['id_user']);
$post = $listing->post();
$post->title = $ank->nick();
$post->content = text::toOutput($message['text']);
$post->time = misc::when($message['time']);
$post->icon($ank->icon());
$post = $listing->post();
$post->title = __('Посмотреть анкету');
$post->icon('ank_view');
$post->url = '/profile.view.php?id=' . $ank->id;
if ($user->group) {
$post = $listing->post();
$post->title = __('Ответить');
$post->icon('reply');
$post->url = '/profile.view.php?id='.$user->id.'?message=' . $id_message . '&reply';
$post = $listing->post();
$post->title = __('Цитировать');
$post->icon('quote');
$post->url = '/profile.view.php?id='.$user->id.'?message=' . $id_message . '&quote';
}
if ($user->group >= 2) {
$post = $listing->post();
$post->title = __('Удалить сообщение');
$post->icon('delete');
$post->url = '/profile.view.php?id='.$user->id.'?id=' . $id_message;
}
$listing->display();
$doc->ret(__('Вернуться'), './');
?>