Файл: Dvig/wall.php
Строк: 11
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru ##
####################
define( 'xcms_pro', 1 ) ;
$path = '' ;
$title = 'Стена';
include_once ( $path . 'core/core.php' ) ;
include_once( $path.'core/head.php');
#########
if ( isset( $_GET['del'] ) )
{
header("location: wall.php");
$dels = protect($_GET['id']);
$post = mysql_fetch_array(mysql_query('SELECT * FROM `core_wall` WHERE `id`='.$dels.''));
if($users['id'] == $post['komu'] or $users['level'] == '5'){
mysql_query("DELETE FROM `core_wall` WHERE `id` = '" . $dels . "' LIMIT 1");
$_SESSION['ok'] = 'Сообщение удалено<br/>';
echo'<a id="nav" href="wall.php?id='.$post['komu'].'">Далее</a>';
}else{echo'<div id="error">Это запись не для вас</div>';}
}
if($id){
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `core_wall` WHERE `komu`='$id'"), 0);}
else
{$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `core_wall` WHERE `komu`='$users[id]'"), 0);}
$k_page=k_page($total,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($total !== '0') {
echo'<div id="razd">'.$title.'</div>';
if($id){$mys = mysql_query("SELECT * FROM `core_wall` WHERE `komu`='$id' order by `time` DESC LIMIT $start, $set[p_str]");}else{
$mys = mysql_query("SELECT * FROM `core_wall` WHERE `komu`='$users[id]' order by `time` DESC LIMIT $start, $set[p_str]");}
while ($res = mysql_fetch_array($mys)) {
$uses = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id`='.$res['author'].''));
echo '<div id="body"><a href="'.$res['author'].'">'.$uses['login'].'</a><br>
<small>'.clock($res['time']).'</small>';
if(!$id){
if($users){echo' [<a href="?del&id='.$res['id'].'">x</a>]';}}else{
if($users['level'] == '5'){echo' [<a href="?del&id='.$res['id'].'">x</a>]';}}
echo'<br>
'.bb(smiles(check($res['text']))).'</div>
';}
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
} else {echo '<div id="razd">Записей нет</div>';}
#########
include_once ( $path . 'core/foot.php' ) ;
?>