This blob has been accessed 452 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- error_reporting(E_ERROR);
- require("core.php");
- if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
- }
- $login_username = file_get_contents("data/username.txt");
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
- }
- else {
- $offset = 0;
- }
- if (isset($_SESSION['logged_in']) and isset($_REQUEST['target']) and ($_REQUEST['target'] == "unread")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
- }
- if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread")) {
- rmdirr("data/comments/unread");
- }
- header("Location: .");
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['target']) and !empty($_REQUEST['target'])) {
- if ($_REQUEST['target'] == "album") {
- rmdirr("images/{$_REQUEST['entry']}/album");
- rmdirr("data/items/{$_REQUEST['entry']}/album");
- rmdirr("data/albums/{$_REQUEST['entry']}");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
- if ($_REQUEST['target'] == "filedrop") {
- rmdirr("data/items/{$_REQUEST['entry']}/filedrop");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
- rmdirr("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}");
- if (file_exists("data/comments/latest/$cmonth/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/latest/$cmonth/{$_REQUEST['entry']}");
- }
- if (file_exists("data/comments/pending/{$_REQUEST['entry']}") and ($_REQUEST['type'] == "pending")) {
- $comment_count_value = file_get_contents("data/comments/pending/{$_REQUEST['entry']}/count.txt");
- if ($comment_count_value <= 1) {
- rmdirr("data/comments/pending/{$_REQUEST['entry']}");
- }
- else {
- $comment_count_value = $comment_count_value - 1;
- }
- }
- header("Location: index.php?entry={$_REQUEST['entry']}&show=comments");
- }
- if ($_POST['action'] == "delete") {
- if (file_exists("data/comments/latest/$cmonth/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/latest/$cmonth/{$_REQUEST['entry']}");
- }
- if (file_exists("data/items/{$_REQUEST['entry']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}");
- }
- if (file_exists("images/{$_REQUEST['entry']}")) {
- rmdirr("images/{$_REQUEST['entry']}");
- }
- if (file_exists("data/albums/{$_REQUEST['entry']}")) {
- rmdirr("data/albums/{$_REQUEST['entry']}");
- }
- if (file_exists("data/sticky/{$_REQUEST['entry']}")) {
- unlink("data/sticky/{$_REQUEST['entry']}");
- }
- if (file_exists("data/comments/pending/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/pending/{$_REQUEST['entry']}");
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
- }
- if ($_POST['action'] == "edit") {
- header("Location: edit.php?entry={$_REQUEST['entry']}");
- }
- if ($_POST['action'] == "home") {
- header("Location: index.php");
- }
- }
- if (!isset($_REQUEST['entry'])) {
- }
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- }
- include("css.php");
- echo "\n<style>body { margin: {$maj_wspace}px; } .input, .click { width: 125px; }</style>\n";
- ?>
- <title>Delete</title>
- <p><table border="0" cellspacing="0" cellpadding="0">
- <tr><td valign="top">
- <table border="0" cellspacing="0" cellpadding="0"><tr><td width="520">
- readfile("$maj_data_directory/items/$maj_req_entry/title.txt");
- ?></div>
- echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if (file_exists("$maj_data_directory/items/$maj_req_entry/author.txt")) {
- readfile("$maj_data_directory/items/$maj_req_entry/author.txt");
- echo " - ";
- }
- entry2date($maj_req_entry);
- if (file_exists("$maj_data_directory/items/$maj_req_entry/revisions.txt")) {
- echo ' (Revision ';
- readfile("$maj_data_directory/items/$maj_req_entry/revisions.txt");
- echo " - ";
- echo date("l, M j, Y, g:i A", filemtime("$maj_data_directory/items/$maj_req_entry/body.txt"));
- echo ')';
- }
- echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
- readfile("$maj_data_directory/items/$maj_req_entry/body.txt");
- ?></td></tr></table></div></div>
- </td></tr></table>
- </p>
- <p><table border="0" cellspacing="2" cellpadding="0">
- <tr><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type="hidden" name="entry" value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="delete">
- <input class="click" type="submit" value="delete">
- </form>
- </td><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="edit">
- <input class="click" type="submit" value="edit">
- </form>
- </td><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="home">
- <input class="click" type="submit" value="home">
- </form>
- </td></tr>
- </table>