maj.world

maj.world

Git

This commit has been accessed 629 times via Git panel.

commit 18a29752fa9a2e0a60809fbf717ab43e95c290d4
tree 09c6f337c73f73c042baa9f91ccccf994aed7322
parent 2d702a44ad667d898a2159e49d5b18b091e26c8d
author Engels Antonio <engels@majcms.org> 1280601593 +0800
committer Engels Antonio <engels@majcms.org> 1280601593 +0800

    CSS progressive enhancements
    Aggregate recurring functions
    Code clean-up and optimization

diff --git a/add.php b/add.php
index 59b0f21..a1e868c 100644
--- a/add.php
+++ b/add.php
@@ -1,61 +1,41 @@
 <?php
-
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
-       header("Location: login.php");
-}
-
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
-if (isset($_POST['title_input']) and isset($_POST['body_input']) and !empty($_POST['title_input']) and !empty($_POST['body_input'])) {
-       header("Location: index.php");
-}
-
-if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
-       $login_username = file_get_contents("data/username.txt");
-}
-
-if ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) {
-
-       if (file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt")) {
-
-               $bb_cat = file_get_contents("data/members/active/{$_SESSION['logged_in']}/category.txt");
-
-               if (!file_exists("data/categories/$bb_cat") or ($bb_cat == "")) {
-                       unlink("data/members/active/{$_SESSION['logged_in']}/category.txt");
-               }
-       }
-
-       if ((file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") or file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt")) and file_exists("data/bb.txt") and !file_exists("data/noadd.txt")) {
-               $login_username = $_SESSION['logged_in'];
-       }
-}
-
-if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
-       exit();
-}
-
+  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");
+  }
+  
+  if (isset($_POST['title_input']) and isset($_POST['body_input']) and !empty($_POST['title_input']) and !empty($_POST['body_input'])) {
+      header("Location: index.php");
+  }
+  
+  if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+      $login_username = file_get_contents("data/username.txt");
+  }
+  
+  if ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) {
+      if (file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt")) {
+          $bb_cat = file_get_contents("data/members/active/{$_SESSION['logged_in']}/category.txt");
+          
+          if (!file_exists("data/categories/$bb_cat") or ($bb_cat == "")) {
+              unlink("data/members/active/{$_SESSION['logged_in']}/category.txt");
+          }
+      }
+      
+      if ((file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") or file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt")) and file_exists("data/bb.txt") and !file_exists("data/noadd.txt")) {
+          $login_username = $_SESSION['logged_in'];
+      }
+  }
+  
+  if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
+      exit();
+  }
 ?>
 
 <title>Add</title>
@@ -63,161 +43,180 @@ if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username
 <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;
+  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;
+  font-size: 11px;
 }
 
 a {
-       font-weight: bold;
-       text-decoration: none;
+  font-weight: bold;
+  text-decoration: none;
 }
 
 a:link, a:visited {
-       color: #666666;
+  color: #666666;
 }
 
 a:hover {
-       color: #336699;
+  color: #336699;
 }
 
 a:active {
-       color: #336699;
-}
-
-.input_title {        
-       color: #666666;
-       background: #ffffff;
-       border: #999999 solid 1px;
-       width: 512px;
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-title.txt")) {
-                                       $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
-                                       echo "$font_panel_title,";
-                               }
-       ?> arial, helvetica, sans-serif;
-       font-size: 11px;
-       font-weight: bold
-}
-
-.input_body {  
-       color: #666666;
-       background: #ffffff;
-       border: #999999 solid 1px;
-       width: 512px;
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "$font_panel_body,";
-                               }
-       ?> arial, helvetica, sans-serif;
-       font-size: 11px
+  color: #336699;
+}
+
+.input_title {  
+  color: #666666;
+  background: #ffffff;
+  border: #999999 solid 1px;
+  width: 512px;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-title.txt")) {
+      $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+      echo "$font_panel_title,";
+  }
+?> arial, helvetica, sans-serif;
+  font-size: 11px;
+  font-weight: bold
+}
+
+.input_body {  
+  color: #666666;
+  background: #ffffff;
+  border: #999999 solid 1px;
+  width: 512px;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-body.txt")) {
+      $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+      echo "$font_panel_body,";
+  }
+?> arial, helvetica, sans-serif;
+  font-size: 11px
 }
 
 </style>
 
 <?php
-
-if (file_exists("data/offset.txt")) {
-       $offset = file_get_contents("data/offset.txt");
-}
-else {
-       $offset = 0;
-}
-
-$entry_year = date("Y", time() + $offset);
-$entry_month = date("m", time() + $offset);
-$entry_day = date("d", time() + $offset);
-$entry_hour = date("H", time() + $offset);
-$entry_min = date("i", time() + $offset);
-$entry_sec = date("s", time() + $offset);
-
-function return_bytes($val) {
-       $val = trim($val);
-       $last = $val{strlen($val)-1};
-    
-       switch($last) {
-               case 'k':
-               case 'K':
-                       return (int) $val * 1024;
-                       break;
-               case 'm':
-               case 'M':
-                       return (int) $val * 1048576;
-                       break;
-               default:
-                       return $val;
-       }
-}
-
-$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
-$server_post_max_size = return_bytes(ini_get('post_max_size'));
-$server_memory_limit = return_bytes(ini_get('memory_limit'));
-
-$max_file_size = $server_upload_max_filesize;
-
-if ($server_upload_max_filesize > $server_post_max_size) {
-       $max_file_size = $server_post_max_size;
-}
-
-if ($server_post_max_size > $server_memory_limit) {
-       $max_file_size = $server_memory_limit;
-}
-
+  if (file_exists("data/offset.txt")) {
+      $offset = file_get_contents("data/offset.txt");
+  } else {
+      $offset = 0;
+  }
+  
+  $entry_year = date("Y", time() + $offset);
+  $entry_month = date("m", time() + $offset);
+  $entry_day = date("d", time() + $offset);
+  $entry_hour = date("H", time() + $offset);
+  $entry_min = date("i", time() + $offset);
+  $entry_sec = date("s", time() + $offset);
+  
+  $server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+  $server_post_max_size = return_bytes(ini_get('post_max_size'));
+  $server_memory_limit = return_bytes(ini_get('memory_limit'));
+  
+  $max_file_size = $server_upload_max_filesize;
+  
+  if ($server_upload_max_filesize > $server_post_max_size) {
+      $max_file_size = $server_post_max_size;
+  }
+  
+  if ($server_post_max_size > $server_memory_limit) {
+      $max_file_size = $server_memory_limit;
+  }
 ?>
 
 <form enctype="multipart/form-data" action="add.php" method="post">
 <p>
 
 <?php
+  if ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt")) {
+?>
 
-if ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt")) { ?>
-
-<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
+<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php
+      echo $max_file_size;
+?>">
 <input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG 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. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</p>
-
-<?php } ?>
-
+<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. Max size supported by server is <?php
+      echo($max_file_size / (1024 * 1024));
+?>MB.</p>
 
 <?php
+  }
+?>
 
-if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 
+<?php
+  if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 ?>
 
 <select name="select_year">
 <option selected>
-<option><?php echo $entry_year; ?>
-<option><?php $ante_year_1 = $entry_year - 1; echo $ante_year_1; ?>
-<option><?php $ante_year_2 = $entry_year - 2; echo $ante_year_2; ?>
-<option><?php $ante_year_3 = $entry_year - 3; echo $ante_year_3; ?>
-<option><?php $ante_year_4 = $entry_year - 4; echo $ante_year_4; ?>
-<option><?php $ante_year_5 = $entry_year - 5; echo $ante_year_5; ?>
-<option><?php $ante_year_6 = $entry_year - 6; echo $ante_year_6; ?>
-<option><?php $ante_year_7 = $entry_year - 7; echo $ante_year_7; ?>
-<option><?php $ante_year_8 = $entry_year - 8; echo $ante_year_8; ?>
-<option><?php $ante_year_9 = $entry_year - 9; echo $ante_year_9; ?>
-<option><?php $ante_year_10 = $entry_year - 10; echo $ante_year_10; ?>
+<option><?php
+      echo $entry_year;
+?>
+<option><?php
+      $ante_year_1 = $entry_year - 1;
+      echo $ante_year_1;
+?>
+<option><?php
+      $ante_year_2 = $entry_year - 2;
+      echo $ante_year_2;
+?>
+<option><?php
+      $ante_year_3 = $entry_year - 3;
+      echo $ante_year_3;
+?>
+<option><?php
+      $ante_year_4 = $entry_year - 4;
+      echo $ante_year_4;
+?>
+<option><?php
+      $ante_year_5 = $entry_year - 5;
+      echo $ante_year_5;
+?>
+<option><?php
+      $ante_year_6 = $entry_year - 6;
+      echo $ante_year_6;
+?>
+<option><?php
+      $ante_year_7 = $entry_year - 7;
+      echo $ante_year_7;
+?>
+<option><?php
+      $ante_year_8 = $entry_year - 8;
+      echo $ante_year_8;
+?>
+<option><?php
+      $ante_year_9 = $entry_year - 9;
+      echo $ante_year_9;
+?>
+<option><?php
+      $ante_year_10 = $entry_year - 10;
+      echo $ante_year_10;
+?>
 </select>
 
 <select name="select_month">
 <option selected>
-<option><?php echo $entry_month; ?>
+<option><?php
+      echo $entry_month;
+?>
 <option>01
 <option>02
 <option>03
@@ -234,7 +233,9 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 
 <select name="select_day">
 <option selected>
-<option><?php echo $entry_day; ?>
+<option><?php
+      echo $entry_day;
+?>
 <option>01
 <option>02
 <option>03
@@ -270,7 +271,9 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 
 <select name="select_hour">
 <option selected>
-<option><?php echo $entry_hour; ?>
+<option><?php
+      echo $entry_hour;
+?>
 <option>00
 <option>01
 <option>02
@@ -299,7 +302,9 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 
 <select name="select_min">
 <option selected>
-<option><?php echo $entry_min; ?>
+<option><?php
+      echo $entry_min;
+?>
 <option>00
 <option>01
 <option>02
@@ -362,66 +367,86 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 <option>59
 </select>   Enter antedate value in YYYY-MM-DD-HH-MM format.</p>
 
-<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
+<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php
+      echo $max_file_size;
+?>">
 <input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG 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. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</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. Max size supported by server is <?php
+      echo($max_file_size / (1024 * 1024));
+?>MB.</p>
 <p><input autocomplete="off" type="password" name="passwd"> Enter optional password.</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 value=\"\" selected>unfiled";
-
-                       foreach ($show_cat as $category) {
-                               echo "<option value=\"";
-                               echo strtolower($category);
-                               echo "\">";
-
-                               if (file_exists("data/categories/$category/title.txt")) {
-                                       readfile("data/categories/$category/title.txt");
-                               }
-                               else {
-                                       echo strtolower($category);
-                               }
-                       }
-
-                       echo "</select> Select category.</p>";
-
-               }
-       }
+      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 value=\"\" selected>unfiled";
+              
+              foreach ($show_cat as $category) {
+                  echo "<option value=\"";
+                  echo strtolower($category);
+                  echo "\">";
+                  
+                  if (file_exists("data/categories/$category/title.txt")) {
+                      readfile("data/categories/$category/title.txt");
+                  } else {
+                      echo strtolower($category);
+                  }
+              }
+              
+              echo "</select> Select category.</p>";
+          }
+      }
 ?>
 
 <p><input type="checkbox" name="sticky">Put entry title in Quick Links box.<br>
 <input type="checkbox" name="pdf">Allow PDF generation for this entry.<br>
 <input type="checkbox" name="display">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 if (file_exists("data/ml.txt")) { echo checked; } ?>>Private entry. This entry will unconditionally be invisible to visitors<?php if (file_exists("data/ml.txt")) { echo " and to the mailing list"; } ?>, even if always display is set.
+<input type="checkbox" name="private" <?php
+      if (file_exists("data/ml.txt")) {
+          echo checked;
+      }
+?>>Private entry. This entry will unconditionally be invisible to visitors<?php
+      if (file_exists("data/ml.txt")) {
+          echo " and to the mailing list";
+      }
+?>, even if always display is set.
 
-<?php if (file_exists("data/bb.txt")) { ?>
+<?php
+      if (file_exists("data/bb.txt")) {
+?>
 <br>
-<input type="checkbox" name="member" <?php if (file_exists("data/member.txt")) { echo checked; } ?>>Only registered members can view this entry.
+<input type="checkbox" name="member" <?php
+          if (file_exists("data/member.txt")) {
+              echo checked;
+          }
+?>>Only registered members can view this entry.
 
-<?php } ?>
+<?php
+      }
+?>
 
 </p>
 
-<?php } ?>
+<?php
+  }
+?>
 
 <table border="0" cellspacing="0" cellpadding="0"><tr><td>
 
@@ -455,598 +480,373 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
 </td></tr></table>
 
 <?php
