if(isset($_GET['st'])) {
?>
//Новостная лента
if ($p==1) {
$sp = mysql_query('SELECT * FROM `events_news` WHERE (`r` = "'.mysql_real_escape_string($p_my[0]).'" or `r` = "'.mysql_real_escape_string($p_my[1]).'") AND `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
}elseif($p==2){
$sp = mysql_query('SELECT * FROM `events_news` WHERE `r` = "'.mysql_real_escape_string($p).'" AND `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
} else {
$sp = mysql_query('SELECT * FROM `events_news` WHERE `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
}
$pl = mysql_fetch_array($sp);
if(isset($pl['id'])) {
if($url[3] == 'delete') {
if($url[4] > 0) {
//Удаляем комментарий
mysql_query('UPDATE `events_news` SET `delete` = "1" WHERE `id` = "'.mysql_real_escape_string($url[4]).'" LIMIT 1');
mysql_query('UPDATE `events_news` SET `comments` = `comments` - 1 WHERE `id` = "'.mysql_real_escape_string($url[2]).'" LIMIT 1');
}elseif(!isset($url[4])){
//Удаляем новость
mysql_query('UPDATE `events_news` SET `delete` = "1" WHERE `id` = "'.mysql_real_escape_string($url[2]).'" LIMIT 1');
unset($pl);
}
}
}
if(isset($pl['id'])){
if(isset($u['id']) && $add[0]==1) {
if(isset($_POST['text_com']) && str_replace(' ','',str_replace(' ','',$_POST['text_com'])) != '') {
$_POST['text_com'] = htmlspecialchars($_POST['text_com'], NULL , 'cp1251');
if($u['admin'] == 0) {
$_POST['text_com'] = substr($_POST['text_com'], 0, 2048);
}
$_POST['text_com'] = str_replace("\n",'
',$_POST['text_com']);
mysql_query('INSERT INTO `events_news` (`login`,`level`,`align`,`clan`,`ip`,`city`,`cityreg`,`r`,`time`,`uid`,`title`,`text`,`comment`) VALUES (
"'.$u['login'].'",
"'.$u['level'].'",
"'.$u['align'].'",
"'.$u['clan'].'",
"'.$u['ip'].'",
"'.$u['city'].'",
"'.$u['cityreg'].'",
"'.$pl['r'].'","'.time().'","'.$u['id'].'","","'.mysql_real_escape_string($_POST['text_com']).'","'.$pl['id'].'")');
mysql_query('UPDATE `events_news` SET `comments` = `comments` + 1 WHERE `id` = "'.$pl['id'].'" LIMIT 1');
$pl['comments']++;
//header('location: https://new-combats.com/n/'.$pl['id'].'/#cmnt');
//die('
');
if ($p==1) {
$sp = mysql_query('SELECT * FROM `events_news` WHERE (`r` = "'.mysql_real_escape_string($p_my[0]).'" or `r` = "'.mysql_real_escape_string($p_my[1]).'") AND `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
}elseif($p==2){
$sp = mysql_query('SELECT * FROM `events_news` WHERE `r` = "'.mysql_real_escape_string($p).'" AND `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
} else {
$sp = mysql_query('SELECT * FROM `events_news` WHERE `delete` = "0" AND `comment` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['st']).'" LIMIT 1');
}
$pl = mysql_fetch_array($sp);
}
}
?>
|
if($u['admin']>0) { ?>
} ?>
|
|
|
|
0){ ?> id="editable=$pl['id']?>" contenteditable="true" } ?>>
=$pl['text']?>
|
|
|
|
if($pl['comments'] > 20) { ?>
Показать еще комментарии
} ?>
$pxc = ($pl['comments']-20);
if($pxc < 1) { $pxc = 0; }
$spc = mysql_query('SELECT * FROM `events_news` WHERE `comment` = "'.$pl['id'].'" AND `delete` = "0" ORDER BY `id` ASC LIMIT '.$pxc.' , 20');
while($plc = mysql_fetch_array($spc)) {
?>
if($u['admin'] > 0 || in_array($u['align'], $pal_al) || in_array($u['align'], $pal_al)) { ?>
} ?>
|
=date('d.m.Y H:i',$plc['time'])?> |
|
0){ ?> id="editable=$plc['id']?>" contenteditable="true" } ?>>=$plc['text']?>
|
|
if($u['admin'] > 0 ) {
?>
}
?>
} ?>
if($add[0] == 1) { ?>
} else {
if($add[0] == -1) {
echo '
Необходимо авторизироваться';
} elseif($add[0] == -2) {
echo '
Вы заблокированы, либо на Вас наложено заклятие молчания.';
} elseif($add[0] == -3) {
echo '
Задержка на отправку комментариев. (Осталось: менее одной минуты)';
} elseif($add[0] == -4) {
echo '
Оставлять комментарии разрешено только персонажам достигшим 5-го уровня';
}
}?>
if($u['admin'] > 0 ) {
?>
}
?>
}else{ echo 'Статья не найдена.'; } ?>
}elseif($p != 5 && $p != 6) {
/*
*/
?>
//Новостная лента
//$sp = mysql_query('SELECT * FROM `events_news` WHERE `r` = "'.mysql_real_escape_string($p).'" AND `delete` = "0" AND `comment` = "0" ORDER BY `time` DESC LIMIT '.((int)(10*$pg)).' , 10');
if ($p==1) {
$sp = mysql_query('SELECT * FROM `events_news` WHERE (`r` = "'.mysql_real_escape_string($p_my[0]).'" or `r` = "'.mysql_real_escape_string($p_my[1]).'") AND `delete` = "0" AND `comment` = "0" ORDER BY `time` DESC LIMIT '.((int)(10*$pg)).' , 10');
}elseif($p==2){
$sp = mysql_query('SELECT * FROM `events_news` WHERE `r` = "'.mysql_real_escape_string($p).'" AND `delete` = "0" AND `comment` = "0" ORDER BY `time` DESC LIMIT '.((int)(10*$pg)).' , 10');
} else {
$sp = mysql_query('SELECT * FROM `events_news` WHERE `delete` = "0" AND `comment` = "0" ORDER BY `time` DESC LIMIT '.((int)(10*$pg)).' , 10');
}
while($pl = mysql_fetch_array($sp)) {
?>
|
if($u['admin']>0) { ?>
} ?>
|
|
|
|
0){ ?> id="editable=$pl['id']?>" contenteditable="true" } ?>>
=$pl['text']?>
|
|
|
|
if($u['admin'] > 0 ) {
?>
}
?>
} ?>
} ?>
if($p != 5 && $p != 6) {
$cnt = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `events_news` WHERE `r` = "'.mysql_real_escape_string($p).'" AND `delete` = "0" AND `comment` = "0"'));
?>