Файл: EROCMS 11.2 ДЛЯ ADULT/Script/pages/editing.php
Строк: 84
<?php
/*
Автор скрипта https://bymas.ru/id85823
Скрипты, программы на заказ.
Быстро, качественно, недорого.
*/
if ($user['access'] < 1) {
header('location: /');
exit;
}
$view = $mysqli -> query("select * from ero_files where id = '".abs(intval($_GET['id']))."'") -> fetch_assoc();
if (!$view){
header('location: /');
exit;
}
$title = 'Редактирование видео '.$view['name'];
$description = $settings['description'];
$keywords = $settings['keywords'];
head();
if (isset($_POST['translit'])) {
$publish = strtotime($_POST['publish']) + rand(300, 21600);
$recoil = mysqli_real_escape_string($mysqli, filter($_POST['recoil']));
$address = mysqli_real_escape_string($mysqli, filter($_POST['address']));
$screenshot = mysqli_real_escape_string($mysqli, filter($_POST['screenshot']));
$translit = mysqli_real_escape_string($mysqli, filter($_POST['translit']));
$name = mysqli_real_escape_string($mysqli, filter($_POST['name']));
$tags = mysqli_real_escape_string($mysqli, filter($_POST['tags']));
$description = mysqli_real_escape_string($mysqli, filter($_POST['description']));
$category = mysqli_real_escape_string($mysqli, abs(intval($_POST['category'])));
$mysqli -> query("update ero_files set address = '$address', category = '$category', translit = '$translit', date = '$publish', recoil = '$recoil', screenshot = '$screenshot', name = '$name', tags = '$tags', description = '$description' where id = '$view[id]'");
$mysqli -> query("INSERT INTO ero_logs SET id_user = '$user[id]', act = 'Изменил видео $view[name].', id_file = '$view[id]', date = '".time()."'");
header('location: /watch/'.$translit.'.html');
exit;
}
?>
<p>Сервер <a href="/control.html?func=server&i=<?=$view['server']?>" target="_blank"><u><b><?=$view['server']?></b></u></a> </p>
<form method="post">
<p><b>Название</b> </p>
<p><input name="name" class="injected" type="text" value="<?=$view['name']?>"></p>
<p><b>Дата публикации</b> </p>
<p><input class="injected" name="publish" type="date" value="<?=date('Y-m-d', $view['date'])?>" min="2019-01-18" max="2020-12-31"></p>
<p><b>Адрес</b> </p>
<p> <big><b>/watch/</b></big>
<input name="translit" class="injected" type="text" value="<?=$view['translit']?>">.html</p>
<p><b>Прямая ссылка</b> [<a href="<?=$view['address']?>" target="_blank"><u><b>проверить</b></u></a>]</p>
<p><input name="address" class="injected" type="text" value="<?=$view['address']?>"></p>
<p><b>Категория</b> </p>
<p><select class="injected" name="category">
<?
$query = $mysqli -> query("select id, name from ero_categories order by id asc");
while($row = $query -> fetch_assoc()){
?>
<option value="<?=$row['id']?>" <?=($row['id']==$view['category']?" selected='selected'":null)?>><?=$row['name']?></option>
<?
}
?>
</select></p>
<p><b>Файл</b> </p>
<p><input name="recoil" class="injected" type="text" value="<?=$view['recoil']?>"></p>
<p><b>Фото</b> </p>
<p><input name="screenshot" class="injected" type="text" value="<?=$view['screenshot']?>"></p>
<p><b>Теги</b> </p>
<p><textarea name="tags" class="injected" rows="4" cols="47"><?=$view['tags']?></textarea></p>
<p><b>Описание</b> </p>
<p><textarea name="description" class="injected" rows="8" cols="47"><?=$view['description']?></textarea></p>
<input type="submit" class="byecos" value="Изменить">
<a onclick="history.back(); return false;" class="byecos">Вернуться назад</a>
</form>
<?
$query -> free();