File size: 5.38Kb
<?php
Defined('ADMIN_S_S') or die ('Доступ запрещен!!!');
if ($_POST['step'] == 1 or $_POST['step'] == '')
{
$st_r = 10;
if (is_file('moduls/page/base/pages.txt')) $post = @file('moduls/page/base/pages.txt'); else echo 'Ошибка';
$count_post = count($post);
if (empty($_GET['pages'])) {
$pages = 1;
} else {
$pages = (int) $_GET['pages'];
}
$j = ($count_post-1)-(($pages-1)*$st_r);
$i = $j-$st_r;
for(; $i<$j && $j>=0; $j--)
{
$fn = explode("|",$post[$j]);
echo '
<table
style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="text-align: left; vertical-align: top;"><span class="mess1">'.$fn[0].'</span> <span class="mess2">'.substr($fn[3],0,250).'</span> </td>
<td style="width: 55px; text-align: right; vertical-align: top;">
<form name="" action="" method="post">
<input name="line" type="hidden" value="'.$j.'">
<input name="step" type="hidden" value="2">
<input class="knopka" type="submit" value="Выбрать">
</form></td>
</tr>
</tbody>
</table>
<br>
';
}
echo 'Страницы: '."\n";
$all = ceil($count_post/$st_r);
for ($i=1;$i<=$all;$i++) {
if ($pages==$i) {
echo '<b>'.$i.'</b> ';
} else {
echo '<a href="/admin.php?id='.trim($_GET['id']).'&pages='.$i.'">'.$i.'</a> '."";
}
}
}
elseif ($_POST['step'] == 2)
{
if (is_file('moduls/page/base/pages.txt')) $post = @file('moduls/page/base/pages.txt'); else echo 'Ошибка';
$ex = explode('|',$post[$_POST['line']]);
$ex[1] = str_replace('<br>',"\r\n",$ex[1]);
$mess1 = $ex[0];
include('flud/anti_y.php');
$name = $mess1;
$mess1 = $ex[3];
include('flud/anti_y.php');
$mess11 = $mess1;
$mess1 = $ex[5];
include('flud/anti_y.php');
$mess12 = $mess1;
$mess1 = $ex[6];
include('flud/anti_y.php');
$mess13 = $mess1;
$mess1 = $ex[4];
include('flud/anti_y.php');
$mess14 = $mess1;
include('flud/js/bb.php');
include('flud/js/smyle.php');?>
<script src="moduls/page/edit.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
<span class="ramka">
<form name="" action="" method="post">
Заголовок:<br>
<input name="name" type="text" value="<?php echo $name ?>"><br />
Cама страница:<br>
<?php
$ms_pol = 'mess11';
include('flud/js/smyler.php');
$ms_pol = 'mess11';
include('flud/js/bber.php');?>
<textarea style="width:100%;" name="mess11" rows=10 cols=55><?php echo $mess11 ?></textarea><br />
Описание страницы:<br>
<?php
$ms_pol = 'mess12';
include('flud/js/smyler.php');
$ms_pol = 'mess12';
include('flud/js/bber.php');?>
<textarea style="width:100%;" name="mess12" rows=10 cols=55><?php echo $mess12 ?></textarea><br />
Ключевые слова:<br>
<?php
$ms_pol = 'mess13';
include('flud/js/smyler.php');
$ms_pol = 'mess13';
include('flud/js/bber.php');?>
<textarea style="width:100%;" name="mess13" rows=10 cols=55><?php echo stripslashes($mess13) ?></textarea><br />
Подключаемый скрипт<span style="color: #FF0000;">*</span>:<br>
<textarea style="width:100%;" name="mess14" rows=2 cols=55><?php echo $mess14 ?></textarea><br />
Введите этот код в поле ниже:<br>
<?php
srand();
$a = rand(1000,9000);
echo 'x<sup><span style="background-color:#FFFF80;">'.$a.'</span></sup>';
?>
<br>
<input name="capt" type="text" value="<?php echo $a?>">
<input name="capt2" type="hidden" value="<?php echo $a;?>"><br>
<br><input class="knopka" type="submit" value="Послать">
<input name="pokas" type="hidden" value="2">
<input name="line" type="hidden" value="<?php echo $_POST['line']?>">
<input name="step" type="hidden" value="3">
</form>
</span>
<?php
}
elseif ($_POST['step'] == 3)
{
if (($_POST['name'] != "") and ($_POST['mess11'] != ""))
{
$mess1 = $_POST['mess11'];
include('flud/anti_x.php');
$mess11 = $mess1;
$mess1 = $_POST['mess12'];
include('flud/anti_x.php');
$mess12 = $mess1;
$mess1 = $_POST['mess13'];
include('flud/anti_x.php');
$mess13 = $mess1;
if ((($_POST['mess14'] != '') or ($_POST['mess14'] == '0')) and (is_file('moduls/page/my_php/'.$_POST['mess14'].'.php')) )
{
$mess1 = $_POST['mess14'];
include('flud/anti_x.php');
$mess14 = $mess1;
}
else
{
$mess14 = '0';
}
$mess1 = $_POST['name'];
include('flud/anti_x.php');
$name = $mess1;
$line = $_POST['line'];// строка
$rep = ''.$name.'|'.date("d/m/Y").'|Администратор|'.stripslashes($mess11).'|'.$mess14.'|'.$mess12.'|'.$mess13."\r\n"; //на что заменить
$file = @file('moduls/page/base/pages.txt'); //загоняем файл в массив $file
$count = count($file); //подсчитываем количество строк
$fp = fopen('moduls/page/base/pages.txt',"w");//очищаем файл
for($i=0;$i<$count;$i++) //создаём цикл, кол-во оборотов равно количиству строк в файле
{
if($i!=$line)
{
fwrite($fp,$file[$i]);
}
else
{
fwrite($fp,$rep);
echo '
<span class="ramka">
Успешно!
</span>
<META HTTP-EQUIV="Refresh" CONTENT="1;">
';
}
}
fclose($fp); //закончили работать с файлом
}
else
{
echo 'Ошибка. Поля не заполнены полностью...';
}
}
?>