This blob has been accessed 315 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- $username_file = 'data/username.txt';
- 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);
- }
- if (isset($_REQUEST['title_input']) and isset($_REQUEST['body_input'])) {
- header("Location: http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?entry=" . $_REQUEST['entry']);
- }
- if (!isset($_REQUEST['entry'])) {
- }
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- }
- $title_file = 'data/items/' . $_REQUEST['entry'] . '/title.txt';
- $body_file = 'data/items/' . $_REQUEST['entry'] . '/body.txt';
- $date_file = 'data/items/' . $_REQUEST['entry'] . '/date.txt';
- $img_file = 'data/items/' . $_REQUEST['entry'] . '/image.txt';
- $revisions_file = 'data/items/' . $_REQUEST['entry'] . '/revisions.txt';
- $image_path = "images/";
- $max_image_size = 2000000;
- $max_file_size = 2000000;
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- if (!file_exists($category_check)) {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
- }
- ?>
- <style>
- body
- {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: verdana, helvetica, sans-serif;
- background-color: #FFFFFF;
- }
- p
- {
- 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_title {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 525px;
- font-family: verdana,helvetica,sans-serif;
- font-size: 11px;
- font-weight: bold
- }
- .input_body {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 525px;
- font-family: verdana,helvetica,sans-serif;
- font-size: 11px
- }
- #panel_title
- {
- font-family: verdana, helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
- }
- #panel_body
- {
- font-family: verdana, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 1px 1px 1px 1px;
- border-style: solid solid solid solid;
- }
- #panel_footer
- {
- font-family: verdana, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 0px 1px 1px 1px;
- border-style: none solid solid solid;
- }
- </style>
- <?php
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['comment_txt']) and !empty($_REQUEST['comment_txt'])) {
- $comment_txt = ucfirst($_REQUEST['comment_txt']);
- $comment_txt = htmlentities($comment_txt, ENT_NOQUOTES);
- // $comment_txt = str_replace('href=', 'rel=nofollow target=_blank href=', $comment_txt);
- $comment_txt = str_replace("\n", '<br />', $comment_txt);
- $comment_txt = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $comment_txt);
- $comment_txt = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $comment_txt);
- $comment_txt = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $comment_txt);
- $comment_txt = str_replace(':D', '<img src=images/smileys/laughing.png border=0>', $comment_txt);
- $comment_txt = str_replace(':P', '<img src=images/smileys/lick.png border=0>', $comment_txt);
- $comment_txt = str_replace(':O', '<img src=images/smileys/ohno.png border=0>', $comment_txt);
- $comment_txt = str_replace(':)', '<img src=images/smileys/smile.png border=0>', $comment_txt);
- $comment_txt = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $comment_txt);
- $comment_txt = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $comment_txt);
- $comment_txt = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $comment_txt);
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/comment.txt";
- chmod($comment_txt_file, 0666);
- $comment_revisions_file = "data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/revisions.txt";
- $comment_revisions_count = $comment_revisions_count + 1;
- chmod($comment_revisions_file, 0666);
- }
- if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment'])) { ?>
- <p><table border=0 cellspacing=0 cellpadding=0 bgcolor=#CCCCCC><tr><td width=525>
- <div id=panel_title><?php readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/firstname.txt"); ?> <?php readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/lastname.txt"); ?> <<?php readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/email.txt"); ?>></div>
- <div id=panel_body><?php readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/comment.txt"); ?></div>
- <?php
- readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/timestamp.txt");
- if (file_exists("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/revisions.txt")) {
- echo " (Revision ";
- readfile("data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/revisions.txt");
- echo ")";
- }
- ?>
- </font></div>
- </td></tr></table></p>
- <p><table border=0 cellspacing=2 cellpadding=0>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <tr><td><textarea class=input_body name=comment_txt rows=10><?php
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/live/{$_REQUEST['comment']}/comment.txt";
- $comment_smiley2emoticon = str_replace('<br />', "\n", $read_comment_txt_file);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/crying.png border=0>', ':((', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/frown.png border=0>', ':(', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/indifferent.png border=0>', ':|', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/laughing.png border=0>', ':D', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/lick.png border=0>', ':P', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/ohno.png border=0>', ':O', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/smile.png border=0>', ':)', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/surprised.png border=0>', '=)', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/undecided.png border=0>', ':\\', $comment_smiley2emoticon);
- $comment_smiley2emoticon = str_replace('<img src=images/smileys/wink.png border=0>', ';)', $comment_smiley2emoticon);
- echo $comment_smiley2emoticon;
- ?></textarea></td></tr>
- <tr><td><input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>"></td></tr>
- <tr><td><input type=hidden name=comment value="<?php echo $_REQUEST['comment']; ?>"></td></tr>
- <tr><td><input class=input_body type=submit value="click here to update this comment"></td></tr>
- </form>
- <form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
- <tr><td><input class=input_body type=submit value="click here to go to the index page"></td></tr>
- </form>
- </table></p>
- <?php
- }
- ?>
- <p><table border=0 cellspacing=0 cellpadding=0 bgcolor=#CCCCCC><tr><td width=525>
- <div id=panel_footer><font style="font-size: 10px; color: #999999;"><?php readfile($date_file); ?><?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists($revisions_file)) {
- echo ' (Revision ';
- readfile($revisions_file);
- echo ')';
- }
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- echo ' Filed under ';
- $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
- }
- }
- ?></font></div>
- </td></tr></table></p>
- <p>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_image_size; ?>">
- <input autocomplete=off type=file name=album_image_input> Upload optional album image. Enter optional caption below.</p>
- <p><input autocomplete=off type=text name=caption class=input_body></p>
- <p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
- <input autocomplete=off type=file name=entry_image_input> Upload optional entry image.</p>
- <p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
- <input autocomplete=off type=file name=file_input> Upload optional file.</p>
- <?php
- if (file_exists("data/categories")) {
- if ($dh_cat = opendir("data/categories")) {
- while (($entry_cat = readdir($dh_cat)) !== false) {
- if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
- $show_cat[] = $entry_cat;
- }
- }
- closedir($dh_cat);
- }
- sort($show_cat);
- reset($show_cat);
- $count_cat = count($show_cat);
- if ($count_cat > 0) {
- echo "<p><select name=category><option selected>";
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- readfile("data/items/{$_REQUEST['entry']}/category.txt");
- echo '<option>unfiled';
- }
- else {
- echo "unfiled";
- }
- foreach ($show_cat as $category) {
- echo "<option>";
- echo strtolower($category);
- }
- echo "</select> Select category.</p>";
- }
- }
- ?>
- <p><input type=checkbox name=sticky <?php $sticky_sem = 'data/sticky/' . $_REQUEST['entry']; if (file_exists($sticky_sem)) { echo checked; } ?>>Put entry title in Links box.<br>
- <input type=checkbox name=display <?php $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt"; if (file_exists($display_sem)) { echo checked; } ?>>Always display. If this is not a private entry, it will be displayed even if its category is hidden or isolated.<br>
- <input type=checkbox name=private <?php $private_sem = "data/items/{$_REQUEST['entry']}/private.txt"; if (file_exists($private_sem)) { echo checked; } ?>>Private entry. This entry will unconditionally be invisible to visitors, even if always display is set.</p>
- <input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>">
- <table border=0 cellspacing=0 cellpadding=0><tr><td>
- <table border=0 cellspacing=2 cellpadding=0>
- <tr><td><input autocomplete=off class=input_title type=text name=title_input value="<?php readfile($title_file); ?>"></td></tr>
- <tr><td><textarea class=input_body name=body_input rows=15>
- <?php
- $body_read_content = str_replace('<br />', "\n", $read_body_file);
- $body_read_content = str_replace('<img src=images/smileys/crying.png border=0>', ':((', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/frown.png border=0>', ':(', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/indifferent.png border=0>', ':|', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/laughing.png border=0>', ':D', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/lick.png border=0>', ':P', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/ohno.png border=0>', ':O', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/smile.png border=0>', ':)', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/surprised.png border=0>', '=)', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/undecided.png border=0>', ':\\', $body_read_content);
- $body_read_content = str_replace('<img src=images/smileys/wink.png border=0>', ';)', $body_read_content);
- echo $body_read_content;
- ?>
- </textarea></td></tr>
- <tr><td><input class=input_body type=submit value="click here to update this entry"></td></tr>
- </form>
- <form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
- <tr><td><input class=input_body type=submit value="click here to go to the index page"></td></tr>
- </form>
- </table>
- </td><td width=10></td><td>
- <table border=0 cellspacing=1 cellpadding=2>
- <tr><td><img src=images/smileys/crying.png border=0></td><td><p>:((</p></td><td ><p>crying</p></td></tr>
- <tr><td><img src=images/smileys/frown.png border=0></td><td><p>:(</p></td><td><p>frown</p></td></tr>
- <tr><td><img src=images/smileys/indifferent.png border=0></td><td><p>:|</p></td><td><p>indifferent</p></td></tr>
- <tr><td><img src=images/smileys/laughing.png border=0></td><td><p>:D</p></td><td><p>laughing</p></td></tr>
- <tr><td><img src=images/smileys/lick.png border=0></td><td><p>:P</p></td><td><p>lick</p></td></tr>
- <tr><td><img src=images/smileys/ohno.png border=0></td><td><p>:O</p></td><td><p>oh no!</p></td></tr>
- <tr><td><img src=images/smileys/smile.png border=0></td><td><p>:)</p></td><td><p>smile</p></td></tr>
- <tr><td><img src=images/smileys/surprised.png border=0></td><td><p>=)</p></td><td><p>surprised</p></td></tr>
- <tr><td><img src=images/smileys/undecided.png border=0></td><td><p>:\</p></td><td><p>undecided</p></td></tr>
- <tr><td><img src=images/smileys/wink.png border=0></td><td><p>;)</p></td><td><p>wink</p></td></tr>
- </td></tr>
- </table>
- </td></tr></table>
- <?php
- if (!isset($_REQUEST['title_input']) or !isset($_REQUEST['body_input']) or empty($_REQUEST['title_input']) or empty($_REQUEST['body_input'])) {
- }
- $title_write_content = ucfirst($_REQUEST['title_input']);
- chmod($title_file, 0666);
- $body_write_content = ucfirst($_REQUEST['body_input']);
- $body_write_content = str_replace( "\n", '<br />', $body_write_content);
- $body_write_content = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $body_write_content);
- $body_write_content = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $body_write_content);
- $body_write_content = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $body_write_content);
- $body_write_content = str_replace(':D', '<img src=images/smileys/laughing.png border=0>', $body_write_content);
- $body_write_content = str_replace(':P', '<img src=images/smileys/lick.png border=0>', $body_write_content);
- $body_write_content = str_replace(':O', '<img src=images/smileys/ohno.png border=0>', $body_write_content);
- $body_write_content = str_replace(':)', '<img src=images/smileys/smile.png border=0>', $body_write_content);
- $body_write_content = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $body_write_content);
- $body_write_content = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $body_write_content);
- $body_write_content = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $body_write_content);
- $body_write_content = str_replace('[b]', '<b>', $body_write_content);
- $body_write_content = str_replace('[/b]', '</b>', $body_write_content);
- $body_write_content = str_replace('[i]', '<i>', $body_write_content);
- $body_write_content = str_replace('[/i]', '</i>', $body_write_content);
- $body_write_content = str_replace('[u]', '<u>', $body_write_content);
- $body_write_content = str_replace('[/u]', '</u>', $body_write_content);
- $body_write_content = str_replace('[strike]', '<strike>', $body_write_content);
- $body_write_content = str_replace('[/strike]', '</strike>', $body_write_content);
- $revisions_count = $revisions_count + 1;
- chmod($revisions_file, 0666);
- if (isset($_FILES['album_image_input']) and !empty($_FILES['album_image_input'])) {
- if (is_uploaded_file($_FILES['album_image_input']['tmp_name'])) {
- if ($_FILES['album_image_input']['size']<=$max_image_size) {
- if (($_FILES['album_image_input']['type']=="image/gif") || ($_FILES['album_image_input']['type']=="image/pjpeg") || ($_FILES['album_image_input']['type']=="image/jpeg") || ($_FILES['album_image_input']['type']=="image/png")) {
- if (!file_exists($image_path . $_REQUEST['entry'] . '/album/' . $_FILES['album_image_input']['name'])) {
- $image_dir = $image_path . $_REQUEST['entry'];
- if (!file_exists($image_dir)) {
- mkdir($image_dir, 0777);
- chmod($image_dir, 0777);
- }
- $album_dir = $image_path . $_REQUEST['entry'] . '/album';
- if (!file_exists($album_dir)) {
- mkdir($album_dir, 0777);
- chmod($album_dir, 0777);
- }
- $album_sem = 'data/albums/' . $_REQUEST['entry'];
- if (!file_exists("data/albums")) {
- mkdir("data/albums", 0777);
- chmod("data/albums", 0777);
- }
- if (!file_exists($album_sem)) {
- mkdir($album_sem, 0777);
- chmod($album_sem, 0777);
- }
- if (isset($_REQUEST['caption']) and !empty($_REQUEST['caption'])) {
- $album_data_dir = 'data/items/' . $_REQUEST['entry'] . '/album';
- if (!file_exists($album_data_dir)) {
- mkdir($album_data_dir, 0777);
- chmod($album_data_dir, 0777);
- }
- $caption_dir = 'data/items/' . $_REQUEST['entry'] . '/album/captions';
- if (!file_exists($caption_dir)) {
- mkdir($caption_dir, 0777);
- chmod($caption_dir, 0777);
- }
- $caption_file = 'data/items/' . $_REQUEST['entry'] . '/album/captions/' . $_FILES['album_image_input']['name'] . '.txt';
- if (!file_exists($caption_file)) {
- chmod($caption_file, 0666);
- }
- }
- $res = copy($_FILES['album_image_input']['tmp_name'], $album_dir . '/' . $_FILES['album_image_input']['name']);
- unlink($_FILES['album_image_input']['tmp_name']);
- }
- else {
- unlink($_FILES['album_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['album_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['album_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['album_image_input']['tmp_name']);
- }
- }
- if (isset($_FILES['entry_image_input']) and !empty($_FILES['entry_image_input'])) {
- if (is_uploaded_file($_FILES['entry_image_input']['tmp_name'])) {
- if ($_FILES['entry_image_input']['size']<=$max_image_size) {
- if (($_FILES['entry_image_input']['type']=="image/gif") || ($_FILES['entry_image_input']['type']=="image/pjpeg") || ($_FILES['entry_image_input']['type']=="image/jpeg") || ($_FILES['entry_image_input']['type']=="image/png")) {
- if (!file_exists($image_path . $_REQUEST['entry'] . '/' . $_FILES['entry_image_input']['name'])) {
- $image_dir = $image_path . $_REQUEST['entry'];
- if (!file_exists($image_dir)) {
- mkdir($image_dir, 0777);
- chmod($image_dir, 0777);
- }
- $res = copy($_FILES['entry_image_input']['tmp_name'], $image_path . $_REQUEST['entry'] . '/' . $_FILES['entry_image_input']['name']);
- unlink($_FILES['entry_image_input']['tmp_name']);
- $entry_image_size = getimagesize($image_path . $_REQUEST['entry'] . '/' . $_FILES['entry_image_input']['name']);
- $entry_image_width = $entry_image_size[0];
- $entry_image_height = $entry_image_size[1];
- $max_entry_image_width = 513;
- if ($entry_image_width > $max_entry_image_width) {
- $sizefactor = (double) ($max_entry_image_width / $entry_image_width) ;
- $entry_image_width = (int) ($entry_image_width * $sizefactor);
- $entry_image_height = (int) ($entry_image_height * $sizefactor);
- }
- $body_write_content = '<img src=' . $image_path . $_REQUEST['entry'] . '/' . $_FILES['entry_image_input']['name'] . ' border=0 width=' . $entry_image_width . ' height=' . $entry_image_height . '><br>' . $body_write_content;
- }
- else {
- unlink($_FILES['entry_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['entry_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['entry_image_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['entry_image_input']['tmp_name']);
- }
- }
- if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
- if (is_uploaded_file($_FILES['file_input']['tmp_name'])) {
- if ($_FILES['file_input']['size']<=$max_file_size) {
- $filedrop_dir = 'data/items/' . $_REQUEST['entry'] . '/filedrop';
- if (!file_exists($filedrop_dir)) {
- mkdir($filedrop_dir, 0777);
- chmod($filedrop_dir, 0777);
- }
- $file_dir = 'data/items/' . $_REQUEST['entry'] . '/filedrop/files';
- if (!file_exists($file_dir)) {
- mkdir($file_dir, 0777);
- chmod($file_dir, 0777);
- }
- if (!file_exists($file_dir . '/' . $_FILES['file_input']['name'])) {
- $res = copy($_FILES['file_input']['tmp_name'], $file_dir . '/' . $_FILES['file_input']['name']);
- unlink($_FILES['file_input']['tmp_name']);
- $file_src = $file_dir . '/' . $_FILES['file_input']['name'];
- $file_file = $filedrop_dir . '/' . $_FILES['file_input']['name'] . '.txt';
- chmod($file_file, 0666);
- }
- else {
- unlink($_FILES['file_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['file_input']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['file_input']['tmp_name']);
- }
- }
- chmod($body_file, 0666);
- $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
- if (isset($_REQUEST['sticky']) and !empty($_REQUEST['sticky']) and ($_REQUEST['sticky'] == "on")) {
- if (!file_exists("data/sticky")) {
- mkdir("data/sticky", 0777);
- chmod("data/sticky", 0777);
- }
- if (!file_exists($sticky_sem)) {
- touch($sticky_sem);
- chmod($sticky_sem, 0666);
- }
- }
- if (!isset($_REQUEST['sticky']) or empty($_REQUEST['sticky'])) {
- if (file_exists($sticky_sem)) {
- unlink($sticky_sem);
- }
- }
- $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
- if (isset($_REQUEST['display']) and !empty($_REQUEST['display']) and ($_REQUEST['display'] == "on")) {
- if (!file_exists($display_sem)) {
- touch($display_sem);
- chmod($display_sem, 0666);
- }
- }
- if (!isset($_REQUEST['display']) or empty($_REQUEST['display'])) {
- if (file_exists($display_sem)) {
- unlink($display_sem);
- }
- }
- $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
- if (isset($_REQUEST['private']) and !empty($_REQUEST['private']) and ($_REQUEST['private'] == "on")) {
- if (!file_exists($private_sem)) {
- touch($private_sem);
- chmod($private_sem, 0666);
- }
- }
- if (!isset($_REQUEST['private']) or empty($_REQUEST['private'])) {
- if (file_exists($private_sem)) {
- unlink($private_sem);
- }
- }
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- if (!file_exists("data/categories")) {
- mkdir("data/categories", 0777);
- chmod("data/categories", 0777);
- }
- if ($_REQUEST['category'] == "unfiled") {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
- if (file_exists("data/categories/{$_REQUEST['category']}")) {
- chmod("data/items/{$_REQUEST['entry']}/category.txt", 0666);
- }
- }
- $default_ping_urls = "http://technorati.com/ping/http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
- $ping_urls_file = "data/ping.txt";
- if (!file_exists($ping_urls_file)) {
- chmod($ping_urls_file, 0666);
- }
- $get_ping_urls = explode("|", $ping_urls);
- foreach ($get_ping_urls as $ping_url) {
- $ping = file_get_contents($ping_url);
- //$ping_urls_edit_file = "data/ping-edit.txt";
- //$fp_ping_urls_edit_txt = fopen($ping_urls_edit_file,"w");
- //fwrite($fp_ping_urls_edit_txt, $ping);
- //fclose($fp_ping_urls_edit_txt);
- //chmod($ping_urls_edit_file, 0666);
- clear($ping);
- }
- ?>