-
-if (!isset($_POST['title_input']) or !isset($_POST['body_input']) or empty($_POST['title_input']) or empty($_POST['body_input'])) {
-       exit();
-}
-
-if (!isset($_POST['select_year']) or !isset($_POST['select_month']) or !isset($_POST['select_day']) or !isset($_POST['select_hour']) or !isset($_POST['select_min']) or empty($_POST['select_year']) or empty($_POST['select_month']) or empty($_POST['select_day']) or empty($_POST['select_hour']) or empty($_POST['select_min'])) {
-
-       $entry = date("YmdHis", time() + $offset);
-       $timestamp = date("l, M j, Y, g:i A", time() + $offset);
-}
-else {
-
-       $entry = $_POST['select_year'] . $_POST['select_month'] . $_POST['select_day'] . $_POST['select_hour'] . $_POST['select_min'] . $entry_sec;
-       $timestamp = date("l, M j, Y, g:i A", mktime($_POST['select_hour'], $_POST['select_min'], $entry_sec, $_POST['select_month'], $_POST['select_day'], $_POST['select_year']));
-}
-
-if (!file_exists("data/items")) {
-       mkdir("data/items");
-}
-
-$dir = "data/items/";
-$item_dir = $dir . $entry;
-
-if (!file_exists("images")) {
-       mkdir("images");
-}
-
-$image_dir = 'images/' . $entry;
-$file_dir = $item_dir . '/filedrop';
-
-function reformat_html($defang_html) {
-       $store_html=split("<html>",$defang_html);
-       $defang_html="";
-       $defang_html.=$store_html[0];
-       foreach($store_html as $itm_html=>$refh_html) {
-               if(eregi("</html>",$refh_html)) {
-                       $store_html1=split("</html>",$refh_html);
-                       $store_html1[0]=eregi_replace("\n","",$store_html1[0]);
-                       foreach($store_html1 as $itm_html1=>$refh_html1) {
-                               if($itm_html1==0)
-                                       $refh_html1="<!-- html -->$refh_html1<!-- /html -->";
-                                       $defang_html.=$refh_html1;
-                               }
-                       }
-               }
-       return $defang_html;
-}
-
-function reformat_code($defang_code) {
-       $store_code=split("<code>",$defang_code);
-       $defang_code="";
-       $defang_code.=$store_code[0];
-       foreach($store_code as $itm_code=>$refh_code) {
-               if(eregi("</code>",$refh_code)) {
-                       $store_code1=split("</code>",$refh_code);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/crying.png" border="0">',':((',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/frown.png" border="0">',':(',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/laughing.png" border="0">',':D',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/lick.png" border="0">',':P',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/ohno.png" border="0">',':O',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/smile.png" border="0">',':)',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/surprised.png" border="0">','=)',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/undecided.png" border="0">',':\\',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/wink.png" border="0">',';)',$store_code1[0]);
-                       $store_code1[0]=htmlentities($store_code1[0],ENT_NOQUOTES);
-                       foreach($store_code1 as $itm_code1=>$refh_code1) {
-                               if($itm_code1==0)
-                                       $refh_code1="<code>$refh_code1</code>";
-                                       $defang_code.=$refh_code1;
-                               }
-                       }
-               }
-       return $defang_code;
-}
-
-$body_write_content = ucfirst($_POST['body_input']);
-$body_write_content = str_replace("[html]", '<html>', $body_write_content);
-$body_write_content = str_replace("[/html]", '</html>', $body_write_content);
-$body_write_content = reformat_html($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('[code]', '<code>', $body_write_content);
-$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
-$body_write_content = reformat_code($body_write_content);
-$body_write_content = str_replace("\n", '<br />', $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);
-$body_write_content = str_replace('[sup]', '<sup>', $body_write_content);
-$body_write_content = str_replace('[/sup]', '</sup>', $body_write_content);
-$body_write_content = str_replace('[sub]', '<sub>', $body_write_content);
-$body_write_content = str_replace('[/sub]', '</sub>', $body_write_content);
-$body_write_content = str_replace('[highlight]', '<highlight>', $body_write_content);
-$body_write_content = str_replace('[/highlight]', '</highlight>', $body_write_content);
-$body_write_content = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $body_write_content);
-$body_write_content = str_replace('</highlight>', '</span>', $body_write_content);
-$body_write_content =  preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.0-9a-z-]+)>/", '&lt;$1@$2.$3&gt;',$body_write_content);
-
-mkdir($item_dir);
-
-// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
-$title_write_content = ucwords($_POST['title_input']);
-$title_write_content = str_replace('<','&lt;',$title_write_content);
-$title_write_content = str_replace('>','&gt;',$title_write_content);
-$title_write_content = str_replace(' A ',' a ',$title_write_content);
-$title_write_content = str_replace(' An ',' an ',$title_write_content);
-$title_write_content = str_replace(' And ',' and ',$title_write_content);
-$title_write_content = str_replace(' As ',' as ',$title_write_content);
-$title_write_content = str_replace(' At ',' at ',$title_write_content);
-$title_write_content = str_replace(' But ',' but ',$title_write_content);
-$title_write_content = str_replace(' By ',' by ',$title_write_content);
-$title_write_content = str_replace(' For ',' for ',$title_write_content);
-$title_write_content = str_replace(' In ',' in ',$title_write_content);
-$title_write_content = str_replace(' Of ',' of ',$title_write_content);
-$title_write_content = str_replace(' On ',' on ',$title_write_content);
-$title_write_content = str_replace(' Or ',' or ',$title_write_content);
-$title_write_content = str_replace(' The ',' the ',$title_write_content);
-$title_write_content = str_replace(' To ',' to ',$title_write_content);
-
-$title_file = $item_dir . '/title.txt';
-$fp_title_txt = fopen($title_file,"w");
-fwrite($fp_title_txt,$title_write_content);
-fclose($fp_title_txt);
-
-$author_file = $item_dir . '/author.txt';
-$fp_author_txt = fopen($author_file,"w");
-fwrite($fp_author_txt,$_SESSION['logged_in']);
-fclose($fp_author_txt);
-
-if (file_get_contents("data/username.txt") == $_SESSION['logged_in']) {
-       $post_file = "data/lastpost.txt";
-}
-elseif (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
-       $post_file = "data/members/active/{$_SESSION['logged_in']}/bb-post.txt";
-}
-
-$fp_post_txt = fopen($post_file,"w");
-fwrite($fp_post_txt,$entry);
-fclose($fp_post_txt);
-
-$date_file = $item_dir . '/date.txt';
-$fp_date_txt = fopen($date_file,"w");
-fwrite($fp_date_txt,$timestamp);
-fclose($fp_date_txt);
-
-if (isset($_FILES['image_input']) and !empty($_FILES['image_input'])) {
-
-       if (is_uploaded_file($_FILES['image_input']['tmp_name'])) {
-
-               if ($_FILES['image_input']['size']<=$max_file_size) {
-
-                       if (($_FILES['image_input']['type']=="image/gif") || ($_FILES['image_input']['type']=="image/pjpeg") || ($_FILES['image_input']['type']=="image/jpeg") || ($_FILES['image_input']['type']=="image/png")) {
-
-                               if (!file_exists($image_dir)) {
-                                       mkdir($image_dir);
-                               }
-
-                               $image_input_name = str_replace(" ","_",$_FILES['image_input']['name']);
-
-                               if (!file_exists("$image_dir/$image_input_name")) {
-                                       $res = copy($_FILES['image_input']['tmp_name'], "$image_dir/$image_input_name");
-                                       unlink($_FILES['image_input']['tmp_name']);
-
-                               }
-                               else {
-                                       unlink($_FILES['image_input']['tmp_name']);
-                               }
-                       }
-                       else {
-                               unlink($_FILES['image_input']['tmp_name']);
-                       }
-               }
-               else {
-                       unlink($_FILES['image_input']['tmp_name']);
-               }
-       }
-       else {
-               unlink($_FILES['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 = "$item_dir/filedrop";
-
-                       if (!file_exists($filedrop_dir)) {
-                               mkdir($filedrop_dir);
-                       }
-
-                       $file_dir = "$filedrop_dir/files";
-
-                       if (!file_exists($file_dir)) {
-                               mkdir($file_dir);
-                       }
-
-                       $file_input_name = str_replace(" ","_",$_FILES['file_input']['name']);
-
-                       if (!file_exists("$file_dir/$file_input_name")) {
-                               $res = copy($_FILES['file_input']['tmp_name'], "$file_dir/$file_input_name");
-                               unlink($_FILES['file_input']['tmp_name']);
-
-                               $fp_file_txt = fopen("$filedrop_dir/{$file_input_name}.txt","w");
-                               fwrite($fp_file_txt,"$file_dir/$file_input_name");
-                               fclose($fp_file_txt);
-                       }
-                       else {
-                               unlink($_FILES['file_input']['tmp_name']);
-                       }
-
-               }
-               else {
-                       unlink($_FILES['file_input']['tmp_name']);
-               }
-
-       }
-       else {
-               unlink($_FILES['file_input']['tmp_name']);
-       }
-
-}
-
-$body_file = "$item_dir/body.txt";
-
-$fp_body_txt = fopen($body_file,"w");
-
-if (isset($_FILES['image_input']) and !empty($_FILES['image_input'])) {
-       if (file_exists("$image_dir/$image_input_name")) {
-
-               $entry_image_size = getimagesize("$image_dir/$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_dir/$image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\"><br>$body_write_content";
-       }
-}
-
-fwrite($fp_body_txt,$body_write_content);
-fclose($fp_body_txt);
-
-$sticky_sem = "data/sticky/$entry";
-
-if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
-       if (!file_exists("data/sticky")) {
-               mkdir("data/sticky");
-       }
-       if (!file_exists($sticky_sem)) {
-               touch($sticky_sem);
-       }
-}
-
-$display_sem = "data/items/$entry/cat.txt";
-if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
-       if (!file_exists($display_sem)) {
-               touch($display_sem);
-       }
-}
-
-$private_sem = "data/items/$entry/private.txt";
-if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
-       if (!file_exists($private_sem)) {
-               touch($private_sem);
-       }
-}
-
-if (file_exists("data/bb.txt") and file_exists("data/member.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
-       touch("data/items/$entry/member.txt");
-}
-
-if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists($private_sem)) {
-
-       if (file_exists("data/ml-reply2.txt")) {
-               $ml_reply2 = file_get_contents("data/ml-reply2.txt");
-       }
-
-       if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
-               $ml_author = file_get_contents("data/author.txt");
-
-               if (file_exists("data/ml-from.txt")) {
-                       $ml_from = $ml_reply2;
-               }
-               else {
-                       $ml_from = file_get_contents("data/email.txt");
-               }
-
-               $ml_from = '"' . $ml_author . '" <' . $ml_from . '>';
-       }
-
-       if ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) {
-               if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and file_exists("data/bb.txt")) {
-                       $ml_from_firstname = file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt");
-                       $ml_from_lastname = file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt");
-
-                       if (file_exists("data/ml-from.txt")) {
-                               $ml_from = $ml_reply2;
-                       }
-                       else {
-                               $ml_from = file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt");
-                       }
-
-                       $ml_from = '"' . "$ml_from_firstname $ml_from_lastname" . '" <' . $ml_from . '>';
-               }
-       }
-
-       $ml_subject = ucfirst($_POST['title_input']);
-       if (file_exists("data/ml-prepend.txt")) {
-               $ml_subject = file_get_contents("data/ml-prepend.txt") . " " . $ml_subject;
-       }
-
-       $ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
-       $ml_body = ucfirst($_POST['body_input']);
-       $ml_body = str_replace('<br />', "\n", $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/lick.png" border="0">', ':P', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/smile.png" border="0">', ':)', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $ml_body);
-       $ml_body = str_replace('<img src="images/smileys/wink.png" border="0">', ';)', $ml_body);
-       $ml_body = str_replace('&amp;','&',$ml_body);
-       $ml_body = str_replace('&reg;','(R)',$ml_body);
-       $ml_body = strip_tags($ml_body);
-
-       if (file_exists("data/ml-header.txt")) {
-               $ml_header = file_get_contents("data/ml-header.txt");
-               $ml_body = $ml_header . "\n\n" . $ml_body;
-       }
-
-       $ml_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
-       $ml_url = str_replace('//', '/', $ml_url);
-       $ml_url = "http://" . $ml_url . "index.php?entry={$entry}&show=comments";
-
-       $ml_body = $ml_body . "\n\nPlease visit the following URL for the online version of this message:\n\n" . $ml_url;
-
-       if (file_exists("data/items/$entry/member.txt")) {
-               $ml_body = $ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
-       }
-
-       if (file_exists("data/ml-footer.txt")) {
-               $ml_footer = file_get_contents("data/ml-footer.txt");
-               $ml_body = $ml_body . "\n\n" . $ml_footer;
-       }
-
-       if ($dh_ml_member = opendir("data/members/active")) {
-               while (($ml_member = readdir($dh_ml_member)) !== false) {
-                       if ($ml_member != "." && $ml_member != ".." && fnmatch("*", $ml_member)) {
-
-                               if (file_exists("data/members/active/$ml_member/noml.txt")) {
-                                       continue;
-                               }
-
-                               if (file_exists("data/members/active/$ml_member/vacation.txt")) {
-                                       continue;
-                               }
-
-                               $ml_to_firstname = file_get_contents("data/members/active/$ml_member/firstname.txt");
-                               $ml_to_lastname = file_get_contents("data/members/active/$ml_member/lastname.txt");
-                               $ml_to = file_get_contents("data/members/active/$ml_member/email.txt");
-                               $ml_to = '"' . "$ml_to_firstname $ml_to_lastname" . '" <' . $ml_to . '>';
-
-                               if (file_exists("data/ml-reply2.txt")) {
-                                       mail($ml_to, $ml_subject, $ml_body,
-                                       "From: $ml_from\r\n" .
-                                       "Reply-To: $ml_reply2\r\n" .
-                                       "References: $entry\r\n" .
-                                       "X-Mailer: $ml_mailer");
-                               }
-                               else {
-                                       mail($ml_to, $ml_subject, $ml_body,
-                                       "From: $ml_from\r\n" .
-                                       "References: $entry\r\n" .
-                                       "X-Mailer: $ml_mailer");
-                               }
-                       }
-               }
-               closedir($dh_ml_member);
-       }
-}
-
-if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
-       if (!file_exists("data/items/$entry/pdf")) {
-               mkdir("data/items/$entry/pdf");
-       }
-       if (!file_exists("data/items/$entry/pdf/file")) {
-               mkdir("data/items/$entry/pdf/file");
-       }
-       if (!file_exists("data/items/$entry/pdf/count")) {
-               mkdir("data/items/$entry/pdf/count");
-       }
-
-       $author_file = "data/author.txt";
-       $title_file = "data/items/$entry/title.txt";
-       $date_file = "data/items/$entry/date.txt";
-       $body_file = "data/items/$entry/body.txt";
-
-       $author = file_get_contents($author_file);
-       $title = file_get_contents($title_file);
-       $date = file_get_contents($date_file);
-
-       $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
-       $link = str_replace("pdf.php?entry=","index.php?entry=",$link);
-       $link = str_replace("add.php?entry=","index.php?entry=",$link);
-
-       $body = file_get_contents($body_file);
-       $body = str_replace("\n","<br />",$body);
-
-       $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-
-       $filename = strtolower($title);
-       $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
-       $filename = str_replace(" ","-",$filename);
-       $filename = "data/items/$entry/pdf/file/$filename";
-
-       require('fpdf.php');
-
-       class PDF extends FPDF
-       {
-               var $B;
-               var $I;
-               var $U;
-               var $HREF;
-              
-               function PDF($orientation='P',$unit='mm',$format='letter')
-               {
-                       $this->FPDF($orientation,$unit,$format);
-                       $this->B=0;
-                       $this->I=0;
-                       $this->U=0;
-                       $this->HREF='';
-               }
-      
-               function WriteHTML($html)
-               {
-                       $html=str_replace("\n",' ',$html);
-                       $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
-                       foreach($a as $i=>$e)
-                       {
-                           if($i%2==0)
-                           {
-                               if($this->HREF)
-                                   $this->PutLink($this->HREF,$e);
-                               else
-                                   $this->Write(5,$e);
-                           }
-                           else
-                           {
-                               if($e{0}=='/')
-                                   $this->CloseTag(strtoupper(substr($e,1)));
-                               else
-                               {
-                                   $a2=explode(' ',$e);
-                                   $tag=strtoupper(array_shift($a2));
-                                   $attr=array();
-                                   foreach($a2 as $v)
-                                       if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3))
-                                           $attr[strtoupper($a3[1])]=$a3[2];
-                                   $this->OpenTag($tag,$attr);
-                               }
-                           }
-                       }
-               }
-              
-               function OpenTag($tag,$attr)
-               {
-                       if($tag=='B' or $tag=='I' or $tag=='U')
-                           $this->SetStyle($tag,true);
-                       if($tag=='A')
-                           $this->HREF=$attr['HREF'];
-                       if($tag=='BR')
-                           $this->Ln(5);
-               }
-              
-               function CloseTag($tag)
-               {
-                       if($tag=='B' or $tag=='I' or $tag=='U')
-                           $this->SetStyle($tag,false);
-                       if($tag=='A')
-                           $this->HREF='';
-               }
-              
-               function SetStyle($tag,$enable)
-               {
-                       $this->$tag+=($enable ? 1 : -1);
-                       $style='';
-                       foreach(array('B','I','U') as $s)
-                           if($this->$s>0)
-                               $style.=$s;
-                       $this->SetFont('',$style);
-               }
-              
-               function PutLink($URL,$txt)
-               {
-                       $this->SetTextColor(0,0,255);
-                       $this->SetStyle('U',true);
-                       $this->Write(5,$txt,$URL);
-                       $this->SetStyle('U',false);
-                       $this->SetTextColor(0);
-               }
-       }
-
-       $pdf=new PDF();
-       $pdf->AddPage();
-       $pdf->SetTitle($title);
-       $pdf->SetAuthor($author);
-       $pdf->SetFont('Helvetica','B',14);
-       $pdf->WriteHTML($title);
-       $pdf->SetFont('Helvetica','',10);
-       $pdf->WriteHTML($html);
-       $pdf->Output($filename);
-}
-
-if (isset($_POST['category']) and !empty($_POST['category']) and file_exists("data/categories/{$_POST['category']}")) {
-
-       if (!file_exists("data/items/$entry/categories")) {
-               mkdir("data/items/$entry/categories");
-       }
-
-       if (!file_exists("data/items/$entry/categories/{$_POST['category']}")) {
-               mkdir("data/items/$entry/categories/{$_POST['category']}");
-       }
-}
-
-
-if (file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt") and file_exists("data/bb.txt")) {
-
-       $bb_cat = file_get_contents("data/members/active/{$_SESSION['logged_in']}/category.txt");
-
-       if (file_exists("data/categories/$bb_cat")) {
-
-               if (!file_exists("data/items/$entry/categories")) {
-                       mkdir("data/items/$entry/categories");
-               }
-
-               if (!file_exists("data/items/$entry/categories/$bb_cat")) {
-                       mkdir("data/items/$entry/categories/$bb_cat");
-               }
-       }
-}
-
-if (isset($_POST['passwd']) and !empty($_POST['passwd'])) {
-       if (($_POST['passwd'] == "password") or empty($_POST['passwd'])) {
-               unlink("data/items/$entry/passwd.txt");
-       }
-       else {
-               $passwd_crypt = sha1($_POST['passwd']);
-               $passwd_crypt = md5($passwd_crypt);
-               $passwd_crypt = crypt($passwd_crypt, $passwd_crypt);
-
-               $fp_passwd_txt = fopen("data/items/$entry/passwd.txt","w");
-               fwrite($fp_passwd_txt, $passwd_crypt);
-               fclose($fp_passwd_txt);
-       }
-}
-
-if (file_exists("data/ping.txt")) {
-
-       $ping_urls = file_get_contents("data/ping.txt");
-
-       $get_ping_urls = explode("|", $ping_urls);
-
-       foreach ($get_ping_urls as $ping_url) {
-               $ping = file_get_contents($ping_url);
-               unset($ping);
-       }
-}
-
+  if (!isset($_POST['title_input']) or !isset($_POST['body_input']) or empty($_POST['title_input']) or empty($_POST['body_input'])) {
+      exit();
+  }
+  
+  if (!isset($_POST['select_year']) or !isset($_POST['select_month']) or !isset($_POST['select_day']) or !isset($_POST['select_hour']) or !isset($_POST['select_min']) or empty($_POST['select_year']) or empty($_POST['select_month']) or empty($_POST['select_day']) or empty($_POST['select_hour']) or empty($_POST['select_min'])) {
+      $entry = date("YmdHis", time() + $offset);
+      $timestamp = date("l, M j, Y, g:i A", time() + $offset);
+  } else {
+      $entry = $_POST['select_year'] . $_POST['select_month'] . $_POST['select_day'] . $_POST['select_hour'] . $_POST['select_min'] . $entry_sec;
+      $timestamp = date("l, M j, Y, g:i A", mktime($_POST['select_hour'], $_POST['select_min'], $entry_sec, $_POST['select_month'], $_POST['select_day'], $_POST['select_year']));
+  }
+  
+  if (!file_exists("data/items")) {
+      mkdir("data/items");
+  }
+  
+  $dir = "data/items/";
+  $item_dir = $dir . $entry;
+  
+  if (!file_exists("images")) {
+      mkdir("images");
+  }
+  
+  $image_dir = 'images/' . $entry;
+  $file_dir = $item_dir . '/filedrop';
+  
+  mkdir($item_dir);
+  
+  $title_write_content = format_title_put($_POST['title_input']);
+  $body_write_content = format_body_put($_POST['body_input']);
+  
+  $title_file = $item_dir . '/title.txt';
+  $fp_title_txt = fopen($title_file, "w");
+  fwrite($fp_title_txt, $title_write_content);
+  fclose($fp_title_txt);
+  
+  $author_file = $item_dir . '/author.txt';
+  $fp_author_txt = fopen($author_file, "w");
+  fwrite($fp_author_txt, $_SESSION['logged_in']);
+  fclose($fp_author_txt);
+  
+  if (file_get_contents("data/username.txt") == $_SESSION['logged_in']) {
+      $post_file = "data/lastpost.txt";
+  } elseif (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+      $post_file = "data/members/active/{$_SESSION['logged_in']}/bb-post.txt";
+  }
+  
+  $fp_post_txt = fopen($post_file, "w");
+  fwrite($fp_post_txt, $entry);
+  fclose($fp_post_txt);
+  
+  $date_file = $item_dir . '/date.txt';
+  $fp_date_txt = fopen($date_file, "w");
+  fwrite($fp_date_txt, $timestamp);
+  fclose($fp_date_txt);
+  
+  if (isset($_FILES['image_input']) and !empty($_FILES['image_input'])) {
+      if (is_uploaded_file($_FILES['image_input']['tmp_name'])) {
+          if ($_FILES['image_input']['size'] <= $max_file_size) {
+              if (($_FILES['image_input']['type'] == "image/gif") || ($_FILES['image_input']['type'] == "image/pjpeg") || ($_FILES['image_input']['type'] == "image/jpeg") || ($_FILES['image_input']['type'] == "image/png")) {
+                  if (!file_exists($image_dir)) {
+                      mkdir($image_dir);
+                  }
+                  
+                  $image_input_name = str_replace(" ", "_", $_FILES['image_input']['name']);
+                  
+                  if (!file_exists("$image_dir/$image_input_name")) {
+                      $res = copy($_FILES['image_input']['tmp_name'], "$image_dir/$image_input_name");
+                      unlink($_FILES['image_input']['tmp_name']);
+                  } else {
+                      unlink($_FILES['image_input']['tmp_name']);
+                  }
+              } else {
+                  unlink($_FILES['image_input']['tmp_name']);
+              }
+          } else {
+              unlink($_FILES['image_input']['tmp_name']);
+          }
+      } else {
+          unlink($_FILES['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 = "$item_dir/filedrop";
+              
+              if (!file_exists($filedrop_dir)) {
+                  mkdir($filedrop_dir);
+              }
+              
+              $file_dir = "$filedrop_dir/files";
+              
+              if (!file_exists($file_dir)) {
+                  mkdir($file_dir);
+              }
+              
+              $file_input_name = str_replace(" ", "_", $_FILES['file_input']['name']);
+              
+              if (!file_exists("$file_dir/$file_input_name")) {
+                  $res = copy($_FILES['file_input']['tmp_name'], "$file_dir/$file_input_name");
+                  unlink($_FILES['file_input']['tmp_name']);
+                  
+                  
+                  $fp_file_txt = fopen("$filedrop_dir/{$file_input_name}.txt", "w");
+                  fwrite($fp_file_txt, "$file_dir/$file_input_name");
+                  fclose($fp_file_txt);
+              } else {
+                  unlink($_FILES['file_input']['tmp_name']);
+              }
+          } else {
+              unlink($_FILES['file_input']['tmp_name']);
+          }
+      } else {
+          unlink($_FILES['file_input']['tmp_name']);
+      }
+  }
+  
+  
+  $body_file = "$item_dir/body.txt";
+  
+  $fp_body_txt = fopen($body_file, "w");
+  
+  if (isset($_FILES['image_input']) and !empty($_FILES['image_input'])) {
+      if (file_exists("$image_dir/$image_input_name")) {
+          $entry_image_size = getimagesize("$image_dir/$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_dir/$image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\"><br>$body_write_content";
+      }
+  }
+  
+  fwrite($fp_body_txt, $body_write_content);
+  fclose($fp_body_txt);
+  
+  $sticky_sem = "data/sticky/$entry";
+  
+  if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
+      if (!file_exists("data/sticky")) {
+          mkdir("data/sticky");
+      }
+      if (!file_exists($sticky_sem)) {
+          touch($sticky_sem);
+      }
+  }
+  
+  $display_sem = "data/items/$entry/cat.txt";
+  if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
+      if (!file_exists($display_sem)) {
+          touch($display_sem);
+      }
+  }
+  
+  $private_sem = "data/items/$entry/private.txt";
+  if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
+      if (!file_exists($private_sem)) {
+          touch($private_sem);
+      }
+  }
+  
+  if (file_exists("data/bb.txt") and file_exists("data/member.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
+      touch("data/items/$entry/member.txt");
+  }
+  
+  if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists($private_sem)) {
+      if (file_exists("data/ml-reply2.txt")) {
+          $ml_reply2 = file_get_contents("data/ml-reply2.txt");
+      }
+      
+      if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+          $ml_author = file_get_contents("data/author.txt");
+          
+          if (file_exists("data/ml-from.txt")) {
+              $ml_from = $ml_reply2;
+          } else {
+              $ml_from = file_get_contents("data/email.txt");
+          }
+          
+          $ml_from = '"' . $ml_author . '" <' . $ml_from . '>';
+      }
+      
+      if ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) {
+          if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and file_exists("data/bb.txt")) {
+              $ml_from_firstname = file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt");
+              $ml_from_lastname = file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt");
+              
+              if (file_exists("data/ml-from.txt")) {
+                  $ml_from = $ml_reply2;
+              } else {
+                  $ml_from = file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt");
+              }
+              
+              $ml_from = '"' . "$ml_from_firstname $ml_from_lastname" . '" <' . $ml_from . '>';
+          }
+      }
+      
+      $ml_subject = ucfirst($_POST['title_input']);
+      if (file_exists("data/ml-prepend.txt")) {
+          $ml_subject = file_get_contents("data/ml-prepend.txt") . " " . $ml_subject;
+      }
+      
+      $ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
+      $ml_body = ucfirst($_POST['body_input']);
+      $ml_body = str_replace('<br />', "\n", $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/lick.png" border="0">', ':P', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/smile.png" border="0">', ':)', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $ml_body);
+      $ml_body = str_replace('<img src="images/smileys/wink.png" border="0">', ';)', $ml_body);
+      $ml_body = str_replace('&amp;', '&', $ml_body);
+      $ml_body = str_replace('&reg;', '(R)', $ml_body);
+      $ml_body = strip_tags($ml_body);
+      
+      if (file_exists("data/ml-header.txt")) {
+          $ml_header = file_get_contents("data/ml-header.txt");
+          $ml_body = $ml_header . "\n\n" . $ml_body;
+      }
+      
+      $ml_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
+      $ml_url = str_replace('//', '/', $ml_url);
+      $ml_url = "http://" . $ml_url . "index.php?entry={$entry}&show=comments";
+      
+      $ml_body = $ml_body . "\n\nPlease visit the following URL for the online version of this message:\n\n" . $ml_url;
+      
+      if (file_exists("data/items/$entry/member.txt")) {
+          $ml_body = $ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
+      }
+      
+      if (file_exists("data/ml-footer.txt")) {
+          $ml_footer = file_get_contents("data/ml-footer.txt");
+          $ml_body = $ml_body . "\n\n" . $ml_footer;
+      }
+      
+      if ($dh_ml_member = opendir("data/members/active")) {
+          while (($ml_member = readdir($dh_ml_member)) !== false) {
+              if ($ml_member != "." && $ml_member != ".." && fnmatch("*", $ml_member)) {
+                  if (file_exists("data/members/active/$ml_member/noml.txt")) {
+                      continue;
+                  }
+                  
+                  if (file_exists("data/members/active/$ml_member/vacation.txt")) {
+                      continue;
+                  }
+                  
+                  $ml_to_firstname = file_get_contents("data/members/active/$ml_member/firstname.txt");
+                  $ml_to_lastname = file_get_contents("data/members/active/$ml_member/lastname.txt");
+                  $ml_to = file_get_contents("data/members/active/$ml_member/email.txt");
+                  $ml_to = '"' . "$ml_to_firstname $ml_to_lastname" . '" <' . $ml_to . '>';
+                  
+                  if (file_exists("data/ml-reply2.txt")) {
+                      mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "Reply-To: $ml_reply2\r\n" . "References: $entry\r\n" . "X-Mailer: $ml_mailer");
+                  } else {
+                      mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "References: $entry\r\n" . "X-Mailer: $ml_mailer");
+                  }
+              }
+          }
+          closedir($dh_ml_member);
+      }
+  }
+  
+  if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
+      if (!file_exists("data/items/$entry/pdf")) {
+          mkdir("data/items/$entry/pdf");
+      }
+      if (!file_exists("data/items/$entry/pdf/file")) {
+          mkdir("data/items/$entry/pdf/file");
+      }
+      if (!file_exists("data/items/$entry/pdf/count")) {
+          mkdir("data/items/$entry/pdf/count");
+      }
+      
+      $author_file = "data/author.txt";
+      $title_file = "data/items/$entry/title.txt";
+      $date_file = "data/items/$entry/date.txt";
+      $body_file = "data/items/$entry/body.txt";
+      
+      $author = file_get_contents($author_file);
+      $title = file_get_contents($title_file);
+      $date = file_get_contents($date_file);
+      
+      $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
+      $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
+      $link = str_replace("add.php?entry=", "index.php?entry=", $link);
+      
+      $body = file_get_contents($body_file);
+      $body = str_replace("\n", "<br />", $body);
+      
+      $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
+      
+      $filename = strtolower($title);
+      $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
+      $filename = str_replace(" ", "-", $filename);
+      $filename = "data/items/$entry/pdf/file/$filename";
+      
+      $pdf = new PDF();
+      $pdf->AddPage();
+      $pdf->SetTitle($title);
+      $pdf->SetAuthor($author);
+      $pdf->SetFont('Helvetica', 'B', 14);
+      $pdf->WriteHTML($title);
+      $pdf->SetFont('Helvetica', '', 10);
+      $pdf->WriteHTML($html);
+      $pdf->Output($filename);
+  }
+  
+  if (isset($_POST['category']) and !empty($_POST['category']) and file_exists("data/categories/{$_POST['category']}")) {
+      if (!file_exists("data/items/$entry/categories")) {
+          mkdir("data/items/$entry/categories");
+      }
+      
+      if (!file_exists("data/items/$entry/categories/{$_POST['category']}")) {
+          mkdir("data/items/$entry/categories/{$_POST['category']}");
+      }
+  }
+  
+  
+  if (file_exists("data/members/active/{$_SESSION['logged_in']}/category.txt") and file_exists("data/bb.txt")) {
+      $bb_cat = file_get_contents("data/members/active/{$_SESSION['logged_in']}/category.txt");
+      
+      if (file_exists("data/categories/$bb_cat")) {
+          if (!file_exists("data/items/$entry/categories")) {
+              mkdir("data/items/$entry/categories");
+          }
+          
+          if (!file_exists("data/items/$entry/categories/$bb_cat")) {
+              mkdir("data/items/$entry/categories/$bb_cat");
+          }
+      }
+  }
+  
+  if (isset($_POST['passwd']) and !empty($_POST['passwd'])) {
+      if (($_POST['passwd'] == "password") or empty($_POST['passwd'])) {
+          unlink("data/items/$entry/passwd.txt");
+      } else {
+          $passwd_crypt = sha1($_POST['passwd']);
+          $passwd_crypt = md5($passwd_crypt);
+          $passwd_crypt = crypt($passwd_crypt, $passwd_crypt);
+          
+          $fp_passwd_txt = fopen("data/items/$entry/passwd.txt", "w");
+          fwrite($fp_passwd_txt, $passwd_crypt);
+          fclose($fp_passwd_txt);
+      }
+  }
+  
+  if (file_exists("data/ping.txt")) {
+      $ping_urls = file_get_contents("data/ping.txt");
+      
+      $get_ping_urls = explode("|", $ping_urls);
+      
+      foreach ($get_ping_urls as $ping_url) {
+          $ping = file_get_contents($ping_url);
+          unset($ping);
+      }
+  }
 ?>
diff --git a/album.php b/album.php
index 3cc3539..a55bd06 100644
--- a/album.php
+++ b/album.php
@@ -6,25 +6,12 @@ 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");
 }
 
-if (get_magic_quotes_gpc()) {
-       function stripslashes_array($data) {
-               if (is_array($data)) {
-                       foreach ($data as $album_image_exif_key => $album_image_exif_valueue) {
-                               $data[$album_image_exif_key] = stripslashes_array($album_image_exif_valueue);
-                       }
-                       return $data;
-               }
-               else {
-                        return stripslashes($data);
-               }
-       }
-       $_REQUEST = stripslashes_array($_REQUEST);
-}
-
 if (!isset($_REQUEST['entry']) or empty($_REQUEST['entry'])) {
        exit();
 }
diff --git a/cat.php b/cat.php
index 58ff2bb..da9fb61 100644
--- a/cat.php
+++ b/cat.php
@@ -6,54 +6,18 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
        exit();
 }
 
