This blob has been accessed 359 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- error_reporting(E_ERROR);
- if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)){
- foreach ($data as $key => $value){
- $data[$key] = stripslashes_array($value);
- }
- return $data;
- }
- else{
- return stripslashes($data);
- }
- }
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- $login_username = file_get_contents("data/username.txt");
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- }
- function rmdirr($recurse_dirname) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
- rmdirr("$recurse_dirname/$recurse_entry");
- }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
- }
- ?>
- <style>
- body {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial, helvetica, sans-serif;
- background-color: #ffffff;
- }
- p, td {
- font-size: 11px;
- }
- a {
- font-weight: bold;
- text-decoration: none;
- }
- a:link, a:visited {
- color: #666666;
- }
- a:hover {
- color: #336699;
- }
- a:active {
- color: #336699;
- }
- .input {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 200px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px
- }
- </style>
- <table border=0 cellspacing=1 cellpadding=1>
- <form action=move.php method=post>
- <tr><td>entry</td><td><input type=text class=input name=entry maxlength=14 <?php
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- echo "value=";
- echo trim($_REQUEST['entry']);
- echo " ";
- }
- ?>autocomplete=off></td></tr>
- <?php
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
- echo "<tr><td>comment </td><td><input type=text class=input name=comment maxlength=14 value=";
- echo trim($_REQUEST['comment']);
- echo " autocomplete=off><input type=hidden name=type value={$_REQUEST['type']}></td></tr>";
- }
- ?>
- <tr><td>target </td><td><input type=text class=input name=target maxlength=14 autocomplete=off></td></tr>
- <tr><td></td><td><input type=submit class=input value="click here to move <?php
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment'])) {
- echo "comment";
- }
- else {
- echo "entry";
- }
- ?>"></td></tr>
- </form>
- <form action=index.php method=post>
- <tr><td></td><td><input type=submit class=input value="click here to go to the index page"></td></tr>
- </form>
- </table>
- <?php
- if (!isset($_REQUEST['entry']) or empty($_REQUEST['entry']) or !isset($_REQUEST['target']) or empty($_REQUEST['target'])) {
- }
- $entry = trim($_REQUEST['entry']);
- $target = trim($_REQUEST['target']);
- if (!file_exists("data/items/$entry") or !file_exists("data/items/$target")) {
- }
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "live")) {
- $comment = trim($_REQUEST['comment']);
- if (!file_exists("data/items/$entry/comments/live/$comment")) {
- }
- if (!file_exists("data/items/$target/comments/live/$entry")) {
- if (!file_exists("data/items/$target/comments")) {
- mkdir("data/items/$target/comments");
- }
- if (!file_exists("data/items/$target/comments/live")) {
- mkdir("data/items/$target/comments/live");
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '?entry=' . $target . '&show=comments');
- }
- }
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pending")) {
- $comment = trim($_REQUEST['comment']);
- if (!file_exists("data/items/$entry/comments/pending/$comment")) {
- }
- if (!file_exists("data/items/$target/comments/pending/$entry")) {
- if (!file_exists("data/items/$target/comments")) {
- mkdir("data/items/$target/comments");
- }
- if (!file_exists("data/items/$target/comments/pending")) {
- mkdir("data/items/$target/comments/pending");
- }
- rename("data/items/$entry/comments/pending/$comment","data/items/$target/comments/pending/$comment");
- if (file_exists("data/comments/pending/$entry/count.txt")) {
- $count = file_get_contents("data/comments/pending/$entry/count.txt");
- if ($count <= 1) {
- rmdirr("data/comments/pending/$entry");
- }
- else {
- $count = $count - 1;
- }
- }
- if (file_exists("data/comments/pending/$target/count.txt")) {
- $count = file_get_contents("data/comments/pending/$target/count.txt");
- $count = $count + 1;
- }
- else {
- $count = 1;
- }
- if (!file_exists("data/comments/pending/$target")) {
- mkdir("data/comments/pending/$target");
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '?entry=' . $target . '&show=comments');
- }
- }
- if ((!isset($_REQUEST['comment']) or empty($_REQUEST['comment'])) and (!isset($_REQUEST['type']) or empty($_REQUEST['type'])) and !file_exists("data/items/$target/comments/live/$entry")) {
- if (!file_exists("data/items/$target/comments")) {
- mkdir("data/items/$target/comments");
- }
- if (!file_exists("data/items/$target/comments/live")) {
- mkdir("data/items/$target/comments/live");
- }
- rename("data/items/$target/comments/live/$entry/body.txt","data/items/$target/comments/live/$entry/comment.txt");
- rename("data/items/$target/comments/live/$entry/date.txt","data/items/$target/comments/live/$entry/timestamp.txt");
- $author = file_get_contents(data/items/$target/comments/live/$entry/author.txt);
- copy("data/members/active/$author/firstname.txt","data/items/$target/comments/live/$entry/firstname.txt");
- copy("data/members/active/$author/lastname.txt","data/items/$target/comments/live/$entry/lastname.txt");
- copy("data/members/active/$author/email.txt","data/items/$target/comments/live/$entry/email.txt");
- if (file_exists("data/members/active/$author/url.txt")) {
- copy("data/members/active/$author/url.txt","data/items/$target/comments/live/$entry/url.txt");
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '?entry=' . $target . '&show=comments');
- }
- ?>