-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 (file_exists("data/items")) {
 
        if ($dh_cat_txt = opendir("data/items")) {
diff --git a/colors.php b/colors.php
index 51b48ca..11a33eb 100644
--- a/colors.php
+++ b/colors.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
@@ -50,31 +37,6 @@ if (!file_exists("data/schemes/colors")) {
        mkdir("data/schemes/colors");
 }
 
-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($_POST['reset']) and ($_POST['reset'] == "go")) {
 
        rmdirr("data/colors");
diff --git a/core.php b/core.php
new file mode 100644
index 0000000..0d0d919
--- /dev/null
+++ b/core.php
@@ -0,0 +1,267 @@
+<?php
+  // 20100729 - aggregate recurring functions
+  
+  if (get_magic_quotes_gpc()) {
+      function stripslashes_array($data) {
+          if (is_array($data)) {
+              foreach ($data as $key => $value) {
+                  $data[$key] = stripslashes_array($value);
+              } //foreach ($data as $key => $value)
+              return $data;
+          } //if (is_array($data))
+          else {
+              return stripslashes($data);
+          } //else
+      } //function stripslashes_array($data)
+      $_REQUEST = stripslashes_array($_REQUEST);
+  } //if (get_magic_quotes_gpc())
+  
+  
+  function rmdirr($dir) {
+      if (!file_exists($dir)) {
+          return false;
+      } //if (!file_exists($dir))
+      
+      if (is_file($dir)) {
+          return unlink($dir);
+      } //if (is_file($dir))
+      
+      $recurse = dir($dir);
+      
+      while (false !== $entry = $recurse->read()) {
+          if ($entry == '.' || $entry == '..') {
+              continue;
+          } //if ($entry == '.' || $entry == '..')
+          
+          rmdirr("$dir/$entry");
+      } //while (false !== $entry = $recurse->read())
+      
+      $recurse->close();
+      return rmdir($dir);
+  } //function rmdirr($dir)
+  
+  
+  function return_bytes($val) {
+      $val = trim($val);
+      $last = $val{strlen($val) - 1};
+      
+      switch ($last) {
+          case 'k':
+          case 'K':
+              return(int)$val * 1024;
+              break;
+          case 'm':
+          case 'M':
+              return(int)$val * 1048576;
+              break;
+          default:
+              return $val;
+      } //switch ($last)
+  } //function return_bytes($val)
+  
+  
+  function entry2date($entry) {
+      $entry_year = substr($entry, 0, 4);
+      $entry_month = substr($entry, 4, 2);
+      $entry_day = substr($entry, 6, 2);
+      $entry_hour = substr($entry, 8, 2);
+      $entry_min = substr($entry, 10, 2);
+      $entry_sec = substr($entry, 12, 2);
+      
+      echo date("l, M j, Y, g:i A", mktime($entry_hour, $entry_min, $entry_sec, $entry_month, $entry_day, $entry_year));
+  } //function entry2date($entry)
+  
+  
+  function reformat_html($data) {
+      $store_0 = split("<html>", $data);
+      $data = "";
+      $data .= $store_0[0];
+      
+      foreach ($store_0 as $item_0 => $ref_0) {
+          if (eregi("</html>", $ref_0)) {
+              $store_1 = split("</html>", $ref_0);
+              $store_1[0] = eregi_replace("\n", "", $store_1[0]);
+              
+              foreach ($store_1 as $item_1 => $ref_1) {
+                  if ($item_1 == 0)
+                      $ref_1 = "<!-- html -->$ref_1<!-- /html -->";
+                  $data .= $ref_1;
+              } //foreach ($store_1 as $item_1 => $ref_1)
+          } //if (eregi("</html>", $ref_0))
+      } //foreach ($store_0 as $item_0 => $ref_0)
+      return $data;
+  } //function reformat_html($data)
+  
+  
+  function reformat_code($data) {
+      $store_0 = split("<code>", $data);
+      $data = "";
+      $data .= $store_0[0];
+      
+      foreach ($store_0 as $item_0 => $ref_0) {
+          if (eregi("</code>", $ref_0)) {
+              $store_1 = split("</code>", $ref_0);
+              $store_1[0] = eregi_replace('<img src="images/smileys/crying.png" border="0">', ':((', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/frown.png" border="0">', ':(', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/lick.png" border="0">', ':P', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/smile.png" border="0">', ':)', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $store_1[0]);
+              $store_1[0] = eregi_replace('<img src="images/smileys/wink.png" border="0">', ';)', $store_1[0]);
+              $store_1[0] = htmlentities($store_1[0], ENT_NOQUOTES);
+              
+              foreach ($store_1 as $item_1 => $ref_1) {
+                  if ($item_1 == 0)
+                      $ref_1 = "<code>$ref_1</code>";
+                  $data .= $ref_1;
+              } //foreach ($store_1 as $item_1 => $ref_1)
+          } //if (eregi("</code>", $ref_0))
+      } //foreach ($store_0 as $item_0 => $ref_0)
+      return $data;
+  } //function reformat_code($data)
+  
+  
+  function format_title_put($data) {
+      // 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
+      $data = ucwords($data);
+      $data = str_replace('<', '&lt;', $data);
+      $data = str_replace('>', '&gt;', $data);
+      $data = str_replace(' A ', ' a ', $data);
+      $data = str_replace(' An ', ' an ', $data);
+      $data = str_replace(' And ', ' and ', $data);
+      $data = str_replace(' As ', ' as ', $data);
+      $data = str_replace(' At ', ' at ', $data);
+      $data = str_replace(' But ', ' but ', $data);
+      $data = str_replace(' By ', ' by ', $data);
+      $data = str_replace(' For ', ' for ', $data);
+      $data = str_replace(' In ', ' in ', $data);
+      $data = str_replace(' Of ', ' of ', $data);
+      $data = str_replace(' On ', ' on ', $data);
+      $data = str_replace(' Or ', ' or ', $data);
+      $data = str_replace(' The ', ' the ', $data);
+      $data = str_replace(' To ', ' to ', $data);
+      
+      return $data;
+  } //function format_title_put($data)
+  
+  
+  function format_body_put($data) {
+      $data = ucfirst($data);
+      $data = str_replace("[html]", '<html>', $data);
+      $data = str_replace("[/html]", '</html>', $data);
+      $data = reformat_html($data);
+      $data = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $data);
+      $data = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $data);
+      $data = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $data);
+      $data = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $data);
+      $data = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $data);
+      $data = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $data);
+      $data = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $data);
+      $data = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $data);
+      $data = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $data);
+      $data = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $data);
+      $data = str_replace('[code]', '<code>', $data);
+      $data = str_replace('[/code]', '</code>', $data);
+      $data = reformat_code($data);
+      $data = str_replace("\n", '<br />', $data);
+      $data = str_replace('[b]', '<b>', $data);
+      $data = str_replace('[/b]', '</b>', $data);
+      $data = str_replace('[i]', '<i>', $data);
+      $data = str_replace('[/i]', '</i>', $data);
+      $data = str_replace('[u]', '<u>', $data);
+      $data = str_replace('[/u]', '</u>', $data);
+      $data = str_replace('[strike]', '<strike>', $data);
+      $data = str_replace('[/strike]', '</strike>', $data);
+      $data = str_replace('[sup]', '<sup>', $data);
+      $data = str_replace('[/sup]', '</sup>', $data);
+      $data = str_replace('[sub]', '<sub>', $data);
+      $data = str_replace('[/sub]', '</sub>', $data);
+      $data = str_replace('[highlight]', '<highlight>', $data);
+      $data = str_replace('[/highlight]', '</highlight>', $data);
+      $data = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $data);
+      $data = str_replace('</highlight>', '</span>', $data);
+      $data = preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.0-9a-z-]+)>/", '&lt;$1@$2.$3&gt;', $data);
+      
+      return $data;
+  } //function format_body_put($data)
+  
+  
+  require("fpdf.php");
+  
+  class PDF extends FPDF {
+      var $B;
+      var $I;
+      var $U;
+      var $HREF;
+      
+      function PDF($orientation = 'P', $unit = 'mm', $format = 'letter') {
+          $this->FPDF($orientation, $unit, $format);
+          $this->B = 0;
+          $this->I = 0;
+          $this->U = 0;
+          $this->HREF = '';
+      } //function PDF($orientation = 'P', $unit = 'mm', $format = 'letter')
+      
+      function WriteHTML($html) {
+          $html = str_replace("\n", ' ', $html);
+          $a = preg_split('/<(.*)>/U', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
+          foreach ($a as $i => $e) {
+              if ($i % 2 == 0) {
+                  if ($this->HREF)
+                      $this->PutLink($this->HREF, $e);
+                  else
+                      $this->Write(5, $e);
+              } //if ($i % 2 == 0)
+              else {
+                  if ($e{0} == '/')
+                      $this->CloseTag(strtoupper(substr($e, 1)));
+                  else {
+                      $a2 = explode(' ', $e);
+                      $tag = strtoupper(array_shift($a2));
+                      $attr = array();
+                      foreach ($a2 as $v)
+                          if (ereg('^([^=]*)=["\']?([^"\']*)["\']?$', $v, $a3))
+                              $attr[strtoupper($a3[1])] = $a3[2];
+                      $this->OpenTag($tag, $attr);
+                  } //else
+              } //else
+          } //foreach ($a as $i => $e)
+      } //function WriteHTML($html)
+      
+      function OpenTag($tag, $attr) {
+          if ($tag == 'B' or $tag == 'I' or $tag == 'U')
+              $this->SetStyle($tag, true);
+          if ($tag == 'A')
+              $this->HREF = $attr['HREF'];
+          if ($tag == 'BR')
+              $this->Ln(5);
+      } //function OpenTag($tag, $attr)
+      
+      function CloseTag($tag) {
+          if ($tag == 'B' or $tag == 'I' or $tag == 'U')
+              $this->SetStyle($tag, false);
+          if ($tag == 'A')
+              $this->HREF = '';
+      } //function CloseTag($tag)
+      
+      function SetStyle($tag, $enable) {
+          $this->$tag += ($enable ? 1 : -1);
+          $style = '';
+          foreach (array('B', 'I', 'U') as $s)
+              if ($this->$s > 0)
+                  $style .= $s;
+          $this->SetFont('', $style);
+      } //function SetStyle($tag, $enable)
+      
+      function PutLink($URL, $txt) {
+          $this->SetTextColor(0, 0, 255);
+          $this->SetStyle('U', true);
+          $this->Write(5, $txt, $URL);
+          $this->SetStyle('U', false);
+          $this->SetTextColor(0);
+      } //function PutLink($URL, $txt)
+  } //class PDF extends FPDF
+?>
diff --git a/css.php b/css.php
index 161ed68..d5321b0 100644
--- a/css.php
+++ b/css.php
@@ -1,114 +1,141 @@
 <?php
 
 if (file_exists("data/fonts/body-size.txt")) {
-       $maj_body_px = file_get_contents("data/fonts/body-size.txt") . "px";
+       $maj_font_Dpx = file_get_contents("data/fonts/body-size.txt") . "px";
 }
 else {
-       $maj_body_px = "11px";
+       $maj_font_Dpx = "11px";
 }
 
 if (file_exists("data/fonts/input-size.txt")) {
-       $maj_input_px = file_get_contents("data/fonts/input-size.txt") . "px";
+       $maj_font_Ipx = file_get_contents("data/fonts/input-size.txt") . "px";
 }
 else {
-       $maj_input_px = "11px";
+       $maj_font_Ipx = "11px";
 }
 
 if (file_exists("data/fonts/panel-title-size.txt")) {
-       $maj_font_12px = file_get_contents("data/fonts/panel-title-size.txt") . "px";
+       $maj_font_Lpx = file_get_contents("data/fonts/panel-title-size.txt") . "px";
 }
 else {
-       $maj_font_12px = "12px";
+       $maj_font_Lpx = "12px";
 }
 
 if (file_exists("data/fonts/panel-body-size.txt")) {
-       $maj_font_11px = file_get_contents("data/fonts/panel-body-size.txt") . "px";
+       $maj_font_Mpx = file_get_contents("data/fonts/panel-body-size.txt") . "px";
 }
 else {
-       $maj_font_11px = "11px";
+       $maj_font_Mpx = "11px";
 }
 
 if (file_exists("data/fonts/panel-footer-size.txt")) {
-       $maj_font_10px = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
+       $maj_font_Spx = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
 }
 else {
-       $maj_font_10px = "10px";
+       $maj_font_Spx = "10px";
+}
+
+if (file_exists("data/round.txt")) {
+       $maj_border_radius = file_get_contents("data/round.txt") . "px";
+}
+else {
+       $maj_border_radius = "5px";
 }
 
 ?>
 
 <style>
 
-html {
-       font-size: <?php echo $maj_font_11px; ?>;
+* {
+       font-size: <?php echo $maj_font_Mpx; ?>;
 }
 
 body {
-       margin: 0px 0px 10px 10px;
        padding: 0px;
+       margin: 0px 0px 10px 10px;
+       color: #666666;
+       background-color: #ffffff;
        text-align: left;
+       font-family: arial,helvetica,sans-serif;
+       <?php
 
-       font-size: <?php echo $maj_body_px; ?>;
-
-       color: <?php
-                       if (file_exists("data/colors/font.txt")) {
-                               $maj_font_color = file_get_contents("data/colors/font.txt");
-                               echo $maj_font_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/body.txt")) {
-                                       $maj_font_body = file_get_contents("data/fonts/body.txt");
-                                       echo "{$maj_font_body},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       background-color: <?php
-                               if (file_exists("data/colors/bg.txt")) {
-                                       $maj_background_color = file_get_contents("data/colors/bg.txt");
-                                       if ($maj_background_color == "transparent") {
-                                               echo "#ffffff";
-                                       }
-                                       else {
-                                               echo $maj_background_color;
-                                       }
-                               }
-                               else {
-                                       echo "#ffffff";
-                               }
-       ?>;
+       echo "font-size: $maj_font_Dpx;";
 
-       <?php
-       if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>
-               background-image: url('images/background.gif');
-               background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
-               background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
-               background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
-       <?php
-       }
-       if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>
-               background-image: url('images/background.jpg');
-               background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
-               background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
-               background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
-       <?php
-       }
-       if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) { ?>
-               background-image: url('images/background.png');
-               background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
-               background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
-               background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
-       <?php
+       if (file_exists("data/colors/font.txt")) {
+               $maj_font_color = file_get_contents("data/colors/font.txt");
+               echo "\n\tcolor: $maj_font_color;";
+       }
+
+       if (file_exists("data/fonts/body.txt")) {
+               $maj_font_body = file_get_contents("data/fonts/body.txt");
+               echo "\n\tfont-family: $maj_font_body,arial,helvetica,sans-serif;";
        }
+      
+       if (file_exists("data/colors/bg.txt")) {
+               $maj_background_color = file_get_contents("data/colors/bg.txt");
+               if ($maj_background_color == "transparent") {
+                       echo "\n\tbackground-color: #ffffff;";
+               }
+               else {
+               echo "\n\tbackground-color: $maj_background_color;";
+               }
+       }
+
+       if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
+
+               if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+                       echo "\n\tbackground-image: url(\"images/background.gif\");";
+               }
+              
+               if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+                       echo "\n\tbackground-image: url(\"images/background.jpg\");";
+               }
+              
+               if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+                       echo "\n\tbackground-image: url(\"images/background.png\");";
+               }
+              
+               echo "\n\tbackground-attachment: ";
+              
+               if (file_exists("data/bg-scroll.txt")) {
+                       echo "scroll";
+               }
+               else {
+                       echo "fixed";
+               }
+              
+               echo ";";
+              
+               echo "\n\tbackground-repeat: ";
+              
+               if (file_exists("data/bg-repeat.txt")) {
+                       readfile("data/bg-repeat.txt");
+               }
+               else {
+                       echo "repeat";
+               }
+              
+               echo ";";
+              
+               echo "\n\tbackground-position: ";
+              
+               if (file_exists("data/bg-position.txt")) {
+                       readfile("data/bg-position.txt");
+               }
+               else {
+                       echo "top left";
+               }
+
+               echo ";";
+       }
+
+       echo "\n";
+      
        ?>
 }
 
 p,td {
-       font-size: <?php echo $maj_font_11px; ?>;
+       font-size: <?php echo $maj_font_Mpx; ?>;
 }
 
 a {
@@ -117,51 +144,59 @@ a {
 }
 
 a:link {
-       color: <?php
-                       if (file_exists("data/colors/link.txt")) {
-                               $maj_a_link_color = file_get_contents("data/colors/link.txt");
-                               echo $maj_a_link_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
+       color: #666666;
+       <?php
+
+       echo "font-size: $maj_font_Mpx;\n";
+
+       if (file_exists("data/colors/link.txt")) {
+               $maj_a_link_color = file_get_contents("data/colors/link.txt");
+               echo "\tcolor: $maj_a_link_color;\n";
+       }
+
+       ?>
 }
 
 a:visited {
-       color: <?php
-                       if (file_exists("data/colors/vlink.txt")) {
-                               $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
-                               echo $maj_a_visited_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
+       color: #666666;
+       <?php
+      
+       echo "font-size: $maj_font_Mpx;\n";
+
+       if (file_exists("data/colors/vlink.txt")) {
+               $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
+               echo "\tcolor: $maj_a_visited_color;\n";
+       }
+
+       ?>
 }
 
 a:hover {
-       color: <?php
-                       if (file_exists("data/colors/hover.txt")) {
-                               $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
-                               echo $maj_a_hover_color;
-                       }
-                       else {
-                               echo "#336699";
-                       }
-       ?>;
+       color: #336699;
+       <?php
+
+       echo "font-size: $maj_font_Mpx;\n";
+      
+       if (file_exists("data/colors/hover.txt")) {
+               $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
+               echo "\tcolor: $maj_a_hover_color;\n";
+       }
+
+       ?>
 }
 
 a:active {
-       color: <?php
-                       if (file_exists("data/colors/hover.txt")) {
-                               $maj_a_active_color = file_get_contents("data/colors/hover.txt");
-                               echo $maj_a_active_color;
-                       }
-                       else {
-                               echo "#336699";
-                       }
-       ?>;
+       color: #336699;
+       <?php
+
+       echo "font-size: $maj_font_Mpx;\n";
+      
+       if (file_exists("data/colors/hover.txt")) {
+               $maj_a_active_color = file_get_contents("data/colors/hover.txt");
+               echo "\tcolor: $maj_a_active_color;\n";
+       }
+
+       ?>
 }
 
 a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
@@ -170,543 +205,282 @@ a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
 }
 
 .panel_title {
-       padding: 5px 5px 5px 5px;
-       margin: 0px 0px 0px 0px;
+       padding: 5px;
+       margin: 0px;
+       color: #666666;
+       background-color: transparent;
+       border-color: #cccccc;
        border-width: 1px 1px 0px 1px;
        border-style: solid solid none solid;
+       font-family: arial,helvetica,sans-serif;
        font-weight: bold;
+       <?php
+
+       echo "font-size: $maj_font_Lpx;";
+
+       if (file_exists("data/round.txt")) {
+               echo "\n\t-webkit-border-top-right-radius: $maj_border_radius;";
+               echo "\n\t-webkit-border-top-left-radius: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-topright: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-topleft: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-topright: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-topleft: $maj_border_radius;";
+               echo "\n\tborder-top-right-radius: $maj_border_radius;";
+               echo "\n\tborder-top-left-radius: $maj_border_radius;";
+       }
+      
+       if (file_exists("data/colors/pt-font.txt")) {
+               $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
+               echo "\n\tcolor: $maj_panel_title_font_color;";
+       }
 
-       font-size: <?php echo $maj_font_12px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-title.txt")) {
-                                       $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
-                                       echo "{$maj_font_panel_title},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       color: <?php
-                       if (file_exists("data/colors/pt-font.txt")) {
-                               $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
-                               echo $maj_panel_title_font_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pt-bg.txt")) {
-                                       $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
-                                       echo $maj_panel_title_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                               if (file_exists("data/colors/border.txt")) {
-                                       $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                                       echo $maj_panel_title_border_color;
-                               }
-                               else {
-                                       echo "#cccccc";
-                               }
-       ?>;
+       if (file_exists("data/colors/pt-bg.txt")) {
+               $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+               echo "\n\tbackground-color: $maj_panel_title_background_color;";
+       }
+
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_title_border_color;";
+       }
+
+       if (file_exists("data/fonts/panel-title.txt")) {
+               $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+               echo "\n\tfont-family: $maj_font_panel_title,arial,helvetica,sans-serif;";
+       }
+
+       echo "\n";
+      
+       ?>
 }
 
 .panel_body {
-       font-size: <?php echo $maj_font_11px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "{$maj_font_panel_body},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       color: <?php
-                       if (file_exists("data/colors/pb-font.txt")) {
-                               $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
-                               echo $maj_panel_body_font_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
-
+       padding: 5px;
+       margin: 0px 0px 10px 0px;
+       color: #666666;
+       background-color: transparent;
+       border-color: #cccccc;
+       border-width: 1px;
+       border-style: solid;
+       font-family: arial,helvetica,sans-serif;                               
        <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'padding: 5px 5px 2px 5px;';
-               }
-               else {
-                       echo 'padding: 5px 5px 5px 5px;';
-               }
-       ?>
+      
+       echo "font-size: $maj_font_Mpx;";
+      
+       if (file_exists("data/round.txt")) {
+               echo "\n\t-webkit-border-bottom-right-radius: $maj_border_radius;";
+               echo "\n\t-webkit-border-bottom-left-radius: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-bottomright: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-bottomleft: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-bottomright: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-bottomleft: $maj_border_radius;";
+               echo "\n\tborder-bottom-right-radius: $maj_border_radius;";
+               echo "\n\tborder-bottom-left-radius: $maj_border_radius;";
+       }
+      
+       if (file_exists("data/colors/pb-font.txt")) {
+               $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+               echo "\n\tcolor: $maj_panel_body_font_color;";
+       }
 
-       background-color: <?php
-                               if (file_exists("data/colors/pb-bg.txt")) {
-                                       $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
-                                       echo $maj_panel_body_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
+       if (file_exists("data/colors/pb-bg.txt")) {
+               $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+               echo "\n\tbackground-color: $maj_panel_body_background_color;";
+       }
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'margin: 0px 0px 0px 0px;';
-               }
-               else {
-                       echo 'margin: 0px 0px 10px 0px;';
-               }
-       ?>
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_body_border_color;";
+       }
 
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_body_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       }
-       ?>;
+       if (file_exists("data/fonts/panel-body.txt")) {
+               $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+               echo "\n\tfont-family: $maj_font_panel_body,arial,helvetica,sans-serif;";
+       }
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'border-width: 1px 1px 0px 1px;';
-                       echo 'border-style: solid solid none solid;';
-               }
-               else {
-                       echo 'border-width: 1px 1px 1px 1px;';
-                       echo 'border-style: solid solid solid solid;';
-               }
+       echo "\n";
+      
        ?>
 }
 
 .panel_footer {
+       padding: 5px;
+       margin: 0px 0px 10px 0px;
+       color: #999999;
+       background-color: transparent;
+       border-color: #cccccc;
+       border-width: 0px 1px 1px 1px;
+       border-style: none solid solid solid;
        text-align: right;
-
-       font-size: <?php echo $maj_font_10px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-footer.txt")) {
-                                       $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
-                                       echo "{$maj_font_panel_footer},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-
-
-       color: <?php
-                       if (file_exists("data/colors/pf-font.txt")) {
-                               $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
-                               echo $maj_panel_footer_font_color;
-                       }
-                       else {
-                               echo "#999999";
-                       }
-       ?>;
-
+       font-family: arial,helvetica,sans-serif;
        <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'padding: 5px 5px 2px 5px;';
-               }
-               else {
-                       echo 'padding: 5px 5px 5px 5px;';
-               }
-       ?>
+      
+       echo "font-size: $maj_font_Spx;";
+      
+       if (file_exists("data/round.txt")) {
+               echo "\n\t-webkit-border-bottom-right-radius: $maj_border_radius;";
+               echo "\n\t-webkit-border-bottom-left-radius: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-bottomright: $maj_border_radius;";
+               echo "\n\t-khtml-border-radius-bottomleft: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-bottomright: $maj_border_radius;";
+               echo "\n\t-moz-border-radius-bottomleft: $maj_border_radius;";
+               echo "\n\tborder-bottom-right-radius: $maj_border_radius;";
+               echo "\n\tborder-bottom-left-radius: $maj_border_radius;";
+       }
+      
+       if (file_exists("data/colors/pf-font.txt")) {
+               $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
+               echo "\n\tcolor: $maj_panel_footer_font_color;";
+       }
 
-       background-color: <?php
-                               if (file_exists("data/colors/pf-bg.txt")) {
-                                       $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
-                                       echo $maj_panel_footer_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
+       if (file_exists("data/colors/pf-bg.txt")) {
+               $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
+               echo "\n\tbackground-color: $maj_panel_footer_background_color;";
+       }
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'margin: 0px 0px 0px 0px;';
-               }
-               else {
-                       echo 'margin: 0px 0px 10px 0px;';
-               }
-       ?>
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_footer_border_color;";
+       }
 
-       border-color: <?php
-                               if (file_exists("data/colors/border.txt")) {
-                                       $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
-                                       echo $maj_panel_footer_border_color;
-                               }
-                               else {
-                                       echo "#cccccc";
-                               }
-       ?>;
+       if (file_exists("data/fonts/panel-footer.txt")) {
+               $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
+               echo "\n\tfont-family: $maj_font_panel_footer,arial,helvetica,sans-serif;";
+       }
+
+       echo "\n";
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'border-width: 1px 1px 0px 1px;';
-                       echo 'border-style: solid solid none solid;';
-               }
-               else {
-                       echo 'border-width: 0px 1px 1px 1px;';
-                       echo 'border-style: none solid solid solid;';
-               }
        ?>
 }
 
 .input {      
        width: 300px;
+       color: #666666;
        background: #ffffff;
+       border: #999999 solid 1px;
+       font-family: arial,helvetica,sans-serif;
+       <?php
+      
+       echo "font-size: $maj_font_Ipx;";
+
+       if (file_exists("data/colors/border.txt")) {
+               $maj_input_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tcolor: $maj_input_color;";
+       }
 
-       font-size: <?php echo $maj_input_px; ?>;
-
-       color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_input_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_input_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
-
-       border: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_footer_border_color;
-                       }
-                       else {
-                               echo "#999999";
-                       }
-       ?> solid 1px;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/input.txt")) {
-                                       $maj_font_input = file_get_contents("data/fonts/input.txt");
-                                       echo "{$maj_font_input},";
-                               }
-       ?> arial,helvetica,sans-serif;
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_footer_border_color;";
+       }
+
+       if (file_exists("data/fonts/input.txt")) {
+               $maj_font_input = file_get_contents("data/fonts/input.txt");
+               echo "\n\tfont-family: $maj_font_input,arial,helvetica,sans-serif;";
+       }
+      
+       echo "\n";
+      
+       ?>
 }
 
 .search {      
+       width: 100%;
        color: #666666;
        background: #ffffff;
-       width: 100%;
-
-       font-size: <?php echo $maj_font_11px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/input.txt")) {
-                                       $maj_font_input = file_get_contents("data/fonts/input.txt");
-                                       echo "{$maj_font_input},";
-                               }
-       ?> arial,helvetica,sans-serif;
+       font-family: arial,helvetica,sans-serif;
+       <?php
+      
+       echo "font-size: $maj_font_Mpx;";
+      
+       if (file_exists("data/fonts/input.txt")) {
+               $maj_font_input = file_get_contents("data/fonts/input.txt");
+               echo "\n\tfont-family: $maj_font_input,arial,helvetica,sans-serif;";
+       }
+      
+       echo "\n";
+      
+       ?>                                     
 }
 
 .panel_free {
-       padding: 0px 0px 0px 0px;
-       margin: 0px 0px 0px 0px;
+       padding: 0px;
+       margin: 0px;
 }
 
-.rbtop {
-       display: block;
-       background: transparent;
-       font-size: 1px;
-       margin: 0px 0px 0px 0px;
-}
-
-.rbbottom {
-       display: block;
-       background: transparent;
-       font-size: 1px;
-       margin: 0px 0px 10px 0px;
-}
-
-.rb1t,.rb2t,.rb3t,.rb4t,.rb1b,.rb2b,.rb3b,.rb4b,.rb1e,.rb2e,.rb3e,.rb4e {
-       display: block;
-       overflow: hidden;
-}
-
-.rb1t,.rb2t,.rb3t,.rb1b,.rb2b,.rb3b,.rb1e,.rb2e,.rb3e {
-       height: 1px;
-}
-
-.rb2t,.rb3t,.rb4t {
-       border-left: 1px solid;
-       border-right: 1px solid;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pt-bg.txt")) {
-                                       $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
-                                       echo $maj_panel_title_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_title_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       };
-       ?>;
-}
-
-.rb2b,.rb3b,.rb4b {
-       border-left: 1px solid;
-       border-right: 1px solid;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pb-bg.txt")) {
-                                       $maj_panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
-                                       echo $maj_panel_title_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_title_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       };
-       ?>;
-}
+.panel_entry_body {
+       padding: 5px;
+       margin: 0px;
+       color: #666666;
+       background-color: transparent;
+       border-color: #cccccc;
+       border-width: 1px;
+       border-style: solid;
+       font-family: arial,helvetica,sans-serif;
+       <?php
 
-.rb2e,.rb3e,.rb4e {
-       border-left: 1px solid;
-       border-right: 1px solid;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pf-bg.txt")) {
-                                       $maj_panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
-                                       echo $maj_panel_title_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_title_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       };
-       ?>;
-}
-
-.rb1t,.rb1b,.rb1e {
-       margin: 0 5px;
-
-       background: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_title_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       };
-       ?>;
-}
-
-.rb2t,.rb2b,.rb2e {
-       margin: 0 3px;
-       border-width: 0 2px;
-}
-
-.rb3t,.rb3b,.rb3e {
-       margin: 0 2px;
-}
-
-.rb4t,.rb4b,.rb4e {
-       height: 2px;
-       margin: 0 1px;
-}
-
-.xtitle {
-       display: block;
-       border:0 solid;
-       border-width:0 1px;
-       padding: 1px 5px 5px 5px;
-       font-weight: bold;
+       echo "font-size: $maj_font_Mpx;";
 
-       font-size: <?php echo $maj_font_12px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-title.txt")) {
-                                       $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
-                                       echo "{$maj_font_panel_title},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       color: <?php
-                       if (file_exists("data/colors/pt-font.txt")) {
-                               $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
-                               echo $maj_panel_title_font_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pt-bg.txt")) {
-                                       $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
-                                       echo $maj_panel_title_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_title_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       };
-       ?>;
-}
-
-.rbspace {
-       height: 3px;
-}
+       if (file_exists("data/colors/pb-font.txt")) {
+               $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+               echo "\n\tcolor: $maj_panel_body_font_color;";
+       }
 
-.panel_entry_body {
-       margin: 0px 0px 0px 0px;
-
-       font-size: <?php echo $maj_font_11px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "{$maj_font_panel_body},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       color: <?php
-                       if (file_exists("data/colors/pb-font.txt")) {
-                               $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
-                               echo $maj_panel_body_font_color;
-                       }
-                       else {
-                               echo "#666666";
-                       }
-       ?>;
+       if (file_exists("data/colors/pb-bg.txt")) {
+               $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+               echo "\n\tbackground-color: $maj_panel_body_background_color;";
+       }
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'padding: 5px 5px 2px 5px;';
-               }
-               else {
-                       echo 'padding: 5px 5px 5px 5px;';
-               }
-       ?>
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_body_border_color;";
+       }
 
-       background-color: <?php
-                               if (file_exists("data/colors/pb-bg.txt")) {
-                                       $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
-                                       echo $maj_panel_body_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                       if (file_exists("data/colors/border.txt")) {
-                               $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
-                               echo $maj_panel_body_border_color;
-                       }
-                       else {
-                               echo "#cccccc";
-                       }
-       ?>;
+       if (file_exists("data/fonts/panel-body.txt")) {
+               $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+               echo "\n\tfont-family: $maj_font_panel_body,arial,helvetica,sans-serif;";
+       }
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'border-width: 1px 1px 0px 1px;';
-                       echo 'border-style: solid solid none solid;';
-               }
-               else {
-                       echo 'border-width: 1px 1px 1px 1px;';
-                       echo 'border-style: solid solid solid solid;';
-               }
+       echo "\n";
+      
        ?>
 }
 
 .panel_category {
-       padding: 5px 5px 5px 5px;
-       margin: 0px 0px 0px 0px;
+       padding: 5px;
+       margin: 0px;
+       color: #999999;
+       background-color: transparent;
+       border-color: #cccccc;
+       border-width: 0px 1px 1px 1px;
+       border-style: none solid solid solid;
        text-align: left;
+       font-family: arial,helvetica,sans-serif;
+       <?php
 
-       font-size: <?php echo $maj_font_10px; ?>;
-
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-footer.txt")) {
-                                       $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
-                                       echo "{$maj_font_panel_category},";
-                               }
-       ?> arial,helvetica,sans-serif;
-
-       color: <?php
-                       if (file_exists("data/colors/pf-font.txt")) {
-                               $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
-                               echo $maj_panel_category_font_color;
-                       }
-                       else {
-                               echo "#999999";
-                       }
-       ?>;
-
-       background-color: <?php
-                               if (file_exists("data/colors/pf-bg.txt")) {
-                                       $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
-                                       echo $maj_panel_category_background_color;
-                               }
-                               else {
-                                       echo "transparent";
-                               }
-       ?>;
-
-       border-color: <?php
-                               if (file_exists("data/colors/border.txt")) {
-                                       $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
-                                       echo $maj_panel_category_border_color;
-                               }
-                               else {
-                                       echo "#cccccc";
-                               }
-       ?>;
+       echo "font-size: $maj_font_Spx;";
 
-       <?php
-               if (file_exists("data/round.txt")) {
-                       echo 'border-width: 1px 1px 0px 1px;';
-                       echo 'border-style: solid solid none solid;';
-               }
-               else {
-                       echo 'border-width: 0px 1px 1px 1px;';
-                       echo 'border-style: none solid solid solid;';
-               }
+       if (file_exists("data/colors/pf-font.txt")) {
+               $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
+               echo "\n\tcolor: $maj_panel_category_font_color;";
+       }
+
+       if (file_exists("data/colors/pf-bg.txt")) {
+               $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
+               echo "\n\tbackground-color: $maj_panel_category_background_color;";
+       }
+
+       if (file_exists("data/colors/border.txt")) {
+               $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
+               echo "\n\tborder-color: $maj_panel_category_border_color;";
+       }
+
+       if (file_exists("data/fonts/panel-footer.txt")) {
+               $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
+               echo "\n\tfont-family: $maj_font_panel_category,arial,helvetica,sans-serif;";
+       }
+      
+       echo "\n";
+      
        ?>
 }
 
diff --git a/del.php b/del.php
index b3f9fc3..631d53f 100644
--- a/del.php
+++ b/del.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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 (file_exists("data/offset.txt")) {
@@ -34,31 +21,6 @@ else {
        $offset = 0;
 }
 
-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($_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'])) {
diff --git a/dig.php b/dig.php
index 5c90d8d..90ca003 100644
--- a/dig.php
+++ b/dig.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 if (file_exists("data/offset.txt")) {
        $offset = file_get_contents("data/offset.txt");
 }
diff --git a/edit.php b/edit.php
index 528f03a..028d32f 100644
--- a/edit.php
+++ b/edit.php
@@ -1,140 +1,71 @@
 <?php
-
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
-       header("Location: login.php");
-}
-
-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($_POST['title_input']) and isset($_POST['body_input'])) {
-       header("Location: edit.php?entry={$_REQUEST['entry']}");
-}
-
-if (!isset($_REQUEST['entry'])) {
-       exit();
-}
-
-if (!file_exists("data/items/{$_REQUEST['entry']}")) {
-       exit();
-}
-
-if (!isset($_SESSION['logged_in'])) {
-       exit();
-}
-
-$do = 0;
-
-if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
-       $do = 1;
-}
-
-if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
-       $do = 0;
-}
-
-if ($_SESSION['logged_in'] == $login_username) {
-       $do = 1;
-}
-
-if ($do == 0) {
-       exit();
-}
-
-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);
-}
-
-function entry2date($f_entry) {
-
-       $f_entry_year = substr($f_entry,0,4);
-       $f_entry_month = substr($f_entry,4,2);
-       $f_entry_day = substr($f_entry,6,2);
-       $f_entry_hour = substr($f_entry,8,2);
-       $f_entry_min = substr($f_entry,10,2);
-       $f_entry_sec = substr($f_entry,12,2);
-
-       echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
-}
-
-$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";
-
-function return_bytes($val) {
-       $val = trim($val);
-       $last = $val{strlen($val)-1};
-    
-       switch($last) {
-               case 'k':
-               case 'K':
-                       return (int) $val * 1024;
-                       break;
-               case 'm':
-               case 'M':
-                       return (int) $val * 1048576;
-                       break;
-               default:
-                       return $val;
-       }
-}
-
-$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
-$server_post_max_size = return_bytes(ini_get('post_max_size'));
-$server_memory_limit = return_bytes(ini_get('memory_limit'));
-
-$max_file_size = $server_upload_max_filesize;
-
-if ($server_upload_max_filesize > $server_post_max_size) {
-       $max_file_size = $server_post_max_size;
-}
-
-if ($server_post_max_size > $server_memory_limit) {
-       $max_file_size = $server_memory_limit;
-}
-
+  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 (isset($_POST['title_input']) and isset($_POST['body_input'])) {
+      header("Location: edit.php?entry={$_REQUEST['entry']}");
+  }
+  
+  if (!isset($_REQUEST['entry'])) {
+      exit();
+  }
+  
+  if (!file_exists("data/items/{$_REQUEST['entry']}")) {
+      exit();
+  }
+  
+  if (!isset($_SESSION['logged_in'])) {
+      exit();
+  }
+  
+  $do = 0;
+  
+  if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
+      $do = 1;
+  }
+  
+  if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+      $do = 0;
+  }
+  
+  if ($_SESSION['logged_in'] == $login_username) {
+      $do = 1;
+  }
+  
+  if ($do == 0) {
+      exit();
+  }
+  
+  $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";
+  
+  $server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+  $server_post_max_size = return_bytes(ini_get('post_max_size'));
+  $server_memory_limit = return_bytes(ini_get('memory_limit'));
+  
+  $max_file_size = $server_upload_max_filesize;
+  
+  if ($server_upload_max_filesize > $server_post_max_size) {
+      $max_file_size = $server_post_max_size;
+  }
+  
+  if ($server_post_max_size > $server_memory_limit) {
+      $max_file_size = $server_memory_limit;
+  }
 ?>
 
 <title>Edit</title>
@@ -142,373 +73,371 @@ if ($server_post_max_size > $server_memory_limit) {
 <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;
+  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;
+  font-size: 11px;
 }
 
 a {
-       font-weight: bold;
-       text-decoration: none;
+  font-weight: bold;
+  text-decoration: none;
 }
 
 a:link, a:visited {
-       color: #666666;
+  color: #666666;
 }
 
 a:hover {
-       color: #336699;
+  color: #336699;
 }
 
 a:active {
-       color: #336699;
+  color: #336699;
 }
 
-.input_title {        
-       color: #666666;
-       background: #ffffff;
-       border: #999999 solid 1px;
-       width: 525px;
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-title.txt")) {
-                                       $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
-                                       echo "{$font_panel_title},";
-                               }
-       ?> arial, helvetica, sans-serif;
-       font-size: 11px;
-       font-weight: bold
+.input_title {  
+  color: #666666;
+  background: #ffffff;
+  border: #999999 solid 1px;
+  width: 525px;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-title.txt")) {
+      $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+      echo "{$font_panel_title},";
+  }
+?> arial, helvetica, sans-serif;
+  font-size: 11px;
+  font-weight: bold
 }
 
-.input_body {  
-       color: #666666;
-       background: #ffffff;
-       border: #999999 solid 1px;
-       width: 525px;
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "{$font_panel_body},";
-                               }
-       ?> arial, helvetica, sans-serif;
-       font-size: 11px
+.input_body {  
+  color: #666666;
+  background: #ffffff;
+  border: #999999 solid 1px;
+  width: 525px;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-body.txt")) {
+      $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+      echo "{$font_panel_body},";
+  }
+?> arial, helvetica, sans-serif;
+  font-size: 11px
 }
 
 #panel_title {
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-title.txt")) {
-                                       $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
-                                       echo "{$font_panel_title},";
-                               }
-       ?> arial, 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;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-title.txt")) {
+      $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+      echo "{$font_panel_title},";
+  }
+?> arial, 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: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "{$font_panel_body},";
-                               }
-       ?> arial, 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;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-body.txt")) {
+      $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+      echo "{$font_panel_body},";
+  }
+?> arial, 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: <?php
-                               if (file_exists("data/fonts/panel-footer.txt")) {
-                                       $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
-                                       echo "{$font_panel_footer},";
-                               }
-       ?> arial, 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;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-footer.txt")) {
+      $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
+      echo "{$font_panel_footer},";
+  }
+?> arial, 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;
 }
 
-.input_cat {  
-       color: #666666;
-       background: #ffffff;
-       border: #999999 solid 1px;
-       width: 40px;
-       font-family: <?php
-                               if (file_exists("data/fonts/panel-body.txt")) {
-                                       $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
-                                       echo "{$font_panel_body},";
-                               }
-       ?> arial, helvetica, sans-serif;
-       font-size: 11px
+.input_cat {  
+  color: #666666;
+  background: #ffffff;
+  border: #999999 solid 1px;
+  width: 40px;
+  font-family: <?php
+  if (file_exists("data/fonts/panel-body.txt")) {
+      $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+      echo "{$font_panel_body},";
+  }
+?> arial, helvetica, sans-serif;
+  font-size: 11px
 }
 
-<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
+<?php
+  if (file_exists("data/css.txt")) {
+      readfile("data/css.txt");
+  }
+?>
 
 </style>
 
 <?php
-
-if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_POST['auth_toggle']) and !empty($_POST['auth_toggle'])) {
-      
-       if (($_POST['auth_toggle'] == "ack") and file_exists("data/members/active/{$_POST['auth_member']}")) {
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/members")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/members");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/imembers")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/imembers");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
-               }
-       }
-
-        if (($_POST['auth_toggle'] == "nak") and file_exists("data/members/active/{$_POST['auth_member']}")) {
-
-                if (file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
-                        rmdirr("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
-                }
-
-                if (file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
-                        rmdirr("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
-                }
-        }
-}
-
-if (isset($_POST['category']) and !empty($_POST['category'])) {
-
-       if (file_exists("data/categories/{$_REQUEST['category']}/members")) {
-
-               if ($dh_cat_members = opendir("data/categories/{$_REQUEST['category']}/members")) {
-              
-                       while (($get_cat_member = readdir($dh_cat_members)) !== false) {
-              
-                               if ($get_cat_member != "." && $get_cat_member != "..") {
-
-                                       if (file_exists("data/members/active/$get_cat_member")) {
-                                               $get_cat_members[] = $get_cat_member;                                  
-                                       }
-                                       else {
-                                               rmdirr("data/categories/{$_REQUEST['category']}/members/$get_cat_member");
-                                       }
-                               }
-                       }
-                       closedir($dh_cat_members);
-               }
-       }
-
-       if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
-
-               rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
-
-               if (count(glob("data/items/{$_REQUEST['entry']}/categories/*")) < 1) {
-                       rmdirr("data/items/{$_REQUEST['entry']}/categories");
-               }
-
-               if (file_exists("data/categories")) {
-
-                       if ($dh_get_categories = opendir("data/categories")) {
-              
-                               while (($get_category = readdir($dh_get_categories)) !== false) {
-              
-                                       if ($get_category != "." && $get_category != "..") {
-                                               $get_categories[] = $get_category;
-                                       }
-                               }
-                               closedir($dh_get_categories);
-                       }
-
-                       foreach ($get_cat_members as $get_cat_mem) {
-
-                               $count_mem = 0;
-
-                               foreach ($get_categories as $get_category) {
-
-                                       if (file_exists("data/categories/$get_category/members/$get_cat_mem") and ($_REQUEST['category'] != $get_category) and file_exists("data/items/{$_REQUEST['entry']}/categories/$get_category")) {
-                                               $count_mem = $count_mem + 1;
-                                       }
-                               }
-
-                               if (($count_mem < 1) and !file_exists("data/items/{$_REQUEST['entry']}/imembers/$get_cat_mem")) {
-                                       rmdirr("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
-                               }
-                       }
-
-               }
-       }
-
-       if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/categories");
-               }
-
-               mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
-
-               foreach ($get_cat_members as $get_cat_mem) {
-
-                       if (!file_exists("data/items/{$_REQUEST['entry']}/members/$get_cat_mem")) {
-                               mkdir("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
-                       }
-               }
-       }
-}
-
-if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
-       $comment_txt = ucfirst($_POST['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/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
-       $open_comment_txt_file = fopen($comment_txt_file,"w");
-       fwrite($open_comment_txt_file,$comment_txt);
-       fclose($open_comment_txt_file);
-
-       $comment_revisions_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
-       $fp_comment_revisions_file = fopen($comment_revisions_file, "r");
-       $comment_revisions_count = fread($fp_comment_revisions_file, filesize($comment_revisions_file));
-       fclose($fp_comment_revisions_file);
-
-       $comment_revisions_count = $comment_revisions_count + 1;
-       $fp_comment_revisions_file = fopen($comment_revisions_file, "w");
-       fwrite($fp_comment_revisions_file, $comment_revisions_count);
-       fclose($fp_comment_revisions_file);
-}
-
-if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
-
-       if (!file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
-               exit();
-       }
-
+  if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_POST['auth_toggle']) and !empty($_POST['auth_toggle'])) {
+      if (($_POST['auth_toggle'] == "ack") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+          if (!file_exists("data/items/{$_REQUEST['entry']}/members")) {
+              mkdir("data/items/{$_REQUEST['entry']}/members");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+              mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/imembers")) {
+              mkdir("data/items/{$_REQUEST['entry']}/imembers");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
+              mkdir("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+          }
+      }
+      
+      if (($_POST['auth_toggle'] == "nak") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+          if (file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+              rmdirr("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+          }
+          
+          if (file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
+              rmdirr("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+          }
+      }
+  }
+  
+  if (isset($_POST['category']) and !empty($_POST['category'])) {
+      if (file_exists("data/categories/{$_REQUEST['category']}/members")) {
+          if ($dh_cat_members = opendir("data/categories/{$_REQUEST['category']}/members")) {
+              while (($get_cat_member = readdir($dh_cat_members)) !== false) {
+                  if ($get_cat_member != "." && $get_cat_member != "..") {
+                      if (file_exists("data/members/active/$get_cat_member")) {
+                          $get_cat_members[] = $get_cat_member;
+                      } else {
+                          rmdirr("data/categories/{$_REQUEST['category']}/members/$get_cat_member");
+                      }
+                  }
+              }
+              closedir($dh_cat_members);
+          }
+      }
+      
+      if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+          rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+          
+          if (count(glob("data/items/{$_REQUEST['entry']}/categories/*")) < 1) {
+              rmdirr("data/items/{$_REQUEST['entry']}/categories");
+          }
+          
+          if (file_exists("data/categories")) {
+              if ($dh_get_categories = opendir("data/categories")) {
+                  while (($get_category = readdir($dh_get_categories)) !== false) {
+                      if ($get_category != "." && $get_category != "..") {
+                          $get_categories[] = $get_category;
+                      }
+                  }
+                  closedir($dh_get_categories);
+              }
+              
+              foreach ($get_cat_members as $get_cat_mem) {
+                  $count_mem = 0;
+                  
+                  foreach ($get_categories as $get_category) {
+                      if (file_exists("data/categories/$get_category/members/$get_cat_mem") and ($_REQUEST['category'] != $get_category) and file_exists("data/items/{$_REQUEST['entry']}/categories/$get_category")) {
+                          $count_mem = $count_mem + 1;
+                      }
+                  }
+                  
+                  if (($count_mem < 1) and !file_exists("data/items/{$_REQUEST['entry']}/imembers/$get_cat_mem")) {
+                      rmdirr("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+                  }
+              }
+          }
+      }
+      
+      if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+          if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
+              mkdir("data/items/{$_REQUEST['entry']}/categories");
+          }
+          
+          mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+          
+          foreach ($get_cat_members as $get_cat_mem) {
+              if (!file_exists("data/items/{$_REQUEST['entry']}/members/$get_cat_mem")) {
+                  mkdir("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+              }
+          }
+      }
+  }
+  
+  if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
+      $comment_txt = ucfirst($_POST['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/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+      $open_comment_txt_file = fopen($comment_txt_file, "w");
+      fwrite($open_comment_txt_file, $comment_txt);
+      fclose($open_comment_txt_file);
+      
+      $comment_revisions_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
+      $fp_comment_revisions_file = fopen($comment_revisions_file, "r");
+      $comment_revisions_count = fread($fp_comment_revisions_file, filesize($comment_revisions_file));
+      fclose($fp_comment_revisions_file);
+      
+      $comment_revisions_count = $comment_revisions_count + 1;
+      $fp_comment_revisions_file = fopen($comment_revisions_file, "w");
+      fwrite($fp_comment_revisions_file, $comment_revisions_count);
+      fclose($fp_comment_revisions_file);
+  }
+  
+  if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
+      if (!file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
+          exit();
+      }
 ?>
-       <table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="525">
-       <div id="panel_title"><?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt"); ?>&nbsp;<?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt"); ?>&nbsp;&lt;<?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt"); ?>&gt;</div>
-       <div id="panel_body"><?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt"); ?></div>
-       <div id="panel_footer"><font style="font-size: 10px; color: #999999;">
-       <?php
-               entry2date($_REQUEST['comment']);
-
-               if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
-                       echo " (Revision ";
-                       readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
-                       echo ")";
-               }
-       ?>
-       </font></div>
-       </td></tr></table>
-
-       <table border="0" cellspacing="2" cellpadding="0">
-       <form enctype="multipart/form-data" action="edit.php" method="post">
-       <tr><td><textarea class="input_body" name="comment_txt" rows="10"><?php
-
-       $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
-       $open_comment_txt_file = fopen($comment_txt_file,"r");
-       $read_comment_txt_file = fread($open_comment_txt_file,filesize($comment_txt_file));
-       fclose($open_comment_txt_file);
-
-       $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 type="hidden" name="type" value="<?php echo $_REQUEST['type']; ?>"></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="index.php?entry=<?php echo $_REQUEST['entry']; ?>&show=comments" method="post">
-       <tr><td><input class="input_body" type="submit" value="click here to view posted entry"></td></tr>
-       </form>
-
-       <form enctype="multipart/form-data" action="index.php" method="post">
-       <tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
-       </form>
-       </table>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="525">
+  <div id="panel_title"><?php
+      readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt");
+?>&nbsp;<?php
+      readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt");
+?>&nbsp;&lt;<?php
+      readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt");
+?>&gt;</div>
+  <div id="panel_body"><?php
+      readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt");
+?></div>
+  <div id="panel_footer"><font style="font-size: 10px; color: #999999;">
+  <?php
+      entry2date($_REQUEST['comment']);
+      
+      if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
+          echo " (Revision ";
+          readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
+          echo ")";
+      }
+?>
+  </font></div>
+  </td></tr></table>
+
+  <table border="0" cellspacing="2" cellpadding="0">
+  <form enctype="multipart/form-data" action="edit.php" method="post">
+  <tr><td><textarea class="input_body" name="comment_txt" rows="10"><?php
+      $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+      $open_comment_txt_file = fopen($comment_txt_file, "r");
+      $read_comment_txt_file = fread($open_comment_txt_file, filesize($comment_txt_file));
+      fclose($open_comment_txt_file);
+      
+      $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 type="hidden" name="type" value="<?php
+      echo $_REQUEST['type'];
+?>"></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="index.php?entry=<?php
+      echo $_REQUEST['entry'];
+?>&show=comments" method="post">
+  <tr><td><input class="input_body" type="submit" value="click here to view posted entry"></td></tr>
+  </form>
+
+  <form enctype="multipart/form-data" action="index.php" method="post">
+  <tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
+  </form>
+  </table>
 
 <?php
-       exit();
-}
-
+      exit();
+  }
 ?>
 
 <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
 
 <table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="525">
 
-<div id="panel_title"><?php readfile($title_file); ?></div>
-<div id="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php readfile($body_file); ?></td></tr></table></div>
-<div id="panel_footer"><font style="font-size: 10px; color: #999999;"><?php
-
-if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
-       readfile("data/items/{$_REQUEST['entry']}/author.txt");
-       echo " - ";
-}
-
-entry2date($_REQUEST['entry']);
-
-if (file_exists($revisions_file)) {
-               echo ' (Revision ';
-               readfile($revisions_file);
-               echo " - ";
-               echo date("l, M j, Y, g:i A", filemtime("data/items/{$_REQUEST['entry']}/body.txt"));
-               echo ')';
-}
-
+<div id="panel_title"><?php
+  readfile($title_file);
+?></div>
+<div id="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php
+  readfile($body_file);
+?></td></tr></table></div>
+<div id="panel_footer"><font style="font-size: 10px; color: #999999;"><?php
+  if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
+      readfile("data/items/{$_REQUEST['entry']}/author.txt");
+      echo " - ";
+  }
+  
+  entry2date($_REQUEST['entry']);
+  
+  if (file_exists($revisions_file)) {
+      echo ' (Revision ';
+      readfile($revisions_file);
+      echo " - ";
+      echo date("l, M j, Y, g:i A", filemtime("data/items/{$_REQUEST['entry']}/body.txt"));
+      echo ')';
+  }
 ?>
 
 </font></div>
@@ -518,128 +447,180 @@ if (file_exists($revisions_file)) {
 
 <p><table border="0" cellspacing="2" cellpadding="0" bgcolor="#ffffff">
 
-<?php if (($_SESSION['logged_in'] == $login_username) or (file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt"))) { ?>
+<?php
+  if (($_SESSION['logged_in'] == $login_username) or (file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt"))) {
+?>
 
-<input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>">
+<input type="hidden" name="max_file_size" value="<?php
+      echo $max_file_size;
+?>">
 
 <tr><td><input autocomplete="off" type="file" name="album_image_input"> Upload optional album image. Enter optional caption below.</td></tr>
 <tr><td><input autocomplete="off" type="text" name="caption" class="input_body"></td></tr>
-<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
+<tr><td><input type="hidden" name="max_file_size" value="<?php
+      echo $max_file_size;
+?>"></td></tr>
 <tr><td><input autocomplete="off" type="file" name="entry_image_input"> Upload optional GIF, JPG, or PNG entry image.</td></tr>
-<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
-<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</td></tr>
-
-<?php
-
-}
-
-if ($_SESSION['logged_in'] == $login_username) {
+<tr><td><input type="hidden" name="max_file_size" value="<?php
+      echo $max_file_size;
+?>"></td></tr>
+<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php
+      echo($max_file_size / (1024 * 1024));
+?>MB.</td></tr>
 
+<?php
+  }
+  
+  if ($_SESSION['logged_in'] == $login_username) {
 ?>
 
-       <tr><td><input autocomplete="off" type="password" name="passwd" <?php
-
-       if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
-               echo "value=\"password\"";
-       }
-       ?>
-
-       > <?php
-
-       if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
-               echo "Enter new password or clear field to disable password protection.";
-       }
-       else {
-               echo "Enter optional password.";
-       }
-       ?></td></tr>
-
-       <tr><td><input autocomplete="off" type="text" name="maxlines" <?php
-
-       if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
-               echo "value=\"";
-               readfile("data/items/{$_REQUEST['entry']}/maxlines.txt");
-               echo "\"";
-       }
-       ?>
-
-       > <?php
-
-       if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
-               echo "Enter new maximum lines for initial display or clear field to disable.";
-       }
-       else {
-               echo "Enter optional maximum lines for initial display.";
-       }
-       ?></td></tr>
-
-       <tr><td><input type="checkbox" name="sticky" <?php $sticky_sem = 'data/sticky/' . $_REQUEST['entry']; if (file_exists($sticky_sem)) { echo checked; } ?>>Put entry title in Quick Links box.</td></tr>
-       <tr><td><input type="checkbox" name="pdf" <?php if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) { echo checked; } ?>>Allow PDF generation for this entry.</td></tr>
-       <tr><td><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.</td></tr>
-       <tr><td><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<?php if (file_exists("data/ml.txt")) { echo " and to the mailing list"; } ?>, even if always display is set.</td></tr>
-
-       <?php if (file_exists("data/bb.txt")) { ?>
-
-       <tr><td><input type="checkbox" name="member" <?php $member_sem = "data/items/{$_REQUEST['entry']}/member.txt"; if (file_exists($member_sem)) { echo checked; } ?>>Only registered members can view this entry.</td></tr>
-
-       <?php } ?>
+  <tr><td><input autocomplete="off" type="password" name="passwd" <?php
+      if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+          echo "value=\"password\"";
+      }
+?>
 
-       <?php
+  > <?php
+      if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+          echo "Enter new password or clear field to disable password protection.";
+      } else {
+          echo "Enter optional password.";
+      }
+?></td></tr>
+
+  <tr><td><input autocomplete="off" type="text" name="maxlines" <?php
+      if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+          echo "value=\"";
+          readfile("data/items/{$_REQUEST['entry']}/maxlines.txt");
+          echo "\"";
+      }
+?>
 
-       if (file_exists("data/bb.txt") and file_exists("data/wiki.txt")) { ?>
+  > <?php
+      if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+          echo "Enter new maximum lines for initial display or clear field to disable.";
+      } else {
+          echo "Enter optional maximum lines for initial display.";
+      }
+?></td></tr>
+
+  <tr><td><input type="checkbox" name="sticky" <?php
+      $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+      if (file_exists($sticky_sem)) {
+          echo checked;
+      }
+?>>Put entry title in Quick Links box.</td></tr>
+  <tr><td><input type="checkbox" name="pdf" <?php
+      if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
+          echo checked;
+      }
+?>>Allow PDF generation for this entry.</td></tr>
+  <tr><td><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.</td></tr>
+  <tr><td><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<?php
+      if (file_exists("data/ml.txt")) {
+          echo " and to the mailing list";
+      }
+?>, even if always display is set.</td></tr>
+
+  <?php
+      if (file_exists("data/bb.txt")) {
+?>
 
-       <tr><td><input type="checkbox" name="edit" <?php $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt"; if (file_exists($edit_sem)) { echo checked; } ?>>Registered members can edit this entry.</td></tr>
-       <tr><td><input type="checkbox" name="lock" <?php if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) { echo checked; } ?>>Only the administrator can edit this entry. </td></tr>
+  <tr><td><input type="checkbox" name="member" <?php
+          $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+          if (file_exists($member_sem)) {
+              echo checked;
+          }
+?>>Only registered members can view this entry.</td></tr>
 
-       <?php
+  <?php
+      }
+?>
 
-       }
+  <?php
+      if (file_exists("data/bb.txt") and file_exists("data/wiki.txt")) {
+?>
 
-       ?>
+  <tr><td><input type="checkbox" name="edit" <?php
+          $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+          if (file_exists($edit_sem)) {
+              echo checked;
+          }
+?>>Registered members can edit this entry.</td></tr>
+  <tr><td><input type="checkbox" name="lock" <?php
+          if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+              echo checked;
+          }
+?>>Only the administrator can edit this entry. </td></tr>
+
+  <?php
+      }
+?>
 
-       <tr><td><input type="checkbox" name="lastmod" <?php $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt"; if (file_exists($lastmod_sem)) { echo checked; } ?>>Display last modification date and time.</td></tr>
+  <tr><td><input type="checkbox" name="lastmod" <?php
+      $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+      if (file_exists($lastmod_sem)) {
+          echo checked;
+      }
+?>>Display last modification date and time.</td></tr>
 
-<?php } ?>
+<?php
+  }
+?>
 
 </table></p>
 
-<input type="hidden" name="entry" value="<?php echo $_REQUEST['entry']; ?>">
+<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><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
-
-$open_body_file = fopen($body_file,"r");
-$read_body_file = fread($open_body_file,filesize($body_file));
-fclose($open_body_file);
-
-$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);
-$body_read_content = str_replace('<!-- html -->', '<html>', $body_read_content);
-$body_read_content = str_replace('<!-- /html -->', '</html>', $body_read_content);
-$body_read_content = str_replace('<span style="background-color: #ffff00;">', '<highlight>', $body_read_content);
-$body_read_content = str_replace('</span>', '</highlight>', $body_read_content);
-
-echo $body_read_content;
-
+<?php
+  $open_body_file = fopen($body_file, "r");
+  $read_body_file = fread($open_body_file, filesize($body_file));
+  fclose($open_body_file);
+  
+  $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);
+  $body_read_content = str_replace('<!-- html -->', '<html>', $body_read_content);
+  $body_read_content = str_replace('<!-- /html -->', '</html>', $body_read_content);
+  $body_read_content = str_replace('<span style="background-color: #ffff00;">', '<highlight>', $body_read_content);
+  $body_read_content = str_replace('</span>', '</highlight>', $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="index.php?entry=<?php echo $_REQUEST['entry']; ?>" method="post">
+<form enctype="multipart/form-data" action="index.php?entry=<?php
+  echo $_REQUEST['entry'];
+?>" method="post">
 <tr><td><input class=input_body type=submit value="click here to view posted entry"></td></tr>
 </form>
 
@@ -669,848 +650,614 @@ echo $body_read_content;
 </td><td width="25"></td><td valign="top">
 
 <?php
-
-// improve category handling (20100221) - start
-
-if (file_exists("data/categories")) {
-
-       echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
-
-       if ($dh_cat = opendir("data/categories")) {
-
-               while (($entry_cat = readdir($dh_cat)) !== false) {
-      
-                       if ($entry_cat != "." && $entry_cat != "..") {
-
-                               if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
-                                       continue;
-                               }
-
-                               if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
-                                       $filed_cat[] = $entry_cat;
-                               }
-
-                               if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
-                                       $unfiled_cat[] = $entry_cat;
-                               }
-                       }
-               }
-               closedir($dh_cat);
-      
-               sort($filed_cat);
-               sort($unfiled_cat);
-
-               reset($filed_cat);
-               reset($unfiled_cat);
-
-               $count_filed_cat = count($filed_cat);
-               $count_unfiled_cat = count($unfiled_cat);
-       }
-      
-       if ($count_filed_cat > 0) {
-
-               echo "<p><b>Filed Under</b></p>";
-
-               echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-
-               foreach ($filed_cat as $filed_category) {
-                       echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
-                       echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
-                       echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
-                       echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
-                       echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
-                       echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
-                       echo "</form>";
-               }
-
-               echo "</table>";
-       }
-
-       echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
-
-       if ($count_unfiled_cat > 0) {
-
-               echo "<p><b>Available Categories</b></p>";
-
-               echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-
-               foreach ($unfiled_cat as $unfiled_category) {
-                       echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
-                       echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
-                       echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
-                       echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
-                       echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
-                       echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
-                       echo "</form>";
-               }
-
-               echo "</table>";
-       }
-
-       echo "</td></tr></table><br>";
-}
-
-// improve category handling (20100221) - end
-
-// add member authorization (20100221) - start
-
-if (file_exists("data/members/active")) {
-
-       echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
-
-       if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
-
-               while (($ack_member = readdir($dh_ack_members)) !== false) {
-
-                       if ($ack_member != "." && $ack_member != "..") {
-
-                               if (file_exists("data/members/active/$ack_member")) {
-                                       $ack_members[] = $ack_member;
-                               }
-                               else {
-                                       rmdirr("data/items/{$_REQUEST['entry']}/members/$ack_member");
-                               }
-                       }
-               }
-               closedir($dh_ack_members);
-               sort($ack_members);
-               reset($ack_members);
-               $count_ack_members = count($ack_members);
-       }
-
-       if ($dh_nak_members = opendir("data/members/active")) {
-
-               while (($nak_member = readdir($dh_nak_members)) !== false) {
-
-                       if ($nak_member != "." && $nak_member != "..") {
-
-                               if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
-                                       continue;
-                               }
-
-                               if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
-                                       $nak_members[] = $nak_member;
-                               }
-                       }
-               }
-               closedir($dh_nak_members);
-               sort($nak_members);
-               reset($nak_members);
-               $count_nak_members = count($nak_members);
-       }
-
-       if ($count_ack_members > 0) {
-
-               echo "<p><b>Authorized Members</b></p>";
-
-               echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-
-               foreach ($ack_members as $ack_member) {
-                       echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
-                       echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
-                       echo "<input type=\"hidden\" name=\"auth_member\" value=\"$ack_member\">";
-                       echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"nak\">";
-                       echo "<tr bgcolor=\"#ffffff\"><td><a href=\"member.php?id=$ack_member\">$ack_member</a></td>";
-                       echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
-                       echo "</form>";
-               }
-               echo "</table>";
-       }
-
-       echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
-
-       if ($count_nak_members > 0) {
-
-               echo "<p><b>Registered Members</b></p>";
-
-               echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-
-               foreach ($nak_members as $nak_member) {
-
-                       echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
-                       echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
-                       echo "<input type=\"hidden\" name=\"auth_member\" value=\"$nak_member\">";
-                       echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"ack\">";
-                       echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
-                       echo "<td align=\"right\"><a href=\"member.php?id=$nak_member\">$nak_member</a></td></tr>";
-                       echo "</form>";
-               }
-               echo "</table>";
-       }
-
-       echo "</td></tr></table><br>";
-}
-
-// add member authorization (20100221) - end
-
+  // improve category handling (20100221) - start
+  
+  if (file_exists("data/categories")) {
+      echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
+      
+      if ($dh_cat = opendir("data/categories")) {
+          while (($entry_cat = readdir($dh_cat)) !== false) {
+              if ($entry_cat != "." && $entry_cat != "..") {
+                  if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
+                      continue;
+                  }
+                  
+                  if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+                      $filed_cat[] = $entry_cat;
+                  }
+                  
+                  if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+                      $unfiled_cat[] = $entry_cat;
+                  }
+              }
+          }
+          closedir($dh_cat);
+          
+          sort($filed_cat);
+          sort($unfiled_cat);
+          
+          reset($filed_cat);
+          reset($unfiled_cat);
+          
+          $count_filed_cat = count($filed_cat);
+          $count_unfiled_cat = count($unfiled_cat);
+      }
+      
+      if ($count_filed_cat > 0) {
+          echo "<p><b>Filed Under</b></p>";
+          
+          echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+          
+          foreach ($filed_cat as $filed_category) {
+              echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+              echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+              echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
+              echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
+              echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
+              echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+              echo "</form>";
+          }
+          
+          echo "</table>";
+      }
+      
+      echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+      
+      if ($count_unfiled_cat > 0) {
+          echo "<p><b>Available Categories</b></p>";
+          
+          echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+          
+          foreach ($unfiled_cat as $unfiled_category) {
+              echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+              echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+              echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
+              echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
+              echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+              echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
+              echo "</form>";
+          }
+          
+          echo "</table>";
+      }
+      
+      echo "</td></tr></table><br>";
+  }
+  
+  // improve category handling (20100221) - end
+  
+  // add member authorization (20100221) - start
+  
+  if (file_exists("data/members/active")) {
+      echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
+      
+      if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
+          while (($ack_member = readdir($dh_ack_members)) !== false) {
+              if ($ack_member != "." && $ack_member != "..") {
+                  if (file_exists("data/members/active/$ack_member")) {
+                      $ack_members[] = $ack_member;
+                  } else {
+                      rmdirr("data/items/{$_REQUEST['entry']}/members/$ack_member");
+                  }
+              }
+          }
+          closedir($dh_ack_members);
+          sort($ack_members);
+          reset($ack_members);
+          $count_ack_members = count($ack_members);
+      }
+      
+      if ($dh_nak_members = opendir("data/members/active")) {
+          while (($nak_member = readdir($dh_nak_members)) !== false) {
+              if ($nak_member != "." && $nak_member != "..") {
+                  if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+                      continue;
+                  }
+                  
+                  if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+                      $nak_members[] = $nak_member;
+                  }
+              }
+          }
+          closedir($dh_nak_members);
+          sort($nak_members);
+          reset($nak_members);
+          $count_nak_members = count($nak_members);
+      }
+      
+      if ($count_ack_members > 0) {
+          echo "<p><b>Authorized Members</b></p>";
+          
+          echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+          
+          foreach ($ack_members as $ack_member) {
+              echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+              echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+              echo "<input type=\"hidden\" name=\"auth_member\" value=\"$ack_member\">";
+              echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"nak\">";
+              echo "<tr bgcolor=\"#ffffff\"><td><a href=\"member.php?id=$ack_member\">$ack_member</a></td>";
+              echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+              echo "</form>";
+          }
+          echo "</table>";
+      }
+      
+      echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+      
+      if ($count_nak_members > 0) {
+          echo "<p><b>Registered Members</b></p>";
+          
+          echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+          
+          foreach ($nak_members as $nak_member) {
+              echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+              echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+              echo "<input type=\"hidden\" name=\"auth_member\" value=\"$nak_member\">";
+              echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"ack\">";
+              echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+              echo "<td align=\"right\"><a href=\"member.php?id=$nak_member\">$nak_member</a></td></tr>";
+              echo "</form>";
+          }
+          echo "</table>";
+      }
+      
+      echo "</td></tr></table><br>";
+  }
+  
+  // add member authorization (20100221) - end
 ?>
 
 </td></tr></table>
 
 <?php
-
-if (!isset($_POST['title_input']) or !isset($_POST['body_input']) or empty($_POST['title_input']) or empty($_POST['body_input'])) {
-       exit();
-}
-
-if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
-       unlink("data/items/{$_REQUEST['entry']}/title.old");
-}
-
-if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
-       unlink("data/items/{$_REQUEST['entry']}/body.old");
-}
-
-copy("data/items/{$_REQUEST['entry']}/title.txt","data/items/{$_REQUEST['entry']}/title.old");
-copy("data/items/{$_REQUEST['entry']}/body.txt","data/items/{$_REQUEST['entry']}/body.old");
-
-// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
-$title_write_content = ucwords($_POST['title_input']);
-$title_write_content = str_replace('<','&lt;',$title_write_content);
-$title_write_content = str_replace('>','&gt;',$title_write_content);
-$title_write_content = str_replace(' A ',' a ',$title_write_content);
-$title_write_content = str_replace(' An ',' an ',$title_write_content);
-$title_write_content = str_replace(' And ',' and ',$title_write_content);
-$title_write_content = str_replace(' As ',' as ',$title_write_content);
-$title_write_content = str_replace(' At ',' at ',$title_write_content);
-$title_write_content = str_replace(' But ',' but ',$title_write_content);
-$title_write_content = str_replace(' By ',' by ',$title_write_content);
-$title_write_content = str_replace(' For ',' for ',$title_write_content);
-$title_write_content = str_replace(' In ',' in ',$title_write_content);
-$title_write_content = str_replace(' Of ',' of ',$title_write_content);
-$title_write_content = str_replace(' On ',' on ',$title_write_content);
-$title_write_content = str_replace(' Or ',' or ',$title_write_content);
-$title_write_content = str_replace(' The ',' the ',$title_write_content);
-$title_write_content = str_replace(' To ',' to ',$title_write_content);
-
-function reformat_html($defang_html) {
-       $store_html=split("<html>",$defang_html);
-       $defang_html="";
-       $defang_html.=$store_html[0];
-       foreach($store_html as $itm_html=>$refh_html) {
-               if(eregi("</html>",$refh_html)) {
-                       $store_html1=split("</html>",$refh_html);
-                       $store_html1[0]=eregi_replace("\n","",$store_html1[0]);
-                       foreach($store_html1 as $itm_html1=>$refh_html1) {
-                               if($itm_html1==0)
-                                       $refh_html1="<!-- html -->$refh_html1<!-- /html -->";
-                                       $defang_html.=$refh_html1;
-                               }
-                       }
-               }
-       return $defang_html;
-}
-
-function reformat_code($defang_code) {
-       $store_code=split("<code>",$defang_code);
-       $defang_code="";
-       $defang_code.=$store_code[0];
-       foreach($store_code as $itm_code=>$refh_code) {
-               if(eregi("</code>",$refh_code)) {
-                       $store_code1=split("</code>",$refh_code);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/crying.png" border="0">',':((',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/frown.png" border="0">',':(',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/laughing.png" border="0">',':D',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/lick.png" border="0">',':P',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/ohno.png" border="0">',':O',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/smile.png" border="0">',':)',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/surprised.png" border="0">','=)',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/undecided.png" border="0">',':\\',$store_code1[0]);
-                       $store_code1[0] = eregi_replace('<img src="images/smileys/wink.png" border="0">',';)',$store_code1[0]);
-                       $store_code1[0]=htmlentities($store_code1[0],ENT_NOQUOTES);
-                       foreach($store_code1 as $itm_code1=>$refh_code1) {
-                               if($itm_code1==0)
-                                       $refh_code1="<code>$refh_code1</code>";
-                                       $defang_code.=$refh_code1;
-                               }
-                       }
-               }
-       return $defang_code;
-}
-
-$body_write_content = ucfirst($_POST['body_input']);
-$body_write_content = str_replace("[html]", '<html>', $body_write_content);
-$body_write_content = str_replace("[/html]", '</html>', $body_write_content);
-$body_write_content = reformat_html($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('[code]', '<code>', $body_write_content);
-$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
-$body_write_content = reformat_code($body_write_content);
-$body_write_content = str_replace("\n", '<br />', $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);
-$body_write_content = str_replace('[sup]', '<sup>', $body_write_content);
-$body_write_content = str_replace('[/sup]', '</sup>', $body_write_content);
-$body_write_content = str_replace('[sub]', '<sub>', $body_write_content);
-$body_write_content = str_replace('[/sub]', '</sub>', $body_write_content);
-$body_write_content = str_replace('[highlight]', '<highlight>', $body_write_content);
-$body_write_content = str_replace('[/highlight]', '</highlight>', $body_write_content);
-$body_write_content = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $body_write_content);
-$body_write_content = str_replace('</highlight>', '</span>', $body_write_content);
-$body_write_content =  preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.0-9a-z-]+)>/", '&lt;$1@$2.$3&gt;',$body_write_content);
-
-$fp_revisions_file = fopen($revisions_file, "r");
-$revisions_count = fread($fp_revisions_file, filesize($revisions_file));
-fclose($fp_revisions_file);
-
-$revisions_count = $revisions_count + 1;
-
-$fp_revisions_file = fopen($revisions_file, "w");
-fwrite($fp_revisions_file, $revisions_count);
-fclose($fp_revisions_file);
-
-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_file_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")) {
-
-                               $album_image_input_name = str_replace(" ","_",$_FILES['album_image_input']['name']);
-
-                               if (!file_exists("images/{$_REQUEST['entry']}/album/$album_image_input_name")) {
-
-                                       if (!file_exists("images/{$_REQUEST['entry']}")) {
-                                               mkdir("images/{$_REQUEST['entry']}");
-                                       }
-
-                                       if (!file_exists("images/{$_REQUEST['entry']}/album")) {
-                                               mkdir("images/{$_REQUEST['entry']}/album");
-                                       }
-
-                                       if (!file_exists("data/albums")) {
-                                               mkdir("data/albums");
-                                       }
-
-                                       if (!file_exists("data/albums/{$_REQUEST['entry']}")) {
-                                               mkdir("data/albums/{$_REQUEST['entry']}");
-                                       }
-
-                                       if (isset($_POST['caption']) and !empty($_POST['caption'])) {
-
-                                               if (!file_exists("data/items/{$_REQUEST['entry']}/album")) {
-                                                       mkdir("data/items/{$_REQUEST['entry']}/album");
-                                               }
-
-                                               if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions")) {
-                                                       mkdir("data/items/{$_REQUEST['entry']}/album/captions");
-                                               }
-
-                                               if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt")) {
-                                                       $caption_txt = ucfirst($_POST['caption']);
-                                                       $caption_txt = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_txt);
-                                                       $caption_txt = str_replace('[code]', '<code>', $caption_txt);
-                                                       $caption_txt = str_replace('[/code]', '</code>', $caption_txt);
-                                                       $caption_txt = str_replace("\n", '<br />', $caption_txt);
-                                                       $caption_txt = str_replace('[b]', '<b>', $caption_txt);
-                                                       $caption_txt = str_replace('[/b]', '</b>', $caption_txt);
-                                                       $caption_txt = str_replace('[i]', '<i>', $caption_txt);
-                                                       $caption_txt = str_replace('[/i]', '</i>', $caption_txt);
-                                                       $caption_txt = str_replace('[u]', '<u>', $caption_txt);
-                                                       $caption_txt = str_replace('[/u]', '</u>', $caption_txt);
-                                                       $caption_txt = str_replace('[strike]', '<strike>', $caption_txt);
-                                                       $caption_txt = str_replace('[/strike]', '</strike>', $caption_txt);
-                                                       $caption_txt = str_replace('[sup]', '<sup>', $caption_txt);
-                                                       $caption_txt = str_replace('[/sup]', '</sup>', $caption_txt);
-                                                       $caption_txt = str_replace('[sub]', '<sub>', $caption_txt);
-                                                       $caption_txt = str_replace('[/sub]', '</sub>', $caption_txt);
-                                                       $caption_txt = str_replace('[highlight]', '<highlight>', $caption_txt);
-                                                       $caption_txt = str_replace('[/highlight]', '</highlight>', $caption_txt);
-                                                       $caption_txt = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $caption_txt);
-                                                       $caption_txt = str_replace('</highlight>', '</span>', $caption_txt);
-
-                                                       $fp_caption_txt = fopen("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt","w");
-                                                       fwrite($fp_caption_txt,$caption_txt);
-                                                       fclose($fp_caption_txt);
-                                               }
-                                       }
-
-                                       $res = copy($_FILES['album_image_input']['tmp_name'],"images/{$_REQUEST['entry']}/album/$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_file_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")) {
-
-                               $entry_image_input_name = str_replace(" ","_",$_FILES['entry_image_input']['name']);
-
-                               if (!file_exists("images/{$_REQUEST['entry']}/$entry_image_input_name")) {
-
-                                       if (!file_exists("images/{$_REQUEST['entry']}")) {
-                                               mkdir("images/{$_REQUEST['entry']}");
-                                       }
-
-                                       $res = copy($_FILES['entry_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/$entry_image_input_name");
-                                       unlink($_FILES['entry_image_input']['tmp_name']);
-
-                                       $entry_image_size = getimagesize("images/{$_REQUEST['entry']}/$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=\"images/{$_REQUEST['entry']}/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$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) {
-
-                       if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop")) {
-                               mkdir("data/items/{$_REQUEST['entry']}/filedrop");
-                       }
-
-                       if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files")) {
-                               mkdir("data/items/{$_REQUEST['entry']}/filedrop/files");
-                       }
-
-                       $file_input_name = str_replace(" ","_",$_FILES['file_input']['name']);
-
-                       if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name")) {
-                               $res = copy($_FILES['file_input']['tmp_name'], "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
-                               unlink($_FILES['file_input']['tmp_name']);
-
-                               $fp_file_txt = fopen("data/items/{$_REQUEST['entry']}/filedrop/{$file_input_name}.txt","w");
-                               fwrite($fp_file_txt,"data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
-                               fclose($fp_file_txt);
-                       }
-                       else {
-                               unlink($_FILES['file_input']['tmp_name']);
-                       }
-               }
-               else {
-                       unlink($_FILES['file_input']['tmp_name']);
-               }
-       }
-       else {
-               unlink($_FILES['file_input']['tmp_name']);
-       }
-}
-
-if (file_exists("data/wiki.txt")) {
-
-       $old_title = file_get_contents("data/items/{$_REQUEST['entry']}/title.old");
-       $old_body = file_get_contents("data/items/{$_REQUEST['entry']}/body.old");
-
-       if (($old_title != $title_write_content) or ($old_body != $body_write_content)) {
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/wiki")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/wiki");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/wiki/delta");
-               }
-
-               if (file_exists("data/offset.txt")) {
-                       $offset = file_get_contents("data/offset.txt");
-               }
-               else {
-                       $offset = 0;
-               }
-
-               $ddate = date("YmdHis", time() + $offset);
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate");
-               }
-
-               $new_body = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/body.txt","w");
-               fwrite($new_body,$body_write_content);
-               fclose($new_body);
-
-               $new_title = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/title.txt","w");
-               fwrite($new_title,$title_write_content);
-               fclose($new_title);
-
-               copy("data/items/{$_REQUEST['entry']}/title.txt","data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/ptitle.txt");
-               copy("data/items/{$_REQUEST['entry']}/body.txt","data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/prev.txt");
-               copy("data/items/{$_REQUEST['entry']}/date.txt","data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/date.txt");
-
-               if (file_exists("data/items/{$_REQUEST['entry']}/contrib.txt")) {
-                       copy("data/items/{$_REQUEST['entry']}/contrib.txt","data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/contrib.txt");
-               }
-
-               $open_editor_file = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/editor.txt","w");
-               fwrite($open_editor_file,$_SESSION['logged_in']);
-               fclose($open_editor_file);
-       }
-}
-
-$open_title_file = fopen($title_file,"w");
-fwrite($open_title_file,$title_write_content);
-fclose($open_title_file);
-
-$open_body_file = fopen($body_file,"w");
-fwrite($open_body_file,$body_write_content);
-fclose($open_body_file);
-
-if (file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
-       $open_contrib_file = fopen("data/items/{$_REQUEST['entry']}/contrib.txt","w");
-       fwrite($open_contrib_file,$_SESSION['logged_in']);
-       fclose($open_contrib_file);
-}
-
-if ($_SESSION['logged_in'] == $login_username) {
-
-       $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
-
-       if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
-               if (!file_exists("data/sticky")) {
-                       mkdir("data/sticky");
-               }
-               if (!file_exists($sticky_sem)) {
-                       touch($sticky_sem);
-               }
-       }
-       if (!isset($_POST['sticky']) or empty($_POST['sticky'])) {
-               if (file_exists($sticky_sem)) {
-                       unlink($sticky_sem);
-               }
-       }
-
-       $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
-
-       if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
-               if (!file_exists($display_sem)) {
-                       touch($display_sem);
-               }
-       }
-       if (!isset($_POST['display']) or empty($_POST['display'])) {
-               if (file_exists($display_sem)) {
-                       unlink($display_sem);
-               }
-       }
-
-       $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
-
-       if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
-               if (!file_exists($private_sem)) {
-                       touch($private_sem);
-               }
-       }
-       if (!isset($_POST['private']) or empty($_POST['private'])) {
-               if (file_exists($private_sem)) {
-                       unlink($private_sem);
-               }
-       }
-
-       $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
-
-       if (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")) {
-               if (!file_exists($member_sem)) {
-                       touch($member_sem);
-               }
-       }
-       if (!isset($_POST['member']) or empty($_POST['member'])) {
-               if (file_exists($member_sem)) {
-                       unlink($member_sem);
-               }
-       }
-      
-       $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
-
-       if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on")) {
-               if (!file_exists($edit_sem)) {
-                       touch($edit_sem);
-               }
-       }
-
-       if (!isset($_POST['edit']) or empty($_POST['edit'])) {
-               if (file_exists($edit_sem)) {
-                       unlink($edit_sem);
-               }
-       }
-
-       if (isset($_POST['lock']) and !empty($_POST['lock']) and ($_POST['lock'] == "on")) {
-
-               if (file_exists("data/items/{$_REQUEST['entry']}/edit.txt")) {
-                       unlink("data/items/{$_REQUEST['entry']}/edit.txt");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
-                       touch("data/items/{$_REQUEST['entry']}/lock.txt");
-               }
-       }
-       if (!isset($_POST['lock']) or empty($_POST['lock'])) {
-               if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
-                       unlink("data/items/{$_REQUEST['entry']}/lock.txt");
-               }
-       }
-      
-       $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
-
-       if (isset($_POST['lastmod']) and !empty($_POST['lastmod']) and ($_POST['lastmod'] == "on")) {
-               if (!file_exists($lastmod_sem)) {
-                       touch($lastmod_sem);
-               }
-       }
-
-       if (!isset($_POST['lastmod']) or empty($_POST['lastmod'])) {
-               if (file_exists($lastmod_sem)) {
-                       unlink($lastmod_sem);
-               }
-       }
-      
-       if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/pdf")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/pdf");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/pdf/file");
-               }
-
-               if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/count")) {
-                       mkdir("data/items/{$_REQUEST['entry']}/pdf/count");
-               }
-      
-               $entry = $_REQUEST['entry'];
-               $author_file = "data/author.txt";
-               $title_file = "data/items/$entry/title.txt";
-               $date_file = "data/items/$entry/date.txt";
-               $body_file = "data/items/$entry/body.txt";
-      
-               $author = file_get_contents($author_file);
-               $title = file_get_contents($title_file);
-               $date = file_get_contents($date_file);
-      
-               $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
-               $link = str_replace("pdf.php?entry=","index.php?entry=",$link);
-               $link = str_replace("edit.php?entry=","index.php?entry=",$link);
-      
-               $body = file_get_contents($body_file);
-               $body = str_replace("\n","<br />",$body);
-      
-               $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-      
-               $filename = strtolower($title);
-               $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
-               $filename = str_replace(" ","-",$filename);
-               $filename = "data/items/$entry/pdf/file/$filename";
-      
-               require('fpdf.php');
-      
-               class PDF extends FPDF
-               {
-                       var $B;
-                       var $I;
-                       var $U;
-                       var $HREF;
-                      
-                       function PDF($orientation='P',$unit='mm',$format='letter')
-                       {
-                           $this->FPDF($orientation,$unit,$format);
-                           $this->B=0;
-                           $this->I=0;
-                           $this->U=0;
-                           $this->HREF='';
-                       }
-              
-                       function WriteHTML($html)
-                       {
-                           $html=str_replace("\n",' ',$html);
-                           $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
-                           foreach($a as $i=>$e)
-                           {
-                               if($i%2==0)
-                               {
-                                   if($this->HREF)
-                                       $this->PutLink($this->HREF,$e);
-                                   else
-                                       $this->Write(5,$e);
-                               }
-                               else
-                               {
-                                   if($e{0}=='/')
-                                       $this->CloseTag(strtoupper(substr($e,1)));
-                                   else
-                                   {
-                                       $a2=explode(' ',$e);
-                                       $tag=strtoupper(array_shift($a2));
-                                       $attr=array();
-                                       foreach($a2 as $v)
-                                           if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3))
-                                               $attr[strtoupper($a3[1])]=$a3[2];
-                                       $this->OpenTag($tag,$attr);
-                                   }
-                               }
-                           }
-                       }
-                      
-                       function OpenTag($tag,$attr)
-                       {
-                           if($tag=='B' or $tag=='I' or $tag=='U')
-                               $this->SetStyle($tag,true);
-                           if($tag=='A')
-                               $this->HREF=$attr['HREF'];
-                           if($tag=='BR')
-                               $this->Ln(5);
-                       }
-                      
-                       function CloseTag($tag)
-                       {
-                           if($tag=='B' or $tag=='I' or $tag=='U')
-                               $this->SetStyle($tag,false);
-                           if($tag=='A')
-                               $this->HREF='';
-                       }
-                      
-                       function SetStyle($tag,$enable)
-                       {
-                           $this->$tag+=($enable ? 1 : -1);
-                           $style='';
-                           foreach(array('B','I','U') as $s)
-                               if($this->$s>0)
-                                   $style.=$s;
-                           $this->SetFont('',$style);
-                       }
-                      
-                       function PutLink($URL,$txt)
-                       {
-                           $this->SetTextColor(0,0,255);
-                           $this->SetStyle('U',true);
-                           $this->Write(5,$txt,$URL);
-                           $this->SetStyle('U',false);
-                           $this->SetTextColor(0);
-                       }
-               }
-      
-               $pdf=new PDF();
-               $pdf->AddPage();
-               $pdf->SetTitle($title);
-               $pdf->SetAuthor($author);
-               $pdf->SetFont('Helvetica','B',14);
-               $pdf->WriteHTML($title);
-               $pdf->SetFont('Helvetica','',10);
-               $pdf->WriteHTML($html);
-               $pdf->Output($filename);
-       }
-      
-       if (!isset($_POST['pdf']) or empty($_POST['pdf'])) {
-               if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
-                       rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
-               }
-       }
-
-       $passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
-
-       if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
-               $fp_passwd_txt = fopen("$passwd_file","w");
-               $passwd_crypt = sha1($_POST['passwd']);
-               $passwd_crypt = md5($passwd_crypt);
-               $passwd_crypt = crypt($passwd_crypt, $passwd_crypt);
-               fwrite($fp_passwd_txt, $passwd_crypt);
-               fclose($fp_passwd_txt);
-       }
-
-       if (!isset($_POST['passwd']) or empty($_POST['passwd'])) {
-               if (file_exists($passwd_file)) {
-                       unlink($passwd_file);
-               }
-       }
-
-       if (isset($_POST['maxlines']) and !empty($_POST['maxlines']) and is_numeric($_POST['maxlines'])) {
-               $fp_maxlines_txt = fopen("data/items/{$_REQUEST['entry']}/maxlines.txt","w");
-               fwrite($fp_maxlines_txt, $_POST['maxlines']);
-               fclose($fp_maxlines_txt);
-       }
-
-       if (!isset($_POST['maxlines']) or empty($_POST['maxlines'])) {
-               if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
-                       unlink("data/items/{$_REQUEST['entry']}/maxlines.txt");
-               }
-       }
-}
-
-if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
-       unlink("data/items/{$_REQUEST['entry']}/title.old");
-}
-
-if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
-       unlink("data/items/{$_REQUEST['entry']}/body.old");
-}
-
-if (file_exists("data/ping.txt")) {
-
-       $ping_urls = explode("|", file_get_contents("data/ping.txt"));
-
-       foreach ($ping_urls as $ping_url) {
-               $ping = file_get_contents($ping_url);
-               unset($ping);
-       }
-}
-
+  if (!isset($_POST['title_input']) or !isset($_POST['body_input']) or empty($_POST['title_input']) or empty($_POST['body_input'])) {
+      exit();
+  }
+  
+  if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
+      unlink("data/items/{$_REQUEST['entry']}/title.old");
+  }
+  
+  if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
+      unlink("data/items/{$_REQUEST['entry']}/body.old");
+  }
+  
+  copy("data/items/{$_REQUEST['entry']}/title.txt", "data/items/{$_REQUEST['entry']}/title.old");
+  copy("data/items/{$_REQUEST['entry']}/body.txt", "data/items/{$_REQUEST['entry']}/body.old");
+  
+  $title_write_content = format_title_put($_POST['title_input']);
+  $body_write_content = format_body_put($_POST['body_input']);
+  
+  $fp_revisions_file = fopen($revisions_file, "r");
+  $revisions_count = fread($fp_revisions_file, filesize($revisions_file));
+  fclose($fp_revisions_file);
+  
+  $revisions_count = $revisions_count + 1;
+  
+  $fp_revisions_file = fopen($revisions_file, "w");
+  fwrite($fp_revisions_file, $revisions_count);
+  fclose($fp_revisions_file);
+  
+  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_file_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")) {
+                  $album_image_input_name = str_replace(" ", "_", $_FILES['album_image_input']['name']);
+                  
+                  if (!file_exists("images/{$_REQUEST['entry']}/album/$album_image_input_name")) {
+                      if (!file_exists("images/{$_REQUEST['entry']}")) {
+                          mkdir("images/{$_REQUEST['entry']}");
+                      }
+                      
+                      if (!file_exists("images/{$_REQUEST['entry']}/album")) {
+                          mkdir("images/{$_REQUEST['entry']}/album");
+                      }
+                      
+                      if (!file_exists("data/albums")) {
+                          mkdir("data/albums");
+                      }
+                      
+                      if (!file_exists("data/albums/{$_REQUEST['entry']}")) {
+                          mkdir("data/albums/{$_REQUEST['entry']}");
+                      }
+                      
+                      if (isset($_POST['caption']) and !empty($_POST['caption'])) {
+                          if (!file_exists("data/items/{$_REQUEST['entry']}/album")) {
+                              mkdir("data/items/{$_REQUEST['entry']}/album");
+                          }
+                          
+                          if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions")) {
+                              mkdir("data/items/{$_REQUEST['entry']}/album/captions");
+                          }
+                          
+                          if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt")) {
+                              $caption_txt = ucfirst($_POST['caption']);
+                              $caption_txt = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_txt);
+                              $caption_txt = str_replace('[code]', '<code>', $caption_txt);
+                              $caption_txt = str_replace('[/code]', '</code>', $caption_txt);
+                              $caption_txt = str_replace("\n", '<br />', $caption_txt);
+                              $caption_txt = str_replace('[b]', '<b>', $caption_txt);
+                              $caption_txt = str_replace('[/b]', '</b>', $caption_txt);
+                              $caption_txt = str_replace('[i]', '<i>', $caption_txt);
+                              $caption_txt = str_replace('[/i]', '</i>', $caption_txt);
+                              $caption_txt = str_replace('[u]', '<u>', $caption_txt);
+                              $caption_txt = str_replace('[/u]', '</u>', $caption_txt);
+                              $caption_txt = str_replace('[strike]', '<strike>', $caption_txt);
+                              $caption_txt = str_replace('[/strike]', '</strike>', $caption_txt);
+                              $caption_txt = str_replace('[sup]', '<sup>', $caption_txt);
+                              $caption_txt = str_replace('[/sup]', '</sup>', $caption_txt);
+                              $caption_txt = str_replace('[sub]', '<sub>', $caption_txt);
+                              $caption_txt = str_replace('[/sub]', '</sub>', $caption_txt);
+                              $caption_txt = str_replace('[highlight]', '<highlight>', $caption_txt);
+                              $caption_txt = str_replace('[/highlight]', '</highlight>', $caption_txt);
+                              $caption_txt = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $caption_txt);
+                              $caption_txt = str_replace('</highlight>', '</span>', $caption_txt);
+                              
+                              $fp_caption_txt = fopen("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt", "w");
+                              fwrite($fp_caption_txt, $caption_txt);
+                              fclose($fp_caption_txt);
+                          }
+                      }
+                      
+                      
+                      $res = copy($_FILES['album_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/album/$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_file_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")) {
+                  $entry_image_input_name = str_replace(" ", "_", $_FILES['entry_image_input']['name']);
+                  
+                  
+                  if (!file_exists("images/{$_REQUEST['entry']}/$entry_image_input_name")) {
+                      if (!file_exists("images/{$_REQUEST['entry']}")) {
+                          mkdir("images/{$_REQUEST['entry']}");
+                      }
+                      
+                      
+                      $res = copy($_FILES['entry_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/$entry_image_input_name");
+                      unlink($_FILES['entry_image_input']['tmp_name']);
+                      
+                      $entry_image_size = getimagesize("images/{$_REQUEST['entry']}/$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=\"images/{$_REQUEST['entry']}/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$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) {
+              if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop")) {
+                  mkdir("data/items/{$_REQUEST['entry']}/filedrop");
+              }
+              
+              if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files")) {
+                  mkdir("data/items/{$_REQUEST['entry']}/filedrop/files");
+              }
+              
+              $file_input_name = str_replace(" ", "_", $_FILES['file_input']['name']);
+              
+              if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name")) {
+                  $res = copy($_FILES['file_input']['tmp_name'], "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+                  unlink($_FILES['file_input']['tmp_name']);
+                  
+                  
+                  $fp_file_txt = fopen("data/items/{$_REQUEST['entry']}/filedrop/{$file_input_name}.txt", "w");
+                  fwrite($fp_file_txt, "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+                  fclose($fp_file_txt);
+              } else {
+                  unlink($_FILES['file_input']['tmp_name']);
+              }
+          } else {
+              unlink($_FILES['file_input']['tmp_name']);
+          }
+      } else {
+          unlink($_FILES['file_input']['tmp_name']);
+      }
+  }
+  
+  if (file_exists("data/wiki.txt")) {
+      $old_title = file_get_contents("data/items/{$_REQUEST['entry']}/title.old");
+      $old_body = file_get_contents("data/items/{$_REQUEST['entry']}/body.old");
+      
+      if (($old_title != $title_write_content) or ($old_body != $body_write_content)) {
+          if (!file_exists("data/items/{$_REQUEST['entry']}/wiki")) {
+              mkdir("data/items/{$_REQUEST['entry']}/wiki");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta")) {
+              mkdir("data/items/{$_REQUEST['entry']}/wiki/delta");
+          }
+          
+          if (file_exists("data/offset.txt")) {
+              $offset = file_get_contents("data/offset.txt");
+          } else {
+              $offset = 0;
+          }
+          
+          $ddate = date("YmdHis", time() + $offset);
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate")) {
+              mkdir("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate");
+          }
+          
+          $new_body = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/body.txt", "w");
+          fwrite($new_body, $body_write_content);
+          fclose($new_body);
+          
+          $new_title = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/title.txt", "w");
+          fwrite($new_title, $title_write_content);
+          fclose($new_title);
+          
+          copy("data/items/{$_REQUEST['entry']}/title.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/ptitle.txt");
+          copy("data/items/{$_REQUEST['entry']}/body.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/prev.txt");
+          copy("data/items/{$_REQUEST['entry']}/date.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/date.txt");
+          
+          if (file_exists("data/items/{$_REQUEST['entry']}/contrib.txt")) {
+              copy("data/items/{$_REQUEST['entry']}/contrib.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/contrib.txt");
+          }
+          
+          $open_editor_file = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/editor.txt", "w");
+          fwrite($open_editor_file, $_SESSION['logged_in']);
+          fclose($open_editor_file);
+      }
+  }
+  
+  $open_title_file = fopen($title_file, "w");
+  fwrite($open_title_file, $title_write_content);
+  fclose($open_title_file);
+  
+  $open_body_file = fopen($body_file, "w");
+  fwrite($open_body_file, $body_write_content);
+  fclose($open_body_file);
+  
+  if (file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
+      $open_contrib_file = fopen("data/items/{$_REQUEST['entry']}/contrib.txt", "w");
+      fwrite($open_contrib_file, $_SESSION['logged_in']);
+      fclose($open_contrib_file);
+  }
+  
+  if ($_SESSION['logged_in'] == $login_username) {
+      $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+      
+      if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
+          if (!file_exists("data/sticky")) {
+              mkdir("data/sticky");
+          }
+          if (!file_exists($sticky_sem)) {
+              touch($sticky_sem);
+          }
+      }
+      if (!isset($_POST['sticky']) or empty($_POST['sticky'])) {
+          if (file_exists($sticky_sem)) {
+              unlink($sticky_sem);
+          }
+      }
+      
+      $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+      
+      if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
+          if (!file_exists($display_sem)) {
+              touch($display_sem);
+          }
+      }
+      if (!isset($_POST['display']) or empty($_POST['display'])) {
+          if (file_exists($display_sem)) {
+              unlink($display_sem);
+          }
+      }
+      
+      $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
+      
+      if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
+          if (!file_exists($private_sem)) {
+              touch($private_sem);
+          }
+      }
+      if (!isset($_POST['private']) or empty($_POST['private'])) {
+          if (file_exists($private_sem)) {
+              unlink($private_sem);
+          }
+      }
+      
+      $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+      
+      if (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")) {
+          if (!file_exists($member_sem)) {
+              touch($member_sem);
+          }
+      }
+      if (!isset($_POST['member']) or empty($_POST['member'])) {
+          if (file_exists($member_sem)) {
+              unlink($member_sem);
+          }
+      }
+      
+      $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+      
+      if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on")) {
+          if (!file_exists($edit_sem)) {
+              touch($edit_sem);
+          }
+      }
+      
+      if (!isset($_POST['edit']) or empty($_POST['edit'])) {
+          if (file_exists($edit_sem)) {
+              unlink($edit_sem);
+          }
+      }
+      
+      if (isset($_POST['lock']) and !empty($_POST['lock']) and ($_POST['lock'] == "on")) {
+          if (file_exists("data/items/{$_REQUEST['entry']}/edit.txt")) {
+              unlink("data/items/{$_REQUEST['entry']}/edit.txt");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+              touch("data/items/{$_REQUEST['entry']}/lock.txt");
+          }
+      }
+      if (!isset($_POST['lock']) or empty($_POST['lock'])) {
+          if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+              unlink("data/items/{$_REQUEST['entry']}/lock.txt");
+          }
+      }
+      
+      $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+      
+      if (isset($_POST['lastmod']) and !empty($_POST['lastmod']) and ($_POST['lastmod'] == "on")) {
+          if (!file_exists($lastmod_sem)) {
+              touch($lastmod_sem);
+          }
+      }
+      
+      if (!isset($_POST['lastmod']) or empty($_POST['lastmod'])) {
+          if (file_exists($lastmod_sem)) {
+              unlink($lastmod_sem);
+          }
+      }
+      
+      if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
+          if (!file_exists("data/items/{$_REQUEST['entry']}/pdf")) {
+              mkdir("data/items/{$_REQUEST['entry']}/pdf");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
+              mkdir("data/items/{$_REQUEST['entry']}/pdf/file");
+          }
+          
+          if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/count")) {
+              mkdir("data/items/{$_REQUEST['entry']}/pdf/count");
+          }
+          
+          $entry = $_REQUEST['entry'];
+          $author_file = "data/author.txt";
+          $title_file = "data/items/$entry/title.txt";
+          $date_file = "data/items/$entry/date.txt";
+          $body_file = "data/items/$entry/body.txt";
+          
+          $author = file_get_contents($author_file);
+          $title = file_get_contents($title_file);
+          $date = file_get_contents($date_file);
+          
+          $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
+          $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
+          $link = str_replace("edit.php?entry=", "index.php?entry=", $link);
+          
+          $body = file_get_contents($body_file);
+          $body = str_replace("\n", "<br />", $body);
+          
+          $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
+          
+          $filename = strtolower($title);
+          $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
+          $filename = str_replace(" ", "-", $filename);
+          $filename = "data/items/$entry/pdf/file/$filename";
+          
+          $pdf = new PDF();
+          $pdf->AddPage();
+          $pdf->SetTitle($title);
+          $pdf->SetAuthor($author);
+          $pdf->SetFont('Helvetica', 'B', 14);
+          $pdf->WriteHTML($title);
+          $pdf->SetFont('Helvetica', '', 10);
+          $pdf->WriteHTML($html);
+          $pdf->Output($filename);
+      }
+      
+      if (!isset($_POST['pdf']) or empty($_POST['pdf'])) {
+          if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
+              rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
+          }
+      }
+      
+      $passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
+      
+      if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
+          $fp_passwd_txt = fopen("$passwd_file", "w");
+          $passwd_crypt = sha1($_POST['passwd']);
+          $passwd_crypt = md5($passwd_crypt);
+          $passwd_crypt = crypt($passwd_crypt, $passwd_crypt);
+          fwrite($fp_passwd_txt, $passwd_crypt);
+          fclose($fp_passwd_txt);
+      }
+      
+      if (!isset($_POST['passwd']) or empty($_POST['passwd'])) {
+          if (file_exists($passwd_file)) {
+              unlink($passwd_file);
+          }
+      }
+      
+      if (isset($_POST['maxlines']) and !empty($_POST['maxlines']) and is_numeric($_POST['maxlines'])) {
+          $fp_maxlines_txt = fopen("data/items/{$_REQUEST['entry']}/maxlines.txt", "w");
+          fwrite($fp_maxlines_txt, $_POST['maxlines']);
+          fclose($fp_maxlines_txt);
+      }
+      
+      if (!isset($_POST['maxlines']) or empty($_POST['maxlines'])) {
+          if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+              unlink("data/items/{$_REQUEST['entry']}/maxlines.txt");
+          }
+      }
+  }
+  
+  if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
+      unlink("data/items/{$_REQUEST['entry']}/title.old");
+  }
+  
+  if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
+      unlink("data/items/{$_REQUEST['entry']}/body.old");
+  }
+  
+  if (file_exists("data/ping.txt")) {
+      $ping_urls = explode("|", file_get_contents("data/ping.txt"));
+      
+      foreach ($ping_urls as $ping_url) {
+          $ping = file_get_contents($ping_url);
+          unset($ping);
+      }
+  }
 ?>
diff --git a/fonts.php b/fonts.php
index b63fcc4..a3fff89 100644
--- a/fonts.php
+++ b/fonts.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
@@ -35,31 +22,6 @@ if (!file_exists("data/fonts")) {
        mkdir("data/fonts");
 }
 
-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($_POST['reset']) and !empty($_POST['reset']) and ($_POST['reset'] == "go")) {
        rmdirr("data/fonts");  
 }
diff --git a/fpdf.php b/fpdf.php
old mode 100755
new mode 100644
diff --git a/index.php b/index.php
index b449098..2dd7618 100644
--- a/index.php
+++ b/index.php
@@ -8,25 +8,12 @@ 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");
 }
 
-if (get_magic_quotes_gpc()) {
-       function stripslashes_array($maj_data) {
-               if (is_array($maj_data)) {
-                       foreach ($maj_data as $maj_key => $maj_value) {
-                               $maj_data[$maj_key] = stripslashes_array($maj_value);
-                       }
-                       return $maj_data;
-               }
-               else {
-                       return stripslashes($maj_data);
-               }
-       }
-       $_REQUEST = stripslashes_array($_REQUEST);
-}
-
 if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
        $maj_req_entry = trim($_REQUEST['entry']);
 }
@@ -89,7 +76,7 @@ $maj_wtable = $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside;
 $maj_default_blog_title = "My Activity Journal";
 $maj_default_username = "maj";
 $maj_default_password = "php";
-$maj_default_blog_profile = 'This cool site is powered by <a href="http://maj.sourceforge.net/" target="_maj">My Activity Journal</a>, a simple, <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://www.opensource.org/licenses/gpl-license.php" target="_maj">Open Source</a> blog written from scratch as a spare time family project by <a href="http://psylocke.org/" target="_maj">Psylocke</a>, <a href="http://gaffud.com/" target="_maj">Magie</a>, and <a href="http://engels.mortega.net/" target="_maj">Engels</a> Antonio.';
+$maj_default_blog_profile = 'This cool site is powered by My Activity Journal (<a href="http://majcms.org/" target="_maj">MAJ</a>), a simple, <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://opensource.org/" target="_maj">Open Source</a> content management system (CMS) that can be deployed as a blog, bulletin board (Internet forum or message board), and wiki.';
 $maj_default_blog_author = "My Activity Journal";
 
 if (!file_exists("data")) {
@@ -185,31 +172,6 @@ function str_rand($maj_length = 8,$maj_seeds = 'abcdefghijklmnopqrstuvwxyz012345
        return $maj_str;
 }
 
-function rmdirr($maj_recurse_dirname) {
-
-       if (!file_exists($maj_recurse_dirname)) {
-               return false;
-       }
-
-       if (is_file($maj_recurse_dirname)) {
-               return unlink($maj_recurse_dirname);
-       }
-
-       $maj_recurse_dir = dir($maj_recurse_dirname);
-
-       while (false !== $maj_recurse_entry = $maj_recurse_dir->read()) {
-
-               if ($maj_recurse_entry == '.' || $maj_recurse_entry == '..') {
-                       continue;
-               }
-
-               rmdirr("$maj_recurse_dirname/$maj_recurse_entry");
-       }
-
-       $maj_recurse_dir->close();
-       return rmdir($maj_recurse_dirname);
-}
-
 if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
        ini_set("zlib.output_compression","off");
        $maj_dl_file = str_replace("../","",@$_REQUEST['download']);
@@ -275,18 +237,6 @@ function go_download($maj_dl_file) {
        }
 }
 
-function entry2date($maj_f_entry) {
-
-       $maj_f_entry_year = substr($maj_f_entry,0,4);
-       $maj_f_entry_month = substr($maj_f_entry,4,2);
-       $maj_f_entry_day = substr($maj_f_entry,6,2);
-       $maj_f_entry_hour = substr($maj_f_entry,8,2);
-       $maj_f_entry_min = substr($maj_f_entry,10,2);
-       $maj_f_entry_sec = substr($maj_f_entry,12,2);
-
-       echo date("l, M j, Y, g:i A",mktime($maj_f_entry_hour,$maj_f_entry_min,$maj_f_entry_sec,$maj_f_entry_month,$maj_f_entry_day,$maj_f_entry_year));
-}
-
 if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
 
                $maj_comment_dir = "data/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
@@ -872,13 +822,7 @@ echo "<tr><td width=\"$maj_wside\" valign=\"top\">";
 
 if (!file_exists("data/xprofile.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
       
-       if (file_exists("data/round.txt")) {
-               echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
-       }
-       else {
-               echo "<div class=\"panel_title\">";
-       }
-      
+       echo "<div class=\"panel_title\">";    
 ?>
 
 Profile</div>
@@ -942,20 +886,11 @@ include("data/profile.php");
 
 <?php
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
       
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
                echo '<div class="panel_title">';
-       }
-
 ?>
 
 Navigation</div>
@@ -1007,9 +942,6 @@ else {
 
 <?php
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (file_exists("data/sticky")) {
@@ -1063,14 +995,7 @@ if (file_exists("data/sticky")) {
       
        if ($maj_count_sticky_list > 0) {
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-              
-               echo 'Quick Links</div>';
+               echo '<div class="panel_title">Quick Links</div>';
                echo '<div class="panel_body">';
 
                foreach ($maj_sticky_entries as $maj_sticky_list_entry) {
@@ -1080,10 +1005,6 @@ if (file_exists("data/sticky")) {
                }
 
                echo '</div>';
-
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
        }
 }
 
@@ -1213,118 +1134,30 @@ if (file_exists("data/panels")) {
                                        }
                                }
 
-                               if (file_exists("data/round.txt")) {
-
-                                       echo '<b class="rbtop"><b class="rb1t"';
-
-                                       if (isset($maj_left_panel_border)) {
-                                               echo " style=\"background-color: $maj_left_panel_border;\"";
-                                       }
-
-                                       echo '></b><b class="rb2t"';
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_left_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_left_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_left_panel_border)) {
-                                               echo "border-color: $maj_left_panel_border;";
-                                       }
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b><b class="rb3t"';
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_left_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_left_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_left_panel_border)) {
-                                               echo "border-color: $maj_left_panel_border;";
-                                       }
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b><b class="rb4t"';
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_left_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_left_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_left_panel_border)) {
-                                               echo "border-color: $maj_left_panel_border;";
-                                       }
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b></b><div class="xtitle"';
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_left_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_left_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_left_panel_text_t)) {
-                                               echo "color: $maj_left_panel_text_t;";
-                                       }
-
-                                       if (isset($maj_left_panel_border)) {
-                                               echo "border-color: $maj_left_panel_border;";
-                                       }
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
-                                               echo '"';
-                                       }
+                               echo '<div class="panel_title"';
 
-                                       echo '>';
+                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
+                                       echo ' style="';
                                }
-                               else {
-                                       echo '<div class="panel_title"';
-
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_left_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_left_panel_bgcolor_t;";
-                                       }
 
-                                       if (isset($maj_left_panel_text_t)) {
-                                               echo "color: $maj_left_panel_text_t;";
-                                       }
+                               if (isset($maj_left_panel_bgcolor_t)) {
+                                       echo "background-color: $maj_left_panel_bgcolor_t;";
+                               }
 
-                                       if (isset($maj_left_panel_border)) {
-                                               echo "border-color: $maj_left_panel_border;";
-                                       }
+                               if (isset($maj_left_panel_text_t)) {
+                                       echo "color: $maj_left_panel_text_t;";
+                               }
 
-                                       if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
-                                               echo '"';
-                                       }
+                               if (isset($maj_left_panel_border)) {
+                                       echo "border-color: $maj_left_panel_border;";
+                               }
 
-                                       echo '>';
+                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
+                                       echo '"';
                                }
 
+                               echo '>';
+
                                readfile("data/panels/$maj_left_panel/title.txt");
 
                                if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
@@ -1374,71 +1207,6 @@ if (file_exists("data/panels")) {
                        if (file_exists("data/panels/$maj_left_panel/free.txt") and !file_exists("data/panels/$maj_left_panel/nomargin.txt")) {
                                echo "<div style=\"height:10px;\"></div>";
                        }
-
-                       if (file_exists("data/round.txt") and !file_exists("data/panels/$maj_left_panel/free.txt")) {
-
-                               echo '<b class="rbbottom"><b class="rb4b"';
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_left_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_left_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_left_panel_border)) {
-                                       echo "border-color: $maj_left_panel_border;";
-                               }
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb3b"';
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_left_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_left_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_left_panel_border)) {
-                                       echo "border-color: $maj_left_panel_border;";
-                               }
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb2b"';
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_left_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_left_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_left_panel_border)) {
-                                       echo "border-color: $maj_left_panel_border;";
-                               }
-
-                               if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb1b"';
-
-                               if (isset($maj_left_panel_border)) {
-                                       echo " style=\"background-color: $maj_left_panel_border;\"";
-                               }
-
-                               echo '></b></b>';
-                       }
                }
        }
 }
@@ -1500,118 +1268,30 @@ if ($maj_count_top_panels > 0) {
                                }
                        }
 
-                       if (file_exists("data/round.txt")) {
-
-                               echo '<b class="rbtop"><b class="rb1t"';
-
-                               if (isset($maj_top_panel_border)) {
-                                       echo " style=\"background-color: $maj_top_panel_border;\"";
-                               }
-
-                               echo '></b><b class="rb2t"';
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_top_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_top_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_top_panel_border)) {
-                                       echo "border-color: $maj_top_panel_border;";
-                               }
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb3t"';
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_top_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_top_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_top_panel_border)) {
-                                       echo "border-color: $maj_top_panel_border;";
-                               }
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb4t"';
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_top_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_top_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_top_panel_border)) {
-                                       echo "border-color: $maj_top_panel_border;";
-                               }
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b></b><div class="xtitle"';
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_top_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_top_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_top_panel_text_t)) {
-                                       echo "color: $maj_top_panel_text_t;";
-                               }
-
-                               if (isset($maj_top_panel_border)) {
-                                       echo "border-color: $maj_top_panel_border;";
-                               }
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
-                                       echo '"';
-                               }
+                       echo '<div class="panel_title"';
 
-                               echo '>';
+                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
+                               echo ' style="';
                        }
-                       else {
-                               echo '<div class="panel_title"';
-
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_top_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_top_panel_bgcolor_t;";
-                               }
 
-                               if (isset($maj_top_panel_text_t)) {
-                                       echo "color: $maj_top_panel_text_t;";
-                               }
+                       if (isset($maj_top_panel_bgcolor_t)) {
+                               echo "background-color: $maj_top_panel_bgcolor_t;";
+                       }
 
-                               if (isset($maj_top_panel_border)) {
-                                       echo "border-color: $maj_top_panel_border;";
-                               }
+                       if (isset($maj_top_panel_text_t)) {
+                               echo "color: $maj_top_panel_text_t;";
+                       }
 
-                               if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
-                                       echo '"';
-                               }
+                       if (isset($maj_top_panel_border)) {
+                               echo "border-color: $maj_top_panel_border;";
+                       }
 
-                               echo '>';
+                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
+                               echo '"';
                        }
 
+                       echo '>';
+
                        readfile("data/panels/$maj_top_panel/title.txt");
 
                        if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
@@ -1661,75 +1341,10 @@ if ($maj_count_top_panels > 0) {
                if (file_exists("data/panels/$maj_top_panel/free.txt") and !file_exists("data/panels/$maj_top_panel/nomargin.txt")) {
                        echo "<div style=\"height:10px;\"></div>";
                }
+       }
+}
 
-               if (file_exists("data/round.txt") and !file_exists("data/panels/$maj_top_panel/free.txt")) {
-
-                       echo '<b class="rbbottom"><b class="rb4b"';
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_top_panel_bgcolor_c)) {
-                               echo "background-color: $maj_top_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_top_panel_border)) {
-                               echo "border-color: $maj_top_panel_border;";
-                       }
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb3b"';
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_top_panel_bgcolor_c)) {
-                               echo "background-color: $maj_top_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_top_panel_border)) {
-                               echo "border-color: $maj_top_panel_border;";
-                       }
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb2b"';
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_top_panel_bgcolor_c)) {
-                               echo "background-color: $maj_top_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_top_panel_border)) {
-                               echo "border-color: $maj_top_panel_border;";
-                       }
-
-                       if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb1b"';
-
-                       if (isset($maj_top_panel_border)) {
-                               echo " style=\"background-color: $maj_top_panel_border;\"";
-                       }
-
-                       echo '></b></b>';
-               }
-       }
-}
-
-// clean-up (start)
+// clean-up (start)
 
 if (file_exists("data/albums")) {
        rmdirr("data/albums");
@@ -2054,14 +1669,9 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
 
        if ($maj_count_latest > 0) {
 
-               if (file_exists("data/round.txt")) {
-                       echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
-               }
-               else {
-                       echo "<div class=\"panel_title\">";
-               }
-
-               echo "Latest Entries</div><div class=\"panel_body\">";
+               echo "<div class=\"panel_title\">Latest Entries</div>";
+              
+               echo "<div class=\"panel_body\">";
                echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\">";
                echo "<tr><td bgcolor=\"#eeeeee\" align=\"center\">topic</td><td bgcolor=\"#eeeeee\" align=\"center\">author</td><td bgcolor=\"#eeeeee\" align=\"center\">views</td><td bgcolor=\"#eeeeee\" align=\"center\">comments</td><td bgcolor=\"#eeeeee\" align=\"center\">last post</td></tr>";
 
@@ -2139,10 +1749,6 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
        if ($maj_count_latest > 0) {
 
                echo "</table></div>";
-
-               if (file_exists("data/round.txt")) {
-                       echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
-               }
        }
 
 }
@@ -2198,118 +1804,30 @@ if ($maj_count_center_panels > 0) {
                                }
                        }
 
-                       if (file_exists("data/round.txt")) {
-
-                               echo '<b class="rbtop"><b class="rb1t"';
-
-                               if (isset($maj_center_panel_border)) {
-                                       echo " style=\"background-color: $maj_center_panel_border;\"";
-                               }
-
-                               echo '></b><b class="rb2t"';
+                       echo '<div class="panel_title"';
 
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_center_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_center_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_center_panel_border)) {
-                                       echo "border-color: $maj_center_panel_border;";
-                               }
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb3t"';
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_center_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_center_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_center_panel_border)) {
-                                       echo "border-color: $maj_center_panel_border;";
-                               }
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb4t"';
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_center_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_center_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_center_panel_border)) {
-                                       echo "border-color: $maj_center_panel_border;";
-                               }
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b></b><div class="xtitle"';
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_center_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_center_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_center_panel_text_t)) {
-                                       echo "color: $maj_center_panel_text_t;";
-                               }
-
-                               if (isset($maj_center_panel_border)) {
-                                       echo "border-color: $maj_center_panel_border;";
-                               }
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
-                                       echo '"';
-                               }
-
-                               echo '>';
+                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
+                               echo ' style="';
                        }
-                       else {
-                               echo '<div class="panel_title"';
-
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_center_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_center_panel_bgcolor_t;";
-                               }
 
-                               if (isset($maj_center_panel_text_t)) {
-                                       echo "color: $maj_center_panel_text_t;";
-                               }
+                       if (isset($maj_center_panel_bgcolor_t)) {
+                               echo "background-color: $maj_center_panel_bgcolor_t;";
+                       }
 
-                               if (isset($maj_center_panel_border)) {
-                                       echo "border-color: $maj_center_panel_border;";
-                               }
+                       if (isset($maj_center_panel_text_t)) {
+                               echo "color: $maj_center_panel_text_t;";
+                       }
 
-                               if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
-                                       echo '"';
-                               }
+                       if (isset($maj_center_panel_border)) {
+                               echo "border-color: $maj_center_panel_border;";
+                       }
 
-                               echo '>';
+                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
+                               echo '"';
                        }
 
+                       echo '>';
+
                        readfile("data/panels/$maj_center_panel/title.txt");
 
                        if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
@@ -2359,71 +1877,6 @@ if ($maj_count_center_panels > 0) {
                if (file_exists("data/panels/$maj_center_panel/free.txt") and !file_exists("data/panels/$maj_center_panel/nomargin.txt")) {
                        echo "<div style=\"height:10px;\"></div>";
                }
-
-               if (file_exists("data/round.txt") and !file_exists("data/panels/$maj_center_panel/free.txt")) {
-
-                       echo '<b class="rbbottom"><b class="rb4b"';
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_center_panel_bgcolor_c)) {
-                               echo "background-color: $maj_center_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_center_panel_border)) {
-                               echo "border-color: $maj_center_panel_border;";
-                       }
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb3b"';
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_center_panel_bgcolor_c)) {
-                               echo "background-color: $maj_center_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_center_panel_border)) {
-                               echo "border-color: $maj_center_panel_border;";
-                       }
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb2b"';
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_center_panel_bgcolor_c)) {
-                               echo "background-color: $maj_center_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_center_panel_border)) {
-                               echo "border-color: $maj_center_panel_border;";
-                       }
-
-                       if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb1b"';
-
-                       if (isset($maj_center_panel_border)) {
-                               echo " style=\"background-color: $maj_center_panel_border;\"";
-                       }
-
-                       echo '></b></b>';
-               }
        }
 }
 
@@ -2439,14 +1892,9 @@ if ($maj_count_items == 0) {
 
        echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"$maj_wmain\">";
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
-
-       echo "Oops!</div><div class=panel_body><table border=0 cellspacing=0 cellpadding=4><tr>";
+       echo '<div class="panel_title">Oops!</div>';
+      
+       echo "<div class=panel_body><table border=0 cellspacing=0 cellpadding=4><tr>";
        echo "<td valign=middle><img src=images/oops.png width=36 height=36 border=0></td><td valign=middle>";
 
        if (($maj_count_grand == 0) and (count($_GET) == 0)) {
@@ -2463,10 +1911,6 @@ if ($maj_count_items == 0) {
 
        echo '</td></tr></table></div>';
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
-
        echo "</td></tr></table>";
 }
 
@@ -2565,117 +2009,30 @@ foreach ($maj_disp as $maj_d) {
                }
        }
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"';
-
-               if (isset($maj_d_border)) {
-                       echo " style=\"background-color: $maj_d_border;\"";
-               }
-
-               echo '></b><b class="rb2t"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_t)) {
-                       echo "background-color: $maj_d_bgcolor_t;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo '"';
-               }
-
-               echo '></b><b class="rb3t"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo ' style="';
-               }
+       echo '<div class="panel_title"';
 
-               if (isset($maj_d_bgcolor_t)) {
-                       echo "background-color: $maj_d_bgcolor_t;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo '"';
-               }
-
-               echo '></b><b class="rb4t"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_t)) {
-                       echo "background-color: $maj_d_bgcolor_t;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t)) {
-                       echo '"';
-               }
-
-               echo '></b></b><div class="xtitle"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_t)) {
-                       echo "background-color: $maj_d_bgcolor_t;";
-               }
-
-               if (isset($maj_d_text_t)) {
-                       echo "color: $maj_d_text_t;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
-                       echo '"';
-               }
-
-               echo '>';
+       if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
+               echo ' style="';
        }
-       else {
-               echo '<div class="panel_title"';
 
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_t)) {
-                       echo "background-color: $maj_d_bgcolor_t;";
-               }
-
-               if (isset($maj_d_text_t)) {
-                       echo "color: $maj_d_text_t;";
-               }
+       if (isset($maj_d_bgcolor_t)) {
+               echo "background-color: $maj_d_bgcolor_t;";
+       }
 
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
+       if (isset($maj_d_text_t)) {
+               echo "color: $maj_d_text_t;";
+       }
 
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
-                       echo '"';
-               }
+       if (isset($maj_d_border)) {
+               echo "border-color: $maj_d_border;";
+       }
 
-               echo '>';
+       if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
+               echo '"';
        }
 
+       echo '>';
+
        readfile("data/items/$maj_d/title.txt");
 
        if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $maj_login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
@@ -3201,10 +2558,6 @@ foreach ($maj_disp as $maj_d) {
 
        echo "</td></tr></table>";
 
-       if (file_exists("data/round.txt")) {
-               echo "<div class=\"rbspace\"></div>";
-       }
-
        echo "</div>";
 
        if (file_exists("data/items/$maj_d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
@@ -3505,71 +2858,6 @@ foreach ($maj_disp as $maj_d) {
 
        echo "</div>";
 
-       if (file_exists("data/round.txt")) {
-
-               echo '<b class="rbbottom"><b class="rb4e"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_f)) {
-                       echo "background-color: $maj_d_bgcolor_f;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo '"';
-               }
-
-               echo '></b><b class="rb3e"';
-      
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_f)) {
-                       echo "background-color: $maj_d_bgcolor_f;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo '"';
-               }
-
-               echo '></b><b class="rb2e"';
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo ' style="';
-               }
-
-               if (isset($maj_d_bgcolor_f)) {
-                       echo "background-color: $maj_d_bgcolor_f;";
-               }
-
-               if (isset($maj_d_border)) {
-                       echo "border-color: $maj_d_border;";
-               }
-
-               if (isset($maj_d_border) or isset($maj_d_bgcolor_f)) {
-                       echo '"';
-               }
-
-               echo '></b><b class="rb1e"';
-
-               if (isset($maj_d_border)) {
-                       echo " style=\"background-color: $maj_d_border;\"";
-               }
-
-               echo '></b></b>';
-       }
-
        echo "</td></tr></table>";
 
        if ($maj_count_entry_panels > 0) {
@@ -3623,118 +2911,30 @@ foreach ($maj_disp as $maj_d) {
                                        }
                                }
 
-                               if (file_exists("data/round.txt")) {
-
-                                       echo '<b class="rbtop"><b class="rb1t"';
-
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo " style=\"background-color: $maj_entry_panel_border;\"";
-                                       }
-
-                                       echo '></b><b class="rb2t"';
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_entry_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_entry_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo "border-color: $maj_entry_panel_border;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b><b class="rb3t"';
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_entry_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_entry_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo "border-color: $maj_entry_panel_border;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b><b class="rb4t"';
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_entry_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_entry_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo "border-color: $maj_entry_panel_border;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t)) {
-                                               echo '"';
-                                       }
-
-                                       echo '></b></b><div class="xtitle"';
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_entry_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_entry_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_text_t)) {
-                                               echo "color: $maj_entry_panel_text_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo "border-color: $maj_entry_panel_border;";
-                                       }
-
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
-                                               echo '"';
-                                       }
+                               echo '<div class="panel_title"';
 
-                                       echo '>';
+                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
+                                       echo ' style="';
                                }
-                               else {
-                                       echo '<div class="panel_title"';
 
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
-                                               echo ' style="';
-                                       }
-
-                                       if (isset($maj_entry_panel_bgcolor_t)) {
-                                               echo "background-color: $maj_entry_panel_bgcolor_t;";
-                                       }
-
-                                       if (isset($maj_entry_panel_text_t)) {
-                                               echo "color: $maj_entry_panel_text_t;";
-                                       }
+                               if (isset($maj_entry_panel_bgcolor_t)) {
+                                       echo "background-color: $maj_entry_panel_bgcolor_t;";
+                               }
 
-                                       if (isset($maj_entry_panel_border)) {
-                                               echo "border-color: $maj_entry_panel_border;";
-                                       }
+                               if (isset($maj_entry_panel_text_t)) {
+                                       echo "color: $maj_entry_panel_text_t;";
+                               }
 
-                                       if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
-                                               echo '"';
-                                       }
+                               if (isset($maj_entry_panel_border)) {
+                                       echo "border-color: $maj_entry_panel_border;";
+                               }
 
-                                       echo '>';
+                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
+                                       echo '"';
                                }
 
+                               echo '>';
+
                                readfile("data/panels/$maj_entry_panel/title.txt");
 
                                if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
@@ -3784,71 +2984,6 @@ foreach ($maj_disp as $maj_d) {
                        if (file_exists("data/panels/$maj_entry_panel/free.txt") and !file_exists("data/panels/$maj_entry_panel/nomargin.txt")) {
                                echo "<div style=\"height:10px;\"></div>";
                        }
-
-                       if (file_exists("data/round.txt") and !file_exists("data/panels/$maj_entry_panel/free.txt")) {
-
-                               echo '<b class="rbbottom"><b class="rb4b"';
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_entry_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_entry_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_entry_panel_border)) {
-                                       echo "border-color: $maj_entry_panel_border;";
-                               }
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb3b"';
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_entry_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_entry_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_entry_panel_border)) {
-                                       echo "border-color: $maj_entry_panel_border;";
-                               }
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb2b"';
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_entry_panel_bgcolor_c)) {
-                                       echo "background-color: $maj_entry_panel_bgcolor_c;";
-                               }
-
-                               if (isset($maj_entry_panel_border)) {
-                                       echo "border-color: $maj_entry_panel_border;";
-                               }
-
-                               if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb1b"';
-
-                               if (isset($maj_entry_panel_border)) {
-                                       echo " style=\"background-color: $maj_entry_panel_border;\"";
-                               }
-
-                               echo '></b></b>';
-                       }
                }
        }
 
@@ -3856,14 +2991,8 @@ foreach ($maj_disp as $maj_d) {
 
                echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-
-               echo 'Album';
+               echo '<div class="panel_title">Album';
+              
                if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
                        echo '<a href=del.php?entry=';
                        echo $maj_d;
@@ -4002,26 +3131,15 @@ foreach ($maj_disp as $maj_d) {
                }
                echo '</div>';
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
-
                echo '</td></tr></table>';
 
        }
 
        if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == filedrop) and file_exists("data/items/$maj_d/filedrop/files")) {
 
-               echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
-
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo "<div class=panel_title>";
-               }
-
-               echo "Filedrop";
+               echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
+
+               echo "<div class=panel_title>Filedrop";
 
                if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
                        echo "<a href=del.php?entry=$maj_d&target=filedrop><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=\"delete filedrop\"></a>";
@@ -4102,10 +3220,6 @@ foreach ($maj_disp as $maj_d) {
                }
                echo "</div>";
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
-
                echo '</td></tr></table>';
        }
 
@@ -4113,14 +3227,8 @@ foreach ($maj_disp as $maj_d) {
 
                echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-
-               echo 'PDF';
+               echo '<div class="panel_title">PDF';
+              
                if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
                        echo '<a href=del.php?entry=';
                        echo $maj_d;
@@ -4167,10 +3275,6 @@ foreach ($maj_disp as $maj_d) {
                }
                echo '</div>';
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
-
                echo '</td></tr></table>';
        }
 
@@ -4196,12 +3300,7 @@ foreach ($maj_disp as $maj_d) {
 
                                echo "<a name=\"$maj_comment\"></a>";
 
-                               if (file_exists("data/round.txt")) {
-                                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-                               }
-                               else {
-                                       echo '<div class="panel_title">';
-                               }
+                               echo '<div class="panel_title">';
       
                                if (file_exists("data/items/$maj_d/comments/live/$maj_comment/url.txt")) {
                                        echo '<a target=_maj href=';
@@ -4590,10 +3689,6 @@ foreach ($maj_disp as $maj_d) {
                                }
                                echo $maj_entry_comment;
                                echo '</tr></table></div>';
-
-                               if (file_exists("data/round.txt")) {
-                                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-                               }
                        }
                        unset($maj_show_comments);
                        echo '</td></tr></table>';
@@ -4806,12 +3901,7 @@ foreach ($maj_disp as $maj_d) {
 
                                echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
       
-                               if (file_exists("data/round.txt")) {
-                                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-                               }
-                               else {
-                                       echo '<div class="panel_title">';
-                               }
+                               echo '<div class="panel_title">';
       
                                if (file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/url.txt")) {
                                        echo '<a target=_maj href=';
@@ -5070,10 +4160,6 @@ foreach ($maj_disp as $maj_d) {
                                readfile("data/items/$maj_d/comments/pending/$maj_pending_comment/comment.txt");
                                echo '</tr></table></div>';
       
-                               if (file_exists("data/round.txt")) {
-                                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-                               }
-      
                                unset($maj_show_pending_comments);
                                echo '</td></tr></table>';
                        }
@@ -5198,14 +4284,8 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
 
        if (($maj_count_latest > 0) and ($maj_count_pending_comment_flags > 0)) {
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-
-               echo 'Pending Comments</div>';
+               echo '<div class="panel_title">Pending Comments</div>';
+              
                echo '<div class="panel_body">';
 
                if ($maj_dh_list_pending_comment_flags = opendir("data/comments/pending")) {
@@ -5236,10 +4316,6 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
                        closedir($maj_dh_list_pending_comment_flags);
                }
                echo '</div>';
-
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
        }
 }
 
@@ -5297,12 +4373,7 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
 
        if (count($maj_unread_comments) > 0) {
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
+               echo '<div class="panel_title">';
 
                echo 'Unread Comments</div><div class=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
 
@@ -5314,10 +4385,6 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
                }
 
                echo '</table></div>';
-
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
        }
 }
 
@@ -5338,14 +4405,8 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
       
        if ($maj_count_pending_list > 0) {
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-
-               echo "Pending Member";
+               echo '<div class="panel_title">Pending Member';
+              
                if ($maj_count_pending_list > 1) {
                        echo "s";
                }
@@ -5355,19 +4416,9 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
                }
                echo " below.</div>";
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
-
                foreach ($maj_show_pending_list as $maj_pending_list_entry) {
 
-                       if (file_exists("data/round.txt")) {
-                               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-                       }
-                       else {
-                               echo '<div class="panel_title">';
-                       }
-
+                       echo '<div class="panel_title">';
                        echo "$maj_pending_list_entry";
                        echo '<a href=reg.php?username=';
                        echo $maj_pending_list_entry;
@@ -5405,24 +4456,16 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
                                echo "<br>$maj_email_confirmed";
                        }
                        echo "</div>";
-
-                       if (file_exists("data/round.txt")) {
-                               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-                       }
                }
        }
 }
 
 if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
+       echo '<div class="panel_title">Bulletin Board</div>';
+      
+       echo "<div class=panel_body>";
 
-       echo "Bulletin Board</div><div class=panel_body>";
        if (file_exists("data/members/active") and file_exists("data/bb.txt")) {
                if ($maj_dh_active_list = opendir("data/members/active")) {
                        while (($maj_entry_active_list = readdir($maj_dh_active_list)) !== false) {
@@ -5494,20 +4537,11 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
                echo "<br>Latest Login: <a href=member.php?id=$maj_bb_last>$maj_bb_last</a>";
        }
        echo "</div>";
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
       
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
+       echo '<div class="panel_title">';
 
        ?>
 
@@ -5519,23 +4553,14 @@ if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['
        </div>
 
        <?php
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 
 if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
-
-       echo "Find Entries</div><div class=panel_body>";
+       echo '<div class="panel_title">Find Entries</div>';
+      
+       echo "<div class=panel_body>";
        echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
        if (file_exists("data/bb.txt")) {
                echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
@@ -5546,10 +4571,6 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
        echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
        echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
        echo "</div>";
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (file_exists("data/categories")) {
@@ -5577,14 +4598,9 @@ if (file_exists("data/categories")) {
 
        if ($maj_count_categories > 0) {
 
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-
-               echo 'Categories</div><div class=panel_body>';
+               echo '<div class="panel_title">Categories</div>';
+              
+               echo '<div class=panel_body>';
 
                foreach ($maj_show_categories as $maj_category) {
 
@@ -5602,23 +4618,14 @@ if (file_exists("data/categories")) {
                }
 
                echo '</div>';
-
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
        }
 }
 
 if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
-
-       echo 'Statistics</div><div class=panel_body>';
+       echo '<div class="panel_title">Statistics</div>';
+      
+       echo '<div class=panel_body>';
        echo "Total Entries: $maj_count_latest";
        if (file_exists("data/hits.txt")) {
                echo '<br>Site Hits: ';
@@ -5646,22 +4653,13 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
        }
 
        echo '</div>';
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("data/xrecent.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
 
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-       }
-       else {
-               echo '<div class="panel_title">';
-       }
-
-       echo 'Recent Entries</div><div class=panel_body>';
+       echo '<div class="panel_title">Recent Entries</div>';
+      
+       echo '<div class=panel_body>';
 
        $maj_increment_recent_entries = "0";
 
@@ -5682,22 +4680,13 @@ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_e
        }
 
        echo '</div>';
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if ($maj_count_albums > 0) {
 
-       if (file_exists("data/round.txt")) {
-               echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
-       }
-       else {
-               echo "<div class=\"panel_title\">";
-       }
-
-       echo "Albums</div><div class=\"panel_body\">";
+       echo "<div class=\"panel_title\">Albums</div>";
+      
+       echo "<div class=\"panel_body\">";
 
        foreach ($maj_albums as $maj_album) {
                echo "<a class=\"navlink\" href=\"index.php?entry=$maj_album&show=album\">";
@@ -5705,10 +4694,6 @@ if ($maj_count_albums > 0) {
                echo "</a><br>";
        }
        echo '</div>';
-
-       if (file_exists("data/round.txt")) {
-               echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-       }
 }
 
 if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
@@ -5725,14 +4710,9 @@ if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_conten
       
        if ($maj_count_random > $maj_limit_random) {
       
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
-               }
-               else {
-                       echo '<div class="panel_title">';
-               }
-      
-               echo "Random Entries</div><div class=\"panel_body\">";
+               echo '<div class="panel_title">Random Entries</div>';
+              
+               echo "<div class=\"panel_body\">";
       
                $maj_increment_random = 0;
       
@@ -5753,11 +4733,7 @@ if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_conten
        }
       
        if ($maj_count_random > $maj_limit_random) {
-               echo "</div>";
-      
-               if (file_exists("data/round.txt")) {
-                       echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
-               }
+               echo "</div>"; 
        }
 }
 ?>
@@ -5771,14 +4747,7 @@ if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_
 
        $maj_unique_archive_list = array_unique($maj_archives);
 
-       if (file_exists("data/round.txt")) {
-               echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
-       }
-       else {
-               echo "<div class=\"panel_title\">";
-       }
-
-       echo "Archives ($maj_count_archives)</div>";
+       echo "<div class=\"panel_title\">Archives ($maj_count_archives)</div>";
        echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
 
        foreach ($maj_unique_archive_list as $maj_archive_list_entry) {
@@ -5792,10 +4761,6 @@ if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_
                echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$maj_archive_list_value\"><nobr>$maj_archive_list_month $maj_archive_list_year</nobr></a></td><td align=right>$maj_archive_list_num</td></tr>";
        }
        echo "</table></div>";
-
-       if (file_exists("data/round.txt")) {
-               echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
-       }
 }
 
 if ($maj_count_right_panels > 0) {
@@ -5849,117 +4814,29 @@ if ($maj_count_right_panels > 0) {
                                }
                        }
 
-                       if (file_exists("data/round.txt")) {
-
-                               echo '<b class="rbtop"><b class="rb1t"';
-
-                               if (isset($maj_right_panel_border)) {
-                                       echo " style=\"background-color: $maj_right_panel_border;\"";
-                               }
-
-                               echo '></b><b class="rb2t"';
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_right_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_right_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_right_panel_border)) {
-                                       echo "border-color: $maj_right_panel_border;";
-                               }
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb3t"';
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_right_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_right_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_right_panel_border)) {
-                                       echo "border-color: $maj_right_panel_border;";
-                               }
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b><b class="rb4t"';
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_right_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_right_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_right_panel_border)) {
-                                       echo "border-color: $maj_right_panel_border;";
-                               }
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t)) {
-                                       echo '"';
-                               }
-
-                               echo '></b></b><div class="xtitle"';
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
-                                       echo ' style="';
-                               }
-
-                               if (isset($maj_right_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_right_panel_bgcolor_t;";
-                               }
-
-                               if (isset($maj_right_panel_text_t)) {
-                                       echo "color: $maj_right_panel_text_t;";
-                               }
-
-                               if (isset($maj_right_panel_border)) {
-                                       echo "border-color: $maj_right_panel_border;";
-                               }
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
-                                       echo '"';
-                               }
+                       echo '<div class="panel_title"';
 
-                               echo '>';
+                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
+                               echo ' style="';
                        }
-                       else {
-                               echo '<div class="panel_title"';
-
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
-                                       echo ' style="';
-                               }
 
-                               if (isset($maj_right_panel_bgcolor_t)) {
-                                       echo "background-color: $maj_right_panel_bgcolor_t;";
-                               }
+                       if (isset($maj_right_panel_bgcolor_t)) {
+                               echo "background-color: $maj_right_panel_bgcolor_t;";
+                       }
 
-                               if (isset($maj_right_panel_text_t)) {
-                                       echo "color: $maj_right_panel_text_t;";
-                               }
+                       if (isset($maj_right_panel_text_t)) {
+                               echo "color: $maj_right_panel_text_t;";
+                       }
 
-                               if (isset($maj_right_panel_border)) {
-                                       echo "border-color: $maj_right_panel_border;";
-                               }
+                       if (isset($maj_right_panel_border)) {
+                               echo "border-color: $maj_right_panel_border;";
+                       }
 
-                               if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
-                                       echo '"';
-                               }
+                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
+                               echo '"';
+                       }
 
                                echo '>';
-                       }
 
                        readfile("data/panels/$maj_right_panel/title.txt");
 
@@ -6010,71 +4887,6 @@ if ($maj_count_right_panels > 0) {
                if (file_exists("data/panels/$maj_right_panel/free.txt") and !file_exists("data/panels/$maj_right_panel/nomargin.txt")) {
                        echo "<div style=\"height:10px;\"></div>";
                }
-
-               if (file_exists("data/round.txt") and !file_exists("data/panels/$maj_right_panel/free.txt")) {
-
-                       echo '<b class="rbbottom"><b class="rb4b"';
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_right_panel_bgcolor_c)) {
-                               echo "background-color: $maj_right_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_right_panel_border)) {
-                               echo "border-color: $maj_right_panel_border;";
-                       }
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb3b"';
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_right_panel_bgcolor_c)) {
-                               echo "background-color: $maj_right_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_right_panel_border)) {
-                               echo "border-color: $maj_right_panel_border;";
-                       }
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb2b"';
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo ' style="';
-                       }
-
-                       if (isset($maj_right_panel_bgcolor_c)) {
-                               echo "background-color: $maj_right_panel_bgcolor_c;";
-                       }
-
-                       if (isset($maj_right_panel_border)) {
-                               echo "border-color: $maj_right_panel_border;";
-                       }
-
-                       if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c)) {
-                               echo '"';
-                       }
-
-                       echo '></b><b class="rb1b"';
-
-                       if (isset($maj_right_panel_border)) {
-                               echo " style=\"background-color: $maj_right_panel_border;\"";
-                       }
-
-                       echo '></b></b>';
-               }
        }
 }
 
diff --git a/login.php b/login.php
index 631c1a1..7ce6d57 100644
--- a/login.php
+++ b/login.php
@@ -4,24 +4,8 @@
        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);
-                       }
-               }
-               $_POST = stripslashes_array($_POST);
-       }
+      
+       require("core.php");
 
        if (isset($_POST['go']) and ($_POST['go'] == "index")) {
                header("Location: .");
diff --git a/member.php b/member.php
index da86883..07f61ea 100644
--- a/member.php
+++ b/member.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 if (file_exists("data/lite.txt")) {
        exit();
 }
@@ -237,30 +224,8 @@ if ($id == "all") {
                }
       
                if (isset($_POST['del']) and !empty($_POST['del']) and ($_POST['del'] == "on")) {
-
-                       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);
-               }
-               rmdirr("data/members/active/{$_POST['username']}");
+                       rmdirr("data/members/active/{$_POST['username']}");
        }
 }
 
diff --git a/move.php b/move.php
index e912d9b..8f95d9b 100644
--- a/move.php
+++ b/move.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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)) {
@@ -38,31 +25,6 @@ else {
        $entry = trim($_REQUEST['entry']);
 }
 
-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 ($dh_items = opendir("data/items")) {
 
        while (($entry_item = readdir($dh_items)) !== false) {
diff --git a/options.php b/options.php
index 301d943..1bea1c5 100644
--- a/options.php
+++ b/options.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-}
-
 if (file_exists("data/lite.txt")) {
        exit();
 }
diff --git a/panels.php b/panels.php
index 981e6d6..4b1c546 100644
--- a/panels.php
+++ b/panels.php
@@ -6,55 +6,18 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
        exit();
 }
 
-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($_POST['new_id']) and !empty($_POST['new_id']) and isset($_POST['new_title']) and !empty($_POST['new_title']) and isset($_POST['new_content']) and !empty($_POST['new_content']) and !file_exists("data/panels/{$_POST['new_id']}")) {
 
        if (!file_exists("data/panels")) {
diff --git a/passwd.php b/passwd.php
index dbc4621..b2dabd6 100644
--- a/passwd.php
+++ b/passwd.php
@@ -56,21 +56,7 @@ a:active {
 
 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);
-}
+require("core.php");
 
 if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
 
diff --git a/rel.txt b/rel.txt
index 46a6895..d14d83c 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-201007240339
+201008010223
diff --git a/reset.php b/reset.php
index 37ac2b0..87851ca 100644
--- a/reset.php
+++ b/reset.php
@@ -14,20 +14,7 @@ if (!file_exists("data/reset.txt")) {
 
 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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
+require("core.php");
 
 if (file_exists("data/offset.txt")) {
        $offset = file_get_contents("data/offset.txt");
diff --git a/rss.php b/rss.php
index a8ec743..ff445c6 100644
--- a/rss.php
+++ b/rss.php
@@ -4,23 +4,7 @@
 
 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);
-}
+require("core.php");
 
 if (file_exists("data/offset.txt")) {
        $offset = file_get_contents("data/offset.txt");
diff --git a/settings.php b/settings.php
index e4d02e7..7045359 100644
--- a/settings.php
+++ b/settings.php
@@ -6,25 +6,12 @@ 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");
 }
 
-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);
-               }
-       }
-       $_POST = stripslashes_array($_POST);
-}
-
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
@@ -291,8 +278,26 @@ if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
        }
 }
 
-if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on") and !file_exists("data/round.txt")) {
-       touch("data/round.txt");
+if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on")) {
+
+       if (!file_exists("data/round.txt")) {
+               $fp_radius_txt = fopen("data/round.txt","w");
+               fwrite($fp_radius_txt,"5");
+               fclose($fp_radius_txt);
+       }
+      
+       if (isset($_POST['radius']) and is_numeric($_POST['radius']) and (file_get_contents("data/round.txt") != $_POST['radius'])) {
+      
+               if ($_POST['radius'] > 0) {
+                       $radius_write_content = number_format($_POST['radius'],0,'.','');
+                       $fp_radius_txt = fopen("data/round.txt","w");
+                       fwrite($fp_radius_txt,$radius_write_content);
+                       fclose($fp_radius_txt);
+               }
+               else {
+                       unlink("data/round.txt");
+               }
+       }
 }
 
 if (!isset($_POST['round']) or empty($_POST['round'])) {
@@ -1201,7 +1206,6 @@ a:active {
 <tr><td><input type="checkbox" name="xarc" <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</td></tr>
 <tr><td><input type="checkbox" name="xcat" <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</td></tr>
 <tr><td><input type="checkbox" name="nocat" <?php if (file_exists("data/nocat.txt")) { echo checked; } ?>> Do not show categorized items with unfiled entries.</td></tr>
-<tr><td><input type="checkbox" name="round" <?php if (file_exists("data/round.txt")) { echo checked; } ?>> Use round corners.</td></tr>
 <tr><td><input type="checkbox" name="center" <?php if (file_exists("data/center.txt")) { echo checked; } ?>> Display <?php
 
 if (file_exists("data/bb.txt")) {
@@ -1213,6 +1217,15 @@ else {
 
 ?> on center of page.</td></tr>
 <tr><td><input type="checkbox" name="old" <?php if (file_exists("data/old.txt")) { echo checked; } ?>> Display entries from oldest to newest.</td></tr>
+
+<tr><td><input type="checkbox" name="round" <?php if (file_exists("data/round.txt")) { echo checked; } ?>> Display rounded corners on progressive browsers.</td></tr>
+
+<?php if (file_exists("data/round.txt")) { ?>
+
+<tr><td>panel border radius</td><td><input autocomplete="off" class="input" type="text" name="radius" value="<?php readfile('data/round.txt'); ?>" maxlength="2"></td></tr>
+
+<?php } ?>
+
 <?php
 if (file_exists("favicon.ico")) {
        echo '<tr><td></td><td><input type="checkbox" name="del_favicon"> Delete existing favicon.ico.</td></tr>';
diff --git a/wiki.php b/wiki.php
index 7307039..6eb0369 100644
--- a/wiki.php
+++ b/wiki.php
@@ -2,29 +2,11 @@
        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");
        }
-       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($_REQUEST['entry']))
        {
@@ -54,38 +36,6 @@
        {
                exit();
        }
-       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);
-       }
-       function entry2date($f_entry)
-       {
-               $f_entry_year = substr($f_entry, 0, 4);
-               $f_entry_month = substr($f_entry, 4, 2);
-               $f_entry_day = substr($f_entry, 6, 2);
-               $f_entry_hour = substr($f_entry, 8, 2);
-               $f_entry_min = substr($f_entry, 10, 2);
-               $f_entry_sec = substr($f_entry, 12, 2);
-               echo date("l, M j, Y, g:i A", mktime($f_entry_hour, $f_entry_min, $f_entry_sec, $f_entry_month, $f_entry_day, $f_entry_year));
-       }
 ?>
 
 <title>Wiki</title>
 
filedropmaj.git-01822e4.tar.bz2
147.95 KB
72 downloads
filedropmaj.git-01822e4.zip
201.96 KB
25 downloads
filedropmaj.git-0291349.tar.bz2
152.85 KB
70 downloads
filedropmaj.git-0291349.zip
211.90 KB
25 downloads
filedropmaj.git-02cb3b7.tar.bz2
151.48 KB
73 downloads
filedropmaj.git-02cb3b7.zip
209.82 KB
25 downloads
filedropmaj.git-0811dd5.tar.bz2
152.90 KB
69 downloads
filedropmaj.git-0811dd5.zip
211.90 KB
23 downloads
filedropmaj.git-083625f.tar.bz2
132.92 KB
68 downloads
filedropmaj.git-083625f.zip
179.59 KB
25 downloads
filedropmaj.git-0885d7b.tar.bz2
92.63 KB
69 downloads
filedropmaj.git-0885d7b.zip
132.34 KB
22 downloads
filedropmaj.git-09c6f33.tar.bz2
151.51 KB
68 downloads
filedropmaj.git-09c6f33.zip
202.12 KB
23 downloads
filedropmaj.git-0b26a85.tar.bz2
151.44 KB
66 downloads
filedropmaj.git-0b26a85.zip
209.75 KB
21 downloads
filedropmaj.git-0b32424.tar.bz2
151.66 KB
67 downloads
filedropmaj.git-0b32424.zip
206.72 KB
22 downloads
filedropmaj.git-0f3ac59.tar.bz2
152.14 KB
66 downloads
filedropmaj.git-0f3ac59.zip
211.45 KB
18 downloads
filedropmaj.git-11d4582.tar.bz2
143.02 KB
64 downloads
filedropmaj.git-11d4582.zip
195.12 KB
17 downloads
filedropmaj.git-17f105a.tar.bz2
137.96 KB
62 downloads
filedropmaj.git-17f105a.zip
193.02 KB
18 downloads
filedropmaj.git-183270b.tar.bz2
137.54 KB
66 downloads
filedropmaj.git-183270b.zip
187.93 KB
18 downloads
filedropmaj.git-197a49d.tar.bz2
152.03 KB
64 downloads
filedropmaj.git-197a49d.zip
211.32 KB
21 downloads
filedropmaj.git-1b9af25.tar.bz2
152.87 KB
62 downloads
filedropmaj.git-1b9af25.zip
211.96 KB
19 downloads
filedropmaj.git-1be2914.tar.bz2
149.30 KB
64 downloads
filedropmaj.git-1be2914.zip
203.09 KB
18 downloads
filedropmaj.git-1bed800.tar.bz2
138.15 KB
60 downloads
filedropmaj.git-1bed800.zip
190.15 KB
22 downloads
filedropmaj.git-1d330de.tar.bz2
151.65 KB
62 downloads
filedropmaj.git-1d330de.zip
210.80 KB
20 downloads
filedropmaj.git-1df190d.tar.bz2
151.72 KB
64 downloads
filedropmaj.git-1df190d.zip
210.85 KB
18 downloads
filedropmaj.git-1ee1167.tar.bz2
151.52 KB
64 downloads
filedropmaj.git-1ee1167.zip
202.16 KB
19 downloads
filedropmaj.git-2057838.tar.bz2
151.76 KB
60 downloads
filedropmaj.git-2057838.zip
202.36 KB
18 downloads
filedropmaj.git-2075213.tar.bz2
155.81 KB
61 downloads
filedropmaj.git-2075213.zip
208.39 KB
18 downloads
filedropmaj.git-211b7b0.tar.bz2
142.53 KB
63 downloads
filedropmaj.git-211b7b0.zip
194.64 KB
19 downloads
filedropmaj.git-2331f5a.tar.bz2
75.55 KB
64 downloads
filedropmaj.git-2331f5a.zip
100.32 KB
21 downloads
filedropmaj.git-25e3c4c.tar.bz2
147.57 KB
62 downloads
filedropmaj.git-25e3c4c.zip
201.46 KB
18 downloads
filedropmaj.git-2622313.tar.bz2
151.47 KB
59 downloads
filedropmaj.git-2622313.zip
206.44 KB
17 downloads
filedropmaj.git-273e4b2.tar.bz2
152.60 KB
60 downloads
filedropmaj.git-273e4b2.zip
203.40 KB
20 downloads
filedropmaj.git-2753e51.tar.bz2
136.37 KB
64 downloads
filedropmaj.git-2753e51.zip
184.34 KB
17 downloads
filedropmaj.git-2c1a589.tar.bz2
155.89 KB
58 downloads
filedropmaj.git-2c1a589.zip
208.69 KB
18 downloads
filedropmaj.git-2c3d544.tar.bz2
151.33 KB
1 download
filedropmaj.git-2c3d544.zip
206.23 KB
19 downloads
filedropmaj.git-2c85f72.tar.bz2
143.23 KB
59 downloads
filedropmaj.git-2c85f72.zip
194.84 KB
16 downloads
filedropmaj.git-2dc622c.tar.bz2
151.76 KB
57 downloads
filedropmaj.git-2dc622c.zip
202.35 KB
19 downloads
filedropmaj.git-2fabf8a.tar.bz2
151.35 KB
61 downloads
filedropmaj.git-2fabf8a.zip
206.24 KB
20 downloads
filedropmaj.git-322736b.tar.bz2
137.81 KB
54 downloads
filedropmaj.git-322736b.zip
190.18 KB
18 downloads
filedropmaj.git-374279c.tar.bz2
137.54 KB
55 downloads
filedropmaj.git-374279c.zip
189.58 KB
17 downloads
filedropmaj.git-37e852d.tar.bz2
151.32 KB
51 downloads
filedropmaj.git-37e852d.zip
206.21 KB
16 downloads
filedropmaj.git-38636de.tar.bz2
147.35 KB
51 downloads
filedropmaj.git-38636de.zip
201.16 KB
74 downloads
filedropmaj.git-3b25d71.tar.bz2
147.88 KB
44 downloads
filedropmaj.git-3b25d71.zip
201.85 KB
18 downloads
filedropmaj.git-3b6df7a.tar.bz2
153.39 KB
42 downloads
filedropmaj.git-3b6df7a.zip
204.55 KB
22 downloads
filedropmaj.git-3bf6bd2.tar.bz2
137.77 KB
47 downloads
filedropmaj.git-3bf6bd2.zip
190.16 KB
19 downloads
filedropmaj.git-3e012ff.tar.bz2
152.83 KB
43 downloads
filedropmaj.git-3e012ff.zip
211.89 KB
21 downloads
filedropmaj.git-4129ab8.tar.bz2
135.86 KB
51 downloads
filedropmaj.git-4129ab8.zip
184.30 KB
19 downloads
filedropmaj.git-414dbb4.tar.bz2
91.09 KB
49 downloads
filedropmaj.git-414dbb4.zip
130.29 KB
19 downloads
filedropmaj.git-43755d0.tar.bz2
150.25 KB
42 downloads
filedropmaj.git-43755d0.zip
204.44 KB
19 downloads
filedropmaj.git-4c20005.tar.bz2
55.59 KB
45 downloads
filedropmaj.git-4c20005.zip
74.20 KB
19 downloads
filedropmaj.git-4ccdbcd.tar.bz2
136.38 KB
47 downloads
filedropmaj.git-4ccdbcd.zip
185.22 KB
21 downloads
filedropmaj.git-4cd1a1c.tar.bz2
155.25 KB
44 downloads
filedropmaj.git-4cd1a1c.zip
207.88 KB
21 downloads
filedropmaj.git-4cf16d1.tar.bz2
76.32 KB
47 downloads
filedropmaj.git-4cf16d1.zip
101.80 KB
17 downloads
filedropmaj.git-4ec45a0.tar.bz2
131.16 KB
44 downloads
filedropmaj.git-4ec45a0.zip
172.66 KB
19 downloads
filedropmaj.git-4f73c22.tar.bz2
134.46 KB
44 downloads
filedropmaj.git-4f73c22.zip
182.45 KB
18 downloads
filedropmaj.git-5457969.tar.bz2
155.21 KB
46 downloads
filedropmaj.git-5457969.zip
207.63 KB
19 downloads
filedropmaj.git-57ee8a1.tar.bz2
145.49 KB
47 downloads
filedropmaj.git-57ee8a1.zip
198.12 KB
71 downloads
filedropmaj.git-592978d.tar.bz2
138.38 KB
45 downloads
filedropmaj.git-592978d.zip
190.58 KB
16 downloads
filedropmaj.git-5935b42.tar.bz2
135.60 KB
43 downloads
filedropmaj.git-5935b42.zip
183.28 KB
20 downloads
filedropmaj.git-5b443b6.tar.bz2
152.00 KB
45 downloads
filedropmaj.git-5b443b6.zip
211.07 KB
18 downloads
filedropmaj.git-5b4a9bf.tar.bz2
155.29 KB
43 downloads
filedropmaj.git-5b4a9bf.zip
207.93 KB
17 downloads
filedropmaj.git-5b6c01d.tar.bz2
147.13 KB
44 downloads
filedropmaj.git-5b6c01d.zip
200.86 KB
21 downloads
filedropmaj.git-5da45f7.tar.bz2
147.27 KB
44 downloads
filedropmaj.git-5da45f7.zip
201.02 KB
18 downloads
filedropmaj.git-5e53618.tar.bz2
75.57 KB
47 downloads
filedropmaj.git-5e53618.zip
100.78 KB
19 downloads
filedropmaj.git-5f8ca35.tar.bz2
136.39 KB
42 downloads
filedropmaj.git-5f8ca35.zip
185.32 KB
18 downloads
filedropmaj.git-61e3d7b.tar.bz2
153.52 KB
42 downloads
filedropmaj.git-61e3d7b.zip
204.73 KB
19 downloads
filedropmaj.git-62a635c.tar.bz2
155.90 KB
46 downloads
filedropmaj.git-62a635c.zip
208.73 KB
19 downloads
filedropmaj.git-6390d34.tar.bz2
138.39 KB
46 downloads
filedropmaj.git-6390d34.zip
190.56 KB
22 downloads
filedropmaj.git-649dfbe.tar.bz2
151.78 KB
45 downloads
filedropmaj.git-649dfbe.zip
210.91 KB
19 downloads
filedropmaj.git-65d6570.tar.bz2
151.63 KB
48 downloads
filedropmaj.git-65d6570.zip
210.80 KB
21 downloads
filedropmaj.git-660433f.tar.bz2
151.67 KB
45 downloads
filedropmaj.git-660433f.zip
206.68 KB
19 downloads
filedropmaj.git-6619ae5.tar.bz2
153.23 KB
1 download
filedropmaj.git-6619ae5.zip
204.28 KB
18 downloads
filedropmaj.git-68e4e3a.tar.bz2
135.13 KB
42 downloads
filedropmaj.git-68e4e3a.zip
182.91 KB
18 downloads
filedropmaj.git-6995297.tar.bz2
144.93 KB
47 downloads
filedropmaj.git-6995297.zip
197.18 KB
17 downloads
filedropmaj.git-69d6fd3.tar.bz2
143.23 KB
43 downloads
filedropmaj.git-69d6fd3.zip
194.89 KB
21 downloads
filedropmaj.git-6aa872a.tar.bz2
142.95 KB
48 downloads
filedropmaj.git-6aa872a.zip
195.11 KB
20 downloads
filedropmaj.git-6bad5c7.tar.bz2
147.04 KB
47 downloads
filedropmaj.git-6bad5c7.zip
200.79 KB
19 downloads
filedropmaj.git-6e96a2d.tar.bz2
152.13 KB
46 downloads
filedropmaj.git-6e96a2d.zip
207.21 KB
72 downloads
filedropmaj.git-73d46de.tar.bz2
138.42 KB
43 downloads
filedropmaj.git-73d46de.zip
190.59 KB
18 downloads
filedropmaj.git-75e0478.tar.bz2
144.54 KB
47 downloads
filedropmaj.git-75e0478.zip
196.70 KB
20 downloads
filedropmaj.git-784fc35.tar.bz2
143.07 KB
47 downloads
filedropmaj.git-784fc35.zip
195.01 KB
18 downloads
filedropmaj.git-7872a83.tar.bz2
138.51 KB
48 downloads
filedropmaj.git-7872a83.zip
190.69 KB
17 downloads
filedropmaj.git-788fb89.tar.bz2
138.30 KB
46 downloads
filedropmaj.git-788fb89.zip
191.26 KB
23 downloads
filedropmaj.git-796d8a3.tar.bz2
138.92 KB
43 downloads
filedropmaj.git-796d8a3.zip
191.24 KB
18 downloads
filedropmaj.git-79a5e8d.tar.bz2
132.43 KB
47 downloads
filedropmaj.git-79a5e8d.zip
176.90 KB
19 downloads
filedropmaj.git-7b3b2e0.tar.bz2
147.24 KB
45 downloads
filedropmaj.git-7b3b2e0.zip
201.05 KB
19 downloads
filedropmaj.git-7e28eed.tar.bz2
138.89 KB
42 downloads
filedropmaj.git-7e28eed.zip
191.24 KB
19 downloads
filedropmaj.git-8279296.tar.bz2
135.56 KB
47 downloads
filedropmaj.git-8279296.zip
183.25 KB
19 downloads
filedropmaj.git-84c17fe.tar.bz2
152.87 KB
47 downloads
filedropmaj.git-84c17fe.zip
211.90 KB
19 downloads
filedropmaj.git-87c5d5f.tar.bz2
135.78 KB
45 downloads
filedropmaj.git-87c5d5f.zip
183.64 KB
17 downloads
filedropmaj.git-8a48901.tar.bz2
147.27 KB
48 downloads
filedropmaj.git-8a48901.zip
201.06 KB
19 downloads
filedropmaj.git-8ad9892.tar.bz2
164.04 KB
44 downloads
filedropmaj.git-8ad9892.zip
224.42 KB
18 downloads
filedropmaj.git-8b4cf2a.tar.bz2
134.06 KB
46 downloads
filedropmaj.git-8b4cf2a.zip
180.78 KB
19 downloads
filedropmaj.git-8b7e38d.tar.bz2
138.04 KB
50 downloads
filedropmaj.git-8b7e38d.zip
190.39 KB
75 downloads
filedropmaj.git-8df6e40.tar.bz2
143.11 KB
47 downloads
filedropmaj.git-8df6e40.zip
194.66 KB
23 downloads
filedropmaj.git-8e80c84.tar.bz2
138.18 KB
1 download
filedropmaj.git-8e80c84.zip
190.30 KB
19 downloads
filedropmaj.git-8ec0fba.tar.bz2
138.37 KB
48 downloads
filedropmaj.git-8ec0fba.zip
191.39 KB
18 downloads
filedropmaj.git-8f7abf6.tar.bz2
153.36 KB
47 downloads
filedropmaj.git-8f7abf6.zip
211.80 KB
18 downloads
filedropmaj.git-923f11a.tar.bz2
138.14 KB
44 downloads
filedropmaj.git-923f11a.zip
191.03 KB
20 downloads
filedropmaj.git-955e82e.tar.bz2
42.71 KB
44 downloads
filedropmaj.git-955e82e.zip
59.77 KB
19 downloads
filedropmaj.git-95add4a.tar.bz2
151.23 KB
49 downloads
filedropmaj.git-95add4a.zip
205.91 KB
19 downloads
filedropmaj.git-96fe0ba.tar.bz2
137.68 KB
41 downloads
filedropmaj.git-96fe0ba.zip
190.34 KB
18 downloads
filedropmaj.git-99a90ce.tar.bz2
137.82 KB
48 downloads
filedropmaj.git-99a90ce.zip
191.20 KB
21 downloads
filedropmaj.git-9a69bb9.tar.bz2
143.19 KB
48 downloads
filedropmaj.git-9a69bb9.zip
194.70 KB
20 downloads
filedropmaj.git-9b6538e.tar.bz2
151.45 KB
45 downloads
filedropmaj.git-9b6538e.zip
202.15 KB
16 downloads
filedropmaj.git-9c4292d.tar.bz2
132.06 KB
46 downloads
filedropmaj.git-9c4292d.zip
176.93 KB
18 downloads
filedropmaj.git-9c78d40.tar.bz2
137.70 KB
45 downloads
filedropmaj.git-9c78d40.zip
190.49 KB
20 downloads
filedropmaj.git-9f1363f.tar.bz2
43.12 KB
49 downloads
filedropmaj.git-9f1363f.zip
60.31 KB
18 downloads
filedropmaj.git-a16c3eb.tar.bz2
90.22 KB
43 downloads
filedropmaj.git-a16c3eb.zip
128.62 KB
18 downloads
filedropmaj.git-a3aa72d.tar.bz2
153.00 KB
46 downloads
filedropmaj.git-a3aa72d.zip
203.86 KB
21 downloads
filedropmaj.git-a6886e4.tar.bz2
144.69 KB
46 downloads
filedropmaj.git-a6886e4.zip
196.95 KB
18 downloads
filedropmaj.git-a8669dc.tar.bz2
135.60 KB
44 downloads
filedropmaj.git-a8669dc.zip
183.34 KB
19 downloads
filedropmaj.git-a9477f1.tar.bz2
135.59 KB
46 downloads
filedropmaj.git-a9477f1.zip
183.45 KB
19 downloads
filedropmaj.git-aa285db.tar.bz2
151.73 KB
47 downloads
filedropmaj.git-aa285db.zip
210.85 KB
18 downloads
filedropmaj.git-aa6ae87.tar.bz2
135.44 KB
45 downloads
filedropmaj.git-aa6ae87.zip
183.88 KB
19 downloads
filedropmaj.git-ab6bc22.tar.bz2
151.71 KB
42 downloads
filedropmaj.git-ab6bc22.zip
210.84 KB
20 downloads
filedropmaj.git-adef726.tar.bz2
153.48 KB
45 downloads
filedropmaj.git-adef726.zip
212.32 KB
19 downloads
filedropmaj.git-afe5877.tar.bz2
144.73 KB
41 downloads
filedropmaj.git-afe5877.zip
197.01 KB
18 downloads
filedropmaj.git-b2d9f8e.tar.bz2
133.22 KB
44 downloads
filedropmaj.git-b2d9f8e.zip
179.27 KB
18 downloads
filedropmaj.git-b41f320.tar.bz2
151.56 KB
42 downloads
filedropmaj.git-b41f320.zip
209.85 KB
23 downloads
filedropmaj.git-b4432ce.tar.bz2
152.96 KB
43 downloads
filedropmaj.git-b4432ce.zip
203.86 KB
19 downloads
filedropmaj.git-b67b08f.tar.bz2
151.27 KB
45 downloads
filedropmaj.git-b67b08f.zip
206.15 KB
21 downloads
filedropmaj.git-b899831.tar.bz2
143.12 KB
44 downloads
filedropmaj.git-b899831.zip
194.60 KB
19 downloads
filedropmaj.git-b8b49c1.tar.bz2
132.59 KB
42 downloads
filedropmaj.git-b8b49c1.zip
178.90 KB
17 downloads
filedropmaj.git-b9c5bcf.tar.bz2
155.92 KB
43 downloads
filedropmaj.git-b9c5bcf.zip
208.70 KB
17 downloads
filedropmaj.git-bbddb1f.tar.bz2
151.63 KB
42 downloads
filedropmaj.git-bbddb1f.zip
209.92 KB
21 downloads
filedropmaj.git-bcaa744.tar.bz2
146.98 KB
45 downloads
filedropmaj.git-bcaa744.zip
200.79 KB
20 downloads
filedropmaj.git-c1ff9dc.tar.bz2
138.39 KB
46 downloads
filedropmaj.git-c1ff9dc.zip
191.43 KB
102 downloads
filedropmaj.git-c20c4b0.tar.bz2
151.64 KB
44 downloads
filedropmaj.git-c20c4b0.zip
210.79 KB
18 downloads
filedropmaj.git-c37f3f7.tar.bz2
145.45 KB
58 downloads
filedropmaj.git-c37f3f7.zip
198.11 KB
27 downloads
filedropmaj.git-c532394.tar.bz2
146.39 KB
46 downloads
filedropmaj.git-c532394.zip
199.91 KB
20 downloads
filedropmaj.git-c6317a4.tar.bz2
152.01 KB
45 downloads
filedropmaj.git-c6317a4.zip
207.08 KB
18 downloads
filedropmaj.git-c748176.tar.bz2
89.44 KB
43 downloads
filedropmaj.git-c748176.zip
126.35 KB
19 downloads
filedropmaj.git-c9ed81f.tar.bz2
135.56 KB
43 downloads
filedropmaj.git-c9ed81f.zip
183.28 KB
21 downloads
filedropmaj.git-c9f9b80.tar.bz2
138.50 KB
42 downloads
filedropmaj.git-c9f9b80.zip
190.66 KB
20 downloads
filedropmaj.git-ca65b73.tar.bz2
152.69 KB
44 downloads
filedropmaj.git-ca65b73.zip
207.87 KB
20 downloads
filedropmaj.git-cd80b77.tar.bz2
153.12 KB
44 downloads
filedropmaj.git-cd80b77.zip
212.01 KB
17 downloads
filedropmaj.git-cffbb2a.tar.bz2
138.22 KB
42 downloads
filedropmaj.git-cffbb2a.zip
190.28 KB
19 downloads
filedropmaj.git-d061ad7.tar.bz2
55.78 KB
57 downloads
filedropmaj.git-d061ad7.zip
74.39 KB
20 downloads
filedropmaj.git-d0af4d6.tar.bz2
57.28 KB
44 downloads
filedropmaj.git-d0af4d6.zip
78.56 KB
20 downloads
filedropmaj.git-d1caa0a.tar.bz2
144.57 KB
46 downloads
filedropmaj.git-d1caa0a.zip
196.63 KB
19 downloads
filedropmaj.git-d5679b5.tar.bz2
152.37 KB
43 downloads
filedropmaj.git-d5679b5.zip
207.52 KB
20 downloads
filedropmaj.git-d72f459.tar.bz2
147.90 KB
45 downloads
filedropmaj.git-d72f459.zip
201.92 KB
17 downloads
filedropmaj.git-d958c91.tar.bz2
144.67 KB
46 downloads
filedropmaj.git-d958c91.zip
196.88 KB
22 downloads
filedropmaj.git-d96784f.tar.bz2
135.58 KB
43 downloads
filedropmaj.git-d96784f.zip
183.46 KB
17 downloads
filedropmaj.git-da4b73f.tar.bz2
152.62 KB
42 downloads
filedropmaj.git-da4b73f.zip
203.48 KB
18 downloads
filedropmaj.git-dd24240.tar.bz2
138.27 KB
42 downloads
filedropmaj.git-dd24240.zip
190.45 KB
77 downloads
filedropmaj.git-e11e772.tar.bz2
152.09 KB
41 downloads
filedropmaj.git-e11e772.zip
211.33 KB
18 downloads
filedropmaj.git-e61478e.tar.bz2
135.95 KB
46 downloads
filedropmaj.git-e61478e.zip
183.91 KB
19 downloads
filedropmaj.git-e7a2547.tar.bz2
133.80 KB
41 downloads
filedropmaj.git-e7a2547.zip
180.05 KB
21 downloads
filedropmaj.git-e8a3b95.tar.bz2
138.15 KB
46 downloads
filedropmaj.git-e8a3b95.zip
191.04 KB
17 downloads
filedropmaj.git-eac86d5.tar.bz2
155.65 KB
42 downloads
filedropmaj.git-eac86d5.zip
208.28 KB
17 downloads
filedropmaj.git-ed83bf9.tar.bz2
135.16 KB
43 downloads
filedropmaj.git-ed83bf9.zip
182.91 KB
20 downloads
filedropmaj.git-ee50d40.tar.bz2
135.59 KB
44 downloads
filedropmaj.git-ee50d40.zip
183.48 KB
20 downloads
filedropmaj.git-efdb4df.tar.bz2
155.87 KB
45 downloads
filedropmaj.git-efdb4df.zip
208.72 KB
19 downloads
filedropmaj.git-f1554f8.tar.bz2
151.30 KB
46 downloads
filedropmaj.git-f1554f8.zip
206.22 KB
21 downloads
filedropmaj.git-f72a07b.tar.bz2
153.44 KB
46 downloads
filedropmaj.git-f72a07b.zip
212.11 KB
21 downloads
filedropmaj.git-f7ea5a1.tar.bz2
147.46 KB
45 downloads
filedropmaj.git-f7ea5a1.zip
201.32 KB
21 downloads
filedropmaj.git-f8a7353.tar.bz2
138.49 KB
44 downloads
filedropmaj.git-f8a7353.zip
190.66 KB
22 downloads
filedropmaj.git-fb84a8d.tar.bz2
137.61 KB
50 downloads
filedropmaj.git-fb84a8d.zip
190.70 KB
23 downloads
filedropmaj.git-fdcf5d3.tar.bz2
152.34 KB
48 downloads
filedropmaj.git-fdcf5d3.zip
207.53 KB
22 downloads
filedropmaj.git-feca42d.tar.bz2
132.90 KB
48 downloads
filedropmaj.git-feca42d.zip
179.44 KB
25 downloads