This commit has been accessed 708 times via Git panel.
commit 08159fba8bbabf93c8064444c04b9278c2e59a7c
tree 784fc35e7a2e470dd95702b09f50602d79cb078f
parent e011ee437bfb34cf32d77eb1f22ae07947616f69
author Engels Antonio <engels@majcms.org> 1277314202 +0800
committer Engels Antonio <engels@majcms.org> 1277314202 +0800
maj-1.0-20081123-bb.zip
diff --git a/add.php b/add.php
index b31967a..01b761f 100644
--- a/add.php
+++ b/add.php
@@ -6,9 +6,16 @@ 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);
}
@@ -18,7 +25,6 @@ if (get_magic_quotes_gpc()) {
return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -33,7 +39,9 @@ if ($_SESSION['logged_in'] == 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");
}
@@ -136,7 +144,6 @@ $entry_hour = date("H", time() + $offset);
$entry_min = date("i", time() + $offset);
$entry_sec = date("s", time() + $offset);
-$image_path = "images/";
$max_image_size = 8000000;
$max_file_size = 8000000;
@@ -332,6 +339,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input autocomplete="off" type="file" name="file_input"> Select optional file.</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")) {
@@ -350,7 +358,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
if ($count_cat > 0) {
- echo "<p><select name=\"category\"><option selected>unfiled";
+ echo "<p><select name=\"category\"><option value=\"\" selected>unfiled";
foreach ($show_cat as $category) {
echo "<option value=\"";
@@ -370,6 +378,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
}
}
?>
+
<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>
@@ -828,8 +837,9 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$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 = "<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);
@@ -852,89 +862,79 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
function PDF($orientation='P',$unit='mm',$format='letter')
{
- //Call parent constructor
- $this->FPDF($orientation,$unit,$format);
- //Initialization
- $this->B=0;
- $this->I=0;
- $this->U=0;
- $this->HREF='';
+ $this->FPDF($orientation,$unit,$format);
+ $this->B=0;
+ $this->I=0;
+ $this->U=0;
+ $this->HREF='';
}
function WriteHTML($html)
{
- //HTML parser
- $html=str_replace("\n",' ',$html);
- $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
- foreach($a as $i=>$e)
- {
- if($i%2==0)
- {
- //Text
- if($this->HREF)
- $this->PutLink($this->HREF,$e);
- else
- $this->Write(5,$e);
- }
- else
- {
- //Tag
- if($e{0}=='/')
- $this->CloseTag(strtoupper(substr($e,1)));
- else
- {
- //Extract attributes
- $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);
- }
- }
- }
+ $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)
{
- //Opening tag
- 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);
+ 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)
{
- //Closing tag
- if($tag=='B' or $tag=='I' or $tag=='U')
- $this->SetStyle($tag,false);
- if($tag=='A')
- $this->HREF='';
+ if($tag=='B' or $tag=='I' or $tag=='U')
+ $this->SetStyle($tag,false);
+ if($tag=='A')
+ $this->HREF='';
}
function SetStyle($tag,$enable)
{
- //Modify style and select corresponding font
- $this->$tag+=($enable ? 1 : -1);
- $style='';
- foreach(array('B','I','U') as $s)
- if($this->$s>0)
- $style.=$s;
- $this->SetFont('',$style);
+ $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)
{
- //Put a hyperlink
- $this->SetTextColor(0,0,255);
- $this->SetStyle('U',true);
- $this->Write(5,$txt,$URL);
- $this->SetStyle('U',false);
- $this->SetTextColor(0);
+ $this->SetTextColor(0,0,255);
+ $this->SetStyle('U',true);
+ $this->Write(5,$txt,$URL);
+ $this->SetStyle('U',false);
+ $this->SetTextColor(0);
}
}
@@ -949,22 +949,31 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$pdf->Output($filename);
}
-if (isset($_POST['category']) and !empty($_POST['category'])) {
- if (!file_exists("data/categories")) {
- mkdir("data/categories");
+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/categories/{$_POST['category']}")) {
- $fp_category_txt = fopen("data/items/$entry/category.txt","w");
- fwrite($fp_category_txt, $_POST['category']);
- fclose($fp_category_txt);
+
+ 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")) {
- copy("data/members/active/{$_SESSION['logged_in']}/category.txt","data/items/$entry/category.txt");
+
+ 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");
+ }
}
}
@@ -982,18 +991,15 @@ if (isset($_POST['passwd']) and !empty($_POST['passwd'])) {
}
}
-$default_ping_urls = "http://technorati.com/ping/http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
-$ping_urls_file = "data/ping.txt";
+$default_ping_url = "http://technorati.com/ping/http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
-if (!file_exists($ping_urls_file)) {
- $fp_default_ping_txt = fopen($ping_urls_file,"w");
- fwrite($fp_default_ping_txt, $default_ping_urls);
+if (!file_exists("data/ping.txt")) {
+ $fp_default_ping_txt = fopen("data/ping.txt","w");
+ fwrite($fp_default_ping_txt, $default_ping_url);
fclose($fp_default_ping_txt);
}
-$fp_ping_urls = fopen($ping_urls_file, "r");
-$ping_urls = fread($fp_ping_urls, filesize($ping_urls_file));
-fclose($fp_ping_urls);
+$ping_urls = file_get_contents("data/ping.txt");
$get_ping_urls = explode("|", $ping_urls);
diff --git a/album.php b/album.php
index c93a220..08231cc 100644
--- a/album.php
+++ b/album.php
@@ -1,14 +1,19 @@
<?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){
+ foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
return $data;
@@ -77,16 +82,16 @@ if ((!isset($_POST['caption']) or empty($_POST['caption'])) and isset($_SESSION[
if (isset($_POST['caption']) and !empty($_POST['caption']) and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "caption")) {
$caption_put = ucfirst($_POST['caption']);
- $caption_put = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $caption_put);
- $caption_put = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $caption_put);
- $caption_put = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $caption_put);
- $caption_put = str_replace(':D', '<img src=images/smileys/laughing.png border=0>', $caption_put);
- $caption_put = str_replace(':P', '<img src=images/smileys/lick.png border=0>', $caption_put);
- $caption_put = str_replace(':O', '<img src=images/smileys/ohno.png border=0>', $caption_put);
- $caption_put = str_replace(':)', '<img src=images/smileys/smile.png border=0>', $caption_put);
- $caption_put = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $caption_put);
- $caption_put = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $caption_put);
- $caption_put = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $caption_put);
+ $caption_put = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_put);
+ $caption_put = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_put);
+ $caption_put = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $caption_put);
+ $caption_put = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $caption_put);
+ $caption_put = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $caption_put);
+ $caption_put = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $caption_put);
+ $caption_put = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $caption_put);
+ $caption_put = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $caption_put);
+ $caption_put = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $caption_put);
+ $caption_put = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_put);
$caption_put = str_replace('[code]', '<code>', $caption_put);
$caption_put = str_replace('[/code]', '</code>', $caption_put);
$caption_put = str_replace("\n", '<br />', $caption_put);
@@ -243,16 +248,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
$caption_get = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
$caption_get = str_replace('<br />', "\n", $caption_get);
- $caption_get = str_replace('<img src=images/smileys/crying.png border=0>', ':((', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/frown.png border=0>', ':(', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/indifferent.png border=0>', ':|', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/laughing.png border=0>', ':D', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/lick.png border=0>', ':P', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/ohno.png border=0>', ':O', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/smile.png border=0>', ':)', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/surprised.png border=0>', '=)', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/undecided.png border=0>', ':\\', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/wink.png border=0>', ';)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/lick.png" border="0">', ':P', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/smile.png" border="0">', ':)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/wink.png" border="0">', ';)', $caption_get);
$caption_get = str_replace('<span style="background-color: #ffff00;">', '<highlight>', $caption_get);
$caption_get = str_replace('</span>', '</highlight>', $caption_get);
echo $caption_get;
diff --git a/cat.php b/cat.php
index 7ac90c2..2c13521 100644
--- a/cat.php
+++ b/cat.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -27,29 +31,58 @@ if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username
exit();
}
-function rmdirr($recurse_dirname)
-{
+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")) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
+ while (($entry_cat_txt = readdir($dh_cat_txt)) !== false) {
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
+ if ($entry_cat_txt != "." && $entry_cat_txt != "..") {
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
+ if (file_exists("data/items/$entry_cat_txt/category.txt")) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
+ $category_txt = file_get_contents("data/items/$entry_cat_txt/category.txt");
+ $category_txt = strtolower($category_txt);
+ $category_txt = str_replace(" ","_",$category_txt);
+ $category_txt = trim($category_txt);
- rmdirr("$recurse_dirname/$recurse_entry");
- }
+ if (!file_exists("data/items/$entry_cat_txt/categories")) {
+ mkdir("data/items/$entry_cat_txt/categories");
+ }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
+ if (!file_exists("data/items/$entry_cat_txt/categories/$category_txt")) {
+ mkdir("data/items/$entry_cat_txt/categories/$category_txt");
+ }
+
+ unlink("data/items/$entry_cat_txt/category.txt");
+ }
+ }
+ }
+ closedir($dh_cat_txt);
+ }
}
if (isset($_POST['new_id']) and !empty($_POST['new_id'])) {
@@ -115,6 +148,39 @@ if (empty($_POST['cat_title']) and file_exists("data/categories/{$_POST['cat_id'
unlink("data/categories/{$_POST['cat_id']}/title.txt");
}
+if (isset($_POST['cat_ren']) and !empty($_POST['cat_ren'])) {
+
+ $cat_rename = strtolower($_POST['cat_ren']);
+ $cat_rename = str_replace(" ","_",$cat_rename);
+ $cat_rename = trim($cat_rename);
+
+ $cat_oldname = strtolower($_POST['cat_id']);
+ $cat_oldname = str_replace(" ","_",$cat_oldname);
+ $cat_oldname = trim($cat_oldname);
+
+ if (($cat_rename != $cat_oldname) and !file_exists("data/categories/$cat_rename")) {
+ rename("data/categories/$cat_oldname","data/categories/$cat_rename");
+ }
+
+
+ if (file_exists("data/items")) {
+
+ if ($dh_cat_ren = opendir("data/items")) {
+
+ while (($entry_cat_ren = readdir($dh_cat_ren)) !== false) {
+
+ if ($entry_cat_ren != "." && $entry_cat_ren != "..") {
+
+ if (file_exists("data/items/$entry_cat_ren/categories/$cat_oldname") and !file_exists("data/items/$entry_cat_ren/categories/$cat_rename")) {
+ rename("data/items/$entry_cat_ren/categories/$cat_oldname","data/items/$entry_cat_ren/categories/$cat_rename");
+ }
+ }
+ }
+ closedir($dh_cat_ren);
+ }
+ }
+}
+
?>
<title>Categories</title>
@@ -132,10 +198,11 @@ body {
echo "{$font_body},";
}
?> arial, helvetica, sans-serif;
+ font-size: 11px;
background-color: #FFFFFF;
}
-p {
+p, td {
font-size: 11px;
}
@@ -167,7 +234,21 @@ a:active {
echo "{$font_input},";
}
?> arial, helvetica, sans-serif;
- font-size: 11px
+ font-size: 11px;
+}
+
+.id {
+ color: #666666;
+ background: #ffffff;
+ border: #999999 solid 1px;
+ width: 150px;
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$font_input},";
+ }
+ ?> arial, helvetica, sans-serif;
+ font-size: 11px;
}
.submit {
@@ -185,16 +266,16 @@ a:active {
}
</style>
-<p><b>Add Category</b></p><p>Enter a unique category ID and optional title or description.</p>
+<p><b>Add Category</b><br>Enter a unique category ID and optional title or description.</p>
-<table border=0 cellspacing=1 cellpadding=2>
-<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
-<tr><td><p>category id*</p></td><td><input type=text class=input name=new_id autocomplete=off maxlength=30></td></tr>
-<tr><td><p>title or description</p></td><td><input type=text class=input name=new_title autocomplete=off maxlength=90></td></tr>
-<tr><td><p></p></td><td><input type=submit class=input value="click here to add a new category"></td></tr>
+<table border="0" cellspacing="1" cellpadding="2">
+<form enctype="multipart/form-data" action="cat.php" method="post">
+<tr><td>category id*</td><td><input type="text" class="input" name="new_id" autocomplete="off" maxlength="30"></td></tr>
+<tr><td>title or description</td><td><input type="text" class="input" name="new_title" autocomplete="off" maxlength="90"></td></tr>
+<tr><td></td><td><input type="submit" class="input" value="click here to add a new category"></td></tr>
</form>
-<form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
-<tr><td><p></p></td><td><input class=input type=submit value="click here to go to the index page"></td></tr>
+<form enctype="multipart/form-data" action="index.php" method="post">
+<tr><td></td><td><input class="input" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -216,33 +297,34 @@ a:active {
if ($count_cat > 0) {
- echo "<p><br><b>Category Management</b></p><p>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
- echo "<table border=0 cellspacing=1 cellpadding=2>";
- echo "<tr><td><p>category id</p></td><td><p align=center>title or description</p></td><td><p align=center>hide</p></td><td><p align=center>book</p></td><td><p align=center>delete</p></td><td><p></p></td></tr>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
+ echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td><td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
foreach ($show_cat as $category) {
- echo '<form enctype="multipart/form-data" action="';
- echo $_SERVER['PHP_SELF'];
- echo '" method="post">';
- echo "<tr><td><p><b>";
- echo strtolower(str_replace("_", " ", $category));
- echo '</b></p></td><td><p><input type=text class=input name=cat_title value="';
+ echo "<form enctype=\"multipart/form-data\" action=\"cat.php\" method=\"post\">";
+ echo "<tr><td><input type=\"text\" class=\"id\" name=\"cat_ren\" value=\"$category\" maxlength=\"30\" autocomplete=\"off\"></td>";
+ echo "<td><input type=\"text\" class=\"input\" name=\"cat_title\" value=\"";
readfile("data/categories/$category/title.txt");
- echo '" autocomplete=off maxlength=90></p></td><td><p align=center><input type=checkbox name=cat_hide';
+ echo "\" autocomplete=\"off\" maxlength=\"90\"></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_hide\"";
+
if (file_exists("data/categories/$category/private.txt")) {
echo " checked";
}
- echo "></p></td>";
- echo "<td><p align=center><input type=checkbox name=cat_book";
+
+ echo "></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_book\"";
+
if (file_exists("data/categories/$category/book.txt")) {
echo " checked";
}
- echo "></p></td>";
- echo "<td><p align=center><input type=checkbox name=cat_del></p></td><td><p><input type=hidden name=cat_id value=$category><input type=hidden name=cat_edit value=on><input type=submit class=submit value=submit></p></td>";
+ echo "></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_del\"></td>";
+ echo "<td><input type=\"hidden\" name=\"cat_id\" value=\"$category\"><input type=\"hidden\" name=\"cat_edit\" value=\"on\"><input type=\"submit\" class=\"submit\" value=\"submit\"></td>";
echo "</tr></form>";
}
-
echo "</table>";
}
}
diff --git a/colors.php b/colors.php
index f8bc755..474fefb 100644
--- a/colors.php
+++ b/colors.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
diff --git a/del.php b/del.php
index 7a1b3f0..b3f9fc3 100644
--- a/del.php
+++ b/del.php
@@ -6,6 +6,10 @@ 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)) {
diff --git a/dig.php b/dig.php
index 3d42668..5c90d8d 100644
--- a/dig.php
+++ b/dig.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -47,7 +51,7 @@ body {
background-color: #FFFFFF;
}
-p {
+p, td {
font-size: 11px;
}
@@ -178,9 +182,26 @@ if ($dh_search_items = opendir($dir)) {
continue;
}
- $cat_dir = file_get_contents("data/items/$entry_search_items/category.txt");
+ $private = "0";
+
+ if (file_exists("data/items/$entry_search_items/categories")) {
+
+ if ($dh_cat_dig = opendir("data/items/$entry_search_items/categories")) {
+
+ while (($entry_cat_dig = readdir($dh_cat_dig)) !== false) {
+
+ if ($entry_cat_dig != "." && $entry_cat_dig != "..") {
+
+ if (file_exists("data/categories/$entry_cat_dig/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_cat_dig);
+ }
+ }
- if (file_exists("data/categories/$cat_dir/private.txt") and !file_exists("data/items/$entry_search_items/cat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (($private > 0) and !file_exists("data/items/$entry_search_items/cat.txt")) {
continue;
}
diff --git a/edit.php b/edit.php
index 79ae111..adfebf7 100644
--- a/edit.php
+++ b/edit.php
@@ -6,6 +6,10 @@ 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)) {
@@ -15,10 +19,9 @@ if (get_magic_quotes_gpc()) {
return $data;
}
else {
- return stripslashes($data);
+ return stripslashes($data);
}
}
-
$_REQUEST = stripslashes_array($_REQUEST);
}
@@ -88,13 +91,6 @@ $revisions_file = 'data/items/' . $_REQUEST['entry'] . '/revisions.txt';
$max_image_size = 8000000;
$max_file_size = 8000000;
-if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- if (!file_exists($category_check)) {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
-}
-
?>
<title>Edit</title>
@@ -226,16 +222,16 @@ a:active {
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 = 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);
@@ -283,16 +279,16 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
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);
+ $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;
@@ -318,6 +314,8 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
?>
+<table border="0" cellspacing="0" cellpadding="0"><tr><td>
+
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="525">
<div id="panel_title"><?php readfile($title_file); ?></div>
@@ -339,18 +337,18 @@ if (file_exists($revisions_file)) {
echo ')';
}
-if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- echo " Filed under ";
- $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
-}
+//if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
+// echo " Filed under ";
+// $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
+// $category_key = strtolower($category_key);
+// if (file_exists("data/categories/{$category_key}/title.txt")) {
+// $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
+// echo "$category_key ($category_dsp)";
+// }
+// else {
+// echo "$category_key";
+// }
+//}
?></font></div>
</td></tr></table>
@@ -396,50 +394,6 @@ if ($_SESSION['logged_in'] == $login_username) {
}
?></td></tr>
- <?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 "<tr><td><select name=\"category\"><option>unfiled";
-
- foreach ($show_cat as $category) {
- echo "<option value=\"";
- echo strtolower($category);
- echo "\"";
-
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt") and (file_get_contents("data/items/{$_REQUEST['entry']}/category.txt") == $category)) {
- echo " selected";
- }
-
- echo ">";
-
- if (file_exists("data/categories/$category/title.txt")) {
- readfile("data/categories/$category/title.txt");
- }
- else {
- echo strtolower($category);
- }
- }
-
- echo "</select> Select category.</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>
@@ -453,24 +407,18 @@ if ($_SESSION['logged_in'] == $login_username) {
<?php
- // start of wiki mod (20071130)
-
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>
<?php
- // end of wiki mod (20071130)
-
}
?>
<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 } ?>
</table></p>
@@ -489,16 +437,16 @@ $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('<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);
@@ -538,6 +486,81 @@ echo $body_read_content;
</td></tr></table>
+</td><td width="25"></td><td valign="top">
+
+<?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)) {
+
+ 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>This entry has been filed under the following ";
+
+ if ($count_filed_cat == 1) {
+ echo "category";
+ }
+ else {
+ echo "categories";
+ }
+
+ echo ":</p><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($filed_cat as $filed_category) {
+ echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td><td width=\"16\"></td></tr>";
+ }
+
+ echo "</table>";
+ }
+ }
+?>
+
+</td><td width="25"></td><td valign="top">
+
+<?php
+
+if ($count_unfiled_cat > 0) {
+
+ echo "This entry has been filed under the following categories";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($unfiled_cat as $unfiled_category) {
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"16\"></td><td align=\"right\">$unfiled_category</td></tr>";
+ }
+
+ echo "</table>";
+}
+
+?>
+
+</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();
@@ -575,16 +598,16 @@ function reformat_code($defang_code) {
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] = 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)
@@ -600,16 +623,16 @@ $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(':((', '<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);
@@ -680,16 +703,16 @@ if (isset($_FILES['album_image_input']) and !empty($_FILES['album_image_input'])
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(':((', '<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);
@@ -823,8 +846,6 @@ if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
}
}
-// start of wiki mod (20071130)
-
$title_get_content = ucfirst($_POST['title_input']);
$title_get_content = str_replace('<','<',$title_get_content);
$title_get_content = str_replace('>','>',$title_get_content);
@@ -871,22 +892,16 @@ if (file_exists("data/wiki.txt") and (($title_get_content != file_get_contents("
}
-// end of wiki mod (20071130)
-
$open_body_file = fopen($body_file,"w");
fwrite($open_body_file,$body_write_content);
fclose($open_body_file);
-// start of wiki mod (20071130)
-
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);
}
-// end of wiki mod (20071130)
-
if ($_SESSION['logged_in'] == $login_username) {
$sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
@@ -985,8 +1000,9 @@ if ($_SESSION['logged_in'] == $login_username) {
$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 = "<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);
@@ -1103,20 +1119,23 @@ if ($_SESSION['logged_in'] == $login_username) {
}
if (isset($_POST['category']) and !empty($_POST['category'])) {
+
if (!file_exists("data/categories")) {
mkdir("data/categories");
}
- if ($_POST['category'] == "unfiled") {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
- if (file_exists("data/categories/{$_POST['category']}")) {
- $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
- fwrite($fp_category_txt, $_POST['category']);
- fclose($fp_category_txt);
- }
+
+// if ($_POST['category'] == "unfiled") {
+// unlink("data/items/{$_REQUEST['entry']}/category.txt");
+// }
+// if (file_exists("data/categories/{$_POST['category']}")) {
+// $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
+// fwrite($fp_category_txt, $_POST['category']);
+// fclose($fp_category_txt);
+// }
}
$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']);
@@ -1125,6 +1144,7 @@ if ($_SESSION['logged_in'] == $login_username) {
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);
diff --git a/fonts.php b/fonts.php
index 13f67bd..2018bc1 100644
--- a/fonts.php
+++ b/fonts.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
diff --git a/index.php b/index.php
index 6804582..adce78a 100644
--- a/index.php
+++ b/index.php
@@ -12,38 +12,52 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP
header("Location: login.php");
}
-if (get_magic_quotes_gpc()){
- function stripslashes_array($f_data){
- if (is_array($f_data)){
- foreach ($f_data as $f_key => $f_value){
- $f_data[$f_key] = stripslashes_array($f_value);
+if (get_magic_quotes_gpc()) {
+ function stripslashes_array($data) {
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
}
- return $f_data;
+ return $data;
}
else {
- return stripslashes($f_data);
+ return stripslashes($data);
}
}
$_REQUEST = stripslashes_array($_REQUEST);
}
if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $entry = trim($_REQUEST['entry']);
+ $req_entry = trim($_REQUEST['entry']);
}
if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
- $show = trim($_REQUEST['show']);
+ $req_show = trim($_REQUEST['show']);
+}
+
+if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
+ $req_find = trim($_REQUEST['find']);
+ $req_find = str_replace(" ","-",$req_find);
+ $req_find = strtolower($req_find);
+ $req_find = strip_tags($req_find);
}
if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $category = trim($_REQUEST['category']);
- $category = str_replace(" ","-",$category);
- $category = strtolower($category);
- $category = strip_tags($category);
+ $req_category = trim($_REQUEST['category']);
+ $req_category = str_replace(" ","-",$req_category);
+ $req_category = strtolower($req_category);
+ $req_category = strip_tags($req_category);
}
if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
- $archive = trim($_REQUEST['archive']);
+ $req_archive = trim($_REQUEST['archive']);
+}
+
+if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
+ $req_author = trim($_REQUEST['author']);
+ $req_author = str_replace(" ","-",$req_author);
+ $req_author = strtolower($req_author);
+ $req_author = strip_tags($req_author);
}
if (file_exists("data/offset.txt")) {
@@ -63,7 +77,7 @@ else {
$default_blog_title = "My Activity Journal";
$default_username = "maj";
$default_password = "php";
-$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>GPL</a>'ed blog written from scratch as a spare time family project by <a href=http://engels.mortega.net/ target=_maj>Engels</a>,<a href=http://gaffud.com/ target=_maj>Magie</a>,and <a href=http://psylocke.org/ target=_maj>Psylocke</a> Antonio.";
+$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://engels.mortega.net/" target="_maj">Engels</a>,<a href="http://gaffud.com/" target="_maj">Magie</a>,and <a href="http://psylocke.org/" target="_maj">Psylocke</a> Antonio.';
$default_blog_author = "My Activity Journal";
if (!file_exists("data")) {
@@ -145,43 +159,43 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
fclose($google_hits_file);
}
-function str_rand($f_length = 8,$f_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $f_str = '';
- $f_seeds_count = strlen($f_seeds);
+function str_rand($length = 8,$seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
+ $str = '';
+ $seeds_count = strlen($seeds);
- list($f_usec,$f_sec) = explode(' ',microtime());
- $f_seed = (float) $f_sec + ((float) $f_usec * 100000);
- mt_srand($f_seed);
+ list($usec,$sec) = explode(' ',microtime());
+ $seed = (float) $sec + ((float) $usec * 100000);
+ mt_srand($seed);
- for ($f_i = 0; $f_length > $f_i; $f_i++) {
- $f_str .= $f_seeds{mt_rand(0,$f_seeds_count - 1)};
+ for ($i = 0; $length > $i; $i++) {
+ $str .= $seeds{mt_rand(0,$seeds_count - 1)};
}
- return $f_str;
+ return $str;
}
-function rmdirr($f_recurse_dirname) {
+function rmdirr($recurse_dirname) {
- if (!file_exists($f_recurse_dirname)) {
+ if (!file_exists($recurse_dirname)) {
return false;
}
- if (is_file($f_recurse_dirname)) {
- return unlink($f_recurse_dirname);
+ if (is_file($recurse_dirname)) {
+ return unlink($recurse_dirname);
}
- $f_recurse_dir = dir($f_recurse_dirname);
+ $recurse_dir = dir($recurse_dirname);
- while (false !== $f_recurse_entry = $f_recurse_dir->read()) {
+ while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($f_recurse_entry == '.' || $f_recurse_entry == '..') {
+ if ($recurse_entry == '.' || $recurse_entry == '..') {
continue;
}
- rmdirr("$f_recurse_dirname/$f_recurse_entry");
+ rmdirr("$recurse_dirname/$recurse_entry");
}
- $f_recurse_dir->close();
- return rmdir($f_recurse_dirname);
+ $recurse_dir->close();
+ return rmdir($recurse_dirname);
}
if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
@@ -191,64 +205,64 @@ if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
die();
}
-function go_download($f_dl_file) {
+function go_download($dl_file) {
- $entry = trim($_REQUEST['entry']);
+ $req_entry = trim($_REQUEST['entry']);
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pdf")) {
- $f_dl_path = "data/items/$entry/pdf/file";
- $f_count_path = "data/items/$entry/pdf/count";
- $f_count_file = "dl.txt";
+ $dl_path = "data/items/$req_entry/pdf/file";
+ $count_path = "data/items/$req_entry/pdf/count";
+ $count_file = "dl.txt";
}
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "filedrop")) {
- $f_dl_path = "data/items/$entry/filedrop/files";
- $f_count_path = "data/items/$entry/filedrop/count";
- $f_count_file = "{$f_dl_file}.txt";
+ $dl_path = "data/items/$req_entry/filedrop/files";
+ $count_path = "data/items/$req_entry/filedrop/count";
+ $count_file = "{$dl_file}.txt";
}
- $f_dl_file_size = filesize("$f_dl_path/$f_dl_file");
+ $dl_file_size = filesize("$dl_path/$dl_file");
header("Cache-Control: ");
header("Pragma: ");
header("Content-type: application/octet-stream");
- header("Content-Disposition: attachment; filename=$f_dl_file");
- header("Content-length: $f_dl_file_size");
+ header("Content-Disposition: attachment; filename=$dl_file");
+ header("Content-length: $dl_file_size");
- $f_get_it = fopen("$f_dl_path/$f_dl_file","rb");
+ $get_it = fopen("$dl_path/$dl_file","rb");
- while (!feof($f_get_it)) {
- $f_buf = fread($f_get_it,4096);
- echo $f_buf;
- $f_bytes_sent += strlen($f_buf);
+ while (!feof($get_it)) {
+ $buf = fread($get_it,4096);
+ echo $buf;
+ $bytes_sent += strlen($buf);
}
- if ($f_bytes_sent == $f_dl_file_size) {
+ if ($bytes_sent == $dl_file_size) {
- if (!file_exists($f_count_path)) {
- mkdir($f_count_path);
+ if (!file_exists($count_path)) {
+ mkdir($count_path);
}
- $f_unique_downloads = "$f_count_path/$f_count_file";
+ $unique_downloads = "$count_path/$count_file";
- if (file_exists($f_unique_downloads)) {
- $f_count_unique_downloads = file_get_contents($f_unique_downloads);
+ if (file_exists($unique_downloads)) {
+ $count_unique_downloads = file_get_contents($unique_downloads);
}
else {
- $f_count_unique_downloads = "0";
+ $count_unique_downloads = "0";
}
- $f_count_unique_downloads = $f_count_unique_downloads + 1;
+ $count_unique_downloads = $count_unique_downloads + 1;
- $f_fp_unique_downloads = fopen($f_unique_downloads,"w");
- fwrite($f_fp_unique_downloads,$f_count_unique_downloads);
- fclose($f_fp_unique_downloads);
+ $fp_unique_downloads = fopen($unique_downloads,"w");
+ fwrite($fp_unique_downloads,$count_unique_downloads);
+ fclose($fp_unique_downloads);
}
}
-if (isset($entry) and !empty($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'])) {
+if (isset($req_entry) and !empty($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'])) {
- $comment_dir = "data/items/$entry/comments/pending/{$_REQUEST['comment']}";
+ $comment_dir = "data/items/$req_entry/comments/pending/{$_REQUEST['comment']}";
$login_key = file_get_contents("$comment_dir/key.txt");
@@ -256,9 +270,18 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
if ($_REQUEST['action'] == "approve") {
- $live_dir = "data/items/$entry/comments/live/{$_REQUEST['comment']}";
+ $live_dir = "data/items/$req_entry/comments/live/{$_REQUEST['comment']}";
+
+ if (!file_exists("data/items/$req_entry/comments/live")) {
+ mkdir("data/items/$req_entry/comments/live");
+ }
+
+ if (!file_exists("data/items/$req_entry/comments/live/{$_REQUEST['comment']}")) {
+ mkdir("data/items/$req_entry/comments/live/{$_REQUEST['comment']}");
+ }
rename($comment_dir,$live_dir);
+
unlink("$live_dir/key.txt");
$cmonth = date("Ym",time() + $offset);
@@ -271,17 +294,34 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
mkdir("data/comments/latest/$cmonth");
}
- if (!file_exists("data/comments/latest/$cmonth/$entry")) {
- mkdir("data/comments/latest/$cmonth/$entry");
+ if (!file_exists("data/comments/latest/$cmonth/$req_entry")) {
+ mkdir("data/comments/latest/$cmonth/$req_entry");
}
- if (!file_exists("data/comments/latest/$cmonth/$entry/{$_REQUEST['comment']}")) {
- mkdir("data/comments/latest/$cmonth/$entry/{$_REQUEST['comment']}");
+ if (!file_exists("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}")) {
+ mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
}
- $cat_dir = file_get_contents("data/items/$entry/category.txt");
+ $private_categories = "0";
+
+ if (file_exists("data/items/$req_entry/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
+
+ while (($entry_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($entry_category != "." && $entry_category != "..") {
+
+ if (file_exists("data/categories/$entry_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
+ }
- if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$entry/private.txt") and !file_exists("data/categories/$cat_dir/private.txt")) {
+ if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$req_entry/private.txt") and ($private_categories == "0")) {
if (file_exists("data/ml-reply2.txt")) {
$ml_reply2 = file_get_contents("data/ml-reply2.txt");
@@ -301,7 +341,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$ml_from = '"' . "$ml_from_firstname $ml_from_lastname" . '" <' . $ml_from . '>';
- $ml_subject = file_get_contents("data/items/$entry/title.txt");
+ $ml_subject = file_get_contents("data/items/$req_entry/title.txt");
if (file_exists("data/ml-prepend.txt")) {
$ml_prepend = file_get_contents("data/ml-prepend.txt");
@@ -315,17 +355,17 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = file_get_contents("$live_dir/comment.txt");
- $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('<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('&','&',$ml_body);
$ml_body = str_replace('<','<',$ml_body);
$ml_body = str_replace('>','>',$ml_body);
@@ -352,11 +392,11 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$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_url = "http://$ml_url/index.php?entry=$req_entry&show=comments";
$ml_body = $ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $ml_url;
- if (file_exists("data/items/$entry/member.txt")) {
+ if (file_exists("data/items/$req_entry/member.txt")) {
$ml_body = $ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
}
@@ -368,7 +408,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
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 ($ml_member != "." && $ml_member != "..") {
if (file_exists("data/members/active/$ml_member/noml.txt")) {
continue;
@@ -387,13 +427,13 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
mail($ml_to,$ml_subject,$ml_body,
"From: $ml_from\r\n" .
"Reply-To: $ml_reply2\r\n" .
- "References: $entry\r\n" .
+ "References: $req_entry\r\n" .
"X-Mailer: $ml_mailer");
}
else {
mail($ml_to,$ml_subject,$ml_body,
"From: $ml_from\r\n" .
- "References: $entry\r\n" .
+ "References: $req_entry\r\n" .
"X-Mailer: $ml_mailer");
}
}
@@ -408,7 +448,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
rmdirr($comment_dir);
}
- $pending_comment_flag_dir = $entry;
+ $pending_comment_flag_dir = $req_entry;
$fp_comment_count_txt = fopen("data/comments/pending/$pending_comment_flag_dir/count.txt","r");
$comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$pending_comment_flag_dir/count.txt"));
@@ -427,24 +467,24 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
fclose($fp_comment_count_txt);
}
- header("Location: index.php?entry=$entry&show=comments");
+ header("Location: index.php?entry=$req_entry&show=comments");
}
}
-if (isset($entry) and !empty($entry)) {
+if (isset($req_entry) and !empty($req_entry)) {
- if (file_exists("data/items/$entry")) {
+ if (file_exists("data/items/$req_entry")) {
- $filter = $entry;
+ $filter = $req_entry;
- $title = file_get_contents("data/items/$entry/title.txt");
+ $title = file_get_contents("data/items/$req_entry/title.txt");
echo "<title>$title</title>";
if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- if (file_exists("data/items/$entry/views.txt")) {
- $count_views = file_get_contents("data/items/$entry/views.txt");
+ if (file_exists("data/items/$req_entry/views.txt")) {
+ $count_views = file_get_contents("data/items/$req_entry/views.txt");
}
else {
$count_views = "0";
@@ -452,55 +492,55 @@ if (isset($entry) and !empty($entry)) {
$count_views = $count_views + 1;
- $fp_views = fopen("data/items/$entry/views.txt","w");
+ $fp_views = fopen("data/items/$req_entry/views.txt","w");
fwrite($fp_views,$count_views);
fclose($fp_views);
}
- if (isset($show) and !empty($show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
+ if (isset($req_show) and !empty($req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- if (!file_exists("data/items/$entry/comments")) {
- mkdir("data/items/$entry/comments");
+ if (!file_exists("data/items/$req_entry/comments")) {
+ mkdir("data/items/$req_entry/comments");
}
- if (!file_exists("data/items/$entry/comments/pending")) {
- mkdir("data/items/$entry/comments/pending");
+ if (!file_exists("data/items/$req_entry/comments/pending")) {
+ mkdir("data/items/$req_entry/comments/pending");
}
- if (!file_exists("data/items/$entry/comments/live")) {
- mkdir("data/items/$entry/comments/live");
+ if (!file_exists("data/items/$req_entry/comments/live")) {
+ mkdir("data/items/$req_entry/comments/live");
}
$timestamp = date("l,M j,Y,g:i A",time() + $offset);
$comment_entry_dir = date("YmdHis",time() + $offset);
- mkdir("data/items/$entry/comments/pending/$comment_entry_dir");
+ mkdir("data/items/$req_entry/comments/pending/$comment_entry_dir");
$body_content = ucfirst($_POST['new_comment']);
$body_content = htmlentities($body_content,ENT_NOQUOTES);
- $body_content = str_replace("\n",'<br />',$body_content);
+ $body_content = str_replace("\n",'<br>',$body_content);
$body_content = trim($body_content);
- $body_content = str_replace(':((','<img src=images/smileys/crying.png border=0>',$body_content);
- $body_content = str_replace(':(','<img src=images/smileys/frown.png border=0>',$body_content);
- $body_content = str_replace(':|','<img src=images/smileys/indifferent.png border=0>',$body_content);
- $body_content = str_replace(':D','<img src=images/smileys/laughing.png border=0>',$body_content);
- $body_content = str_replace(':P','<img src=images/smileys/lick.png border=0>',$body_content);
- $body_content = str_replace(':O','<img src=images/smileys/ohno.png border=0>',$body_content);
- $body_content = str_replace(':)','<img src=images/smileys/smile.png border=0>',$body_content);
- $body_content = str_replace('=)','<img src=images/smileys/surprised.png border=0>',$body_content);
- $body_content = str_replace(':\\','<img src=images/smileys/undecided.png border=0>',$body_content);
- $body_content = str_replace(';)','<img src=images/smileys/wink.png border=0>',$body_content);
-
- $fp_body_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/comment.txt","w");
+ $body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$body_content);
+ $body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$body_content);
+ $body_content = str_replace(':|','<img src="images/smileys/indifferent.png" border="0">',$body_content);
+ $body_content = str_replace(':D','<img src="images/smileys/laughing.png" border="0">',$body_content);
+ $body_content = str_replace(':P','<img src="images/smileys/lick.png" border="0">',$body_content);
+ $body_content = str_replace(':O','<img src="images/smileys/ohno.png" border="0">',$body_content);
+ $body_content = str_replace(':)','<img src="images/smileys/smile.png" border="0">',$body_content);
+ $body_content = str_replace('=)','<img src="images/smileys/surprised.png" border="0">',$body_content);
+ $body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$body_content);
+ $body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$body_content);
+
+ $fp_body_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/comment.txt","w");
fwrite($fp_body_txt,$body_content);
fclose($fp_body_txt);
- $fp_timestamp_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/timestamp.txt","w");
+ $fp_timestamp_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/timestamp.txt","w");
fwrite($fp_timestamp_txt,$timestamp);
fclose($fp_timestamp_txt);
- $fp_firstname_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/firstname.txt","w");
+ $fp_firstname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/firstname.txt","w");
$firstname = strtolower($_POST['firstname']);
$firstname = ucwords($firstname);
$firstname = trim($firstname);
@@ -508,7 +548,7 @@ if (isset($entry) and !empty($entry)) {
fwrite($fp_firstname_txt,$firstname);
fclose($fp_firstname_txt);
- $fp_lastname_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/lastname.txt","w");
+ $fp_lastname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/lastname.txt","w");
$lastname = strtolower($_POST['lastname']);
$lastname = ucwords($lastname);
$lastname = trim($lastname);
@@ -516,7 +556,7 @@ if (isset($entry) and !empty($entry)) {
fwrite($fp_lastname_txt,$lastname);
fclose($fp_lastname_txt);
- $fp_email_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/email.txt","w");
+ $fp_email_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/email.txt","w");
$email = strtolower($_POST['email']);
$email = trim($email);
$email = htmlentities($email,ENT_NOQUOTES);
@@ -524,7 +564,7 @@ if (isset($entry) and !empty($entry)) {
fclose($fp_email_txt);
if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.",$_POST['url']))) {
- $fp_url_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/url.txt","w");
+ $fp_url_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/url.txt","w");
$url = str_replace("http://","",$_POST['url']);
$url = strtolower($url);
$url = trim($url);
@@ -535,13 +575,13 @@ if (isset($entry) and !empty($entry)) {
}
if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $fp_cauthor_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/author.txt","w");
+ $fp_cauthor_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/author.txt","w");
fwrite($fp_cauthor_txt,$_POST['cauthor']);
fclose($fp_cauthor_txt);
}
$key_rand = str_rand(14);
- $fp_key_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/key.txt","w");
+ $fp_key_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/key.txt","w");
fwrite($fp_key_txt,$key_rand);
fclose($fp_key_txt);
@@ -567,14 +607,14 @@ if (isset($entry) and !empty($entry)) {
$mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $commented_entry_title_file = "data/items/$entry/title.txt";
+ $commented_entry_title_file = "data/items/$req_entry/title.txt";
$fp_commented_entry_title = fopen($commented_entry_title_file,"r");
$commented_entry_title = fread($fp_commented_entry_title,filesize($commented_entry_title_file));
fclose($fp_commented_entry_title);
if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
- $comment_thanks = "Hi $firstname,\n\nThanks for submitting the following comment last $timestamp:\n\n\"$comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$sig_url}index.php?entry=$entry&show=comments\n\nThanks again! =)\n\n--\n$sig_author\n$sig_url\n";
+ $comment_thanks = "Hi $firstname,\n\nThanks for submitting the following comment last $timestamp:\n\n\"$comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$sig_url}index.php?entry=$req_entry&show=comments\n\nThanks again! =)\n\n--\n$sig_author\n$sig_url\n";
$comment_thanks = wordwrap($comment_thanks);
mail($email_to,"Thanks for sharing your thoughts!",$comment_thanks,
@@ -585,7 +625,7 @@ if (isset($entry) and !empty($entry)) {
if (file_exists("data/email.txt") and !file_exists("data/xscreen.txt")) {
- $comment_notice = "The following comment was submitted by $email_to last $timestamp for the entry \"$commented_entry_title\":\n\n\"$comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$sig_url}index.php?entry=$entry&comment={$comment_entry_dir}&key={$key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$sig_url}index.php?entry=$entry&comment={$comment_entry_dir}&key={$key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
+ $comment_notice = "The following comment was submitted by $email_to last $timestamp for the entry \"$commented_entry_title\":\n\n\"$comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
$comment_notice = wordwrap($comment_notice);
mail($from_email,"Pending Comment",$comment_notice,
@@ -602,7 +642,7 @@ if (isset($entry) and !empty($entry)) {
mkdir("data/comments/pending");
}
- $pending_comment_flag = $entry;
+ $pending_comment_flag = $req_entry;
if (!file_exists("data/comments/pending/$pending_comment_flag")) {
mkdir("data/comments/pending/$pending_comment_flag");
@@ -625,8 +665,8 @@ if (isset($entry) and !empty($entry)) {
else {
echo "<title>$default_title</title>";
- if (isset($archive) and !empty($archive)) {
- $filter = trim($archive) . "*";
+ if (isset($req_archive) and !empty($req_archive)) {
+ $filter = trim($req_archive) . "*";
}
else {
$filter = "*";
@@ -636,35 +676,33 @@ if (isset($entry) and !empty($entry)) {
else {
echo "<title>$default_title</title>";
- if (isset($archive) and !empty($archive)) {
- $filter = trim($archive) . "*";
+ if (isset($req_archive) and !empty($req_archive)) {
+ $filter = trim($req_archive) . "*";
}
else {
$filter = "*";
}
}
-// start: auto-approve comments without rewriting "comment approval system" (20080521)
-
if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
- if ($dh_xscreen_list = opendir("data/comments/pending")) {
+ if ($dh_xscreen_comments = opendir("data/comments/pending")) {
- while (($entry_xscreen = readdir($dh_xscreen_list)) !== false) {
+ while (($xscreen_comment = readdir($dh_xscreen_comments)) !== false) {
- if ($entry_xscreen != "." && $entry_xscreen != "..") {
- $show_xscreen_list[] = $entry_xscreen;
+ if ($xscreen_comment != "." && $xscreen_comment != "..") {
+ $xscreen_comments[] = $xscreen_comment;
}
}
- closedir($dh_xscreen_list);
+ closedir($dh_xscreen_comments);
}
- rsort($show_xscreen_list);
- reset($show_xscreen_list);
+ rsort($xscreen_comments);
+ reset($xscreen_comments);
- if (count($show_xscreen_list) > 0) {
+ if (count($xscreen_comments) > 0) {
- foreach ($show_xscreen_list as $xscreen_dir) {
+ foreach ($xscreen_comments as $xscreen_dir) {
if ($dh_xscreen_pending = opendir("data/items/$xscreen_dir/comments/pending")) {
@@ -683,30 +721,46 @@ if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
}
}
-// end: auto-approve comments without rewriting "comment approval system" (20080521)
-
?>
<?php
-if (isset($entry) and !empty($entry) and file_exists("data/items/$entry")) {
+if (isset($req_entry) and !empty($req_entry) and file_exists("data/items/$req_entry")) {
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$req_entry/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
+
+ while (($entry_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($entry_category != "." && $entry_category != "..") {
+
+ if (file_exists("data/categories/$entry_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
+ }
- $cat_dir = file_get_contents("data/items/$entry/category.txt");
- if (!file_exists("data/categories/$cat_dir/private.txt")) {
+ if ($private_categories == "0") {
- if (!file_exists("data/items/$entry/passwd.txt")) {
+ if (!file_exists("data/items/$req_entry/passwd.txt")) {
- if (!file_exists("data/items/$entry/private.txt")) {
+ if (!file_exists("data/items/$req_entry/private.txt")) {
- $description = file_get_contents("data/items/$entry/body.txt");
+ $description = file_get_contents("data/items/$req_entry/body.txt");
$description = strip_tags($description);
$description = html_entity_decode($description);
$description = str_replace("&","&",$description);
$description = str_replace("<","<",$description);
$description = str_replace(">",">",$description);
$description = str_replace("<br>"," ",$description);
- $description = str_replace("<br />"," ",$description);
+ $description = str_replace("<br>"," ",$description);
$description = str_replace("\r"," ",$description);
$description = str_replace("\n"," ",$description);
$description = str_replace(chr(10)," ",$description);
@@ -975,14 +1029,14 @@ a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
echo "{$font_panel_footer},";
}
?> arial,helvetica,sans-serif;
- font-size: 11px;
+ font-size: 10px;
color: <?php
if (file_exists("data/colors/pf-font.txt")) {
$panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
echo $panel_footer_font_color;
}
else {
- echo "#666666";
+ echo "#999999";
}
?>;
<?php
@@ -1303,6 +1357,60 @@ a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
?>
}
+#panel_category {
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$font_panel_category},";
+ }
+ ?> arial,helvetica,sans-serif;
+ font-size: 10px;
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $panel_category_font_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?>;
+
+ padding: 5px 5px 5px 5px;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $panel_category_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ margin: 0px 0px 0px 0px;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $panel_category_border_color = file_get_contents("data/colors/border.txt");
+ echo $panel_category_border_color;
+ }
+ else {
+ echo "#cccccc";
+ }
+ ?>;
+ <?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;';
+ }
+ ?>
+ text-align: left;
+}
+
<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
</style>
@@ -1421,7 +1529,7 @@ else {
Navigation</div>
<div id="panel_body">
-<a class="navlink" href="<?php echo $_SERVER['PHP_SELF']; ?>">Home</a><br>
+<a class="navlink" href="index.php">Home</a><br>
<?php
@@ -1440,14 +1548,14 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.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']}/categories/$req_category")) {
+
+ if (!file_exists("data/categories/$req_category")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/categories/$req_category");
}
}
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") or file_exists("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']}/categories/$req_category")) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -1476,35 +1584,52 @@ else {
if (file_exists("data/sticky")) {
- if ($dh_sticky_list = opendir("data/sticky")) {
+ if ($dh_sticky = opendir("data/sticky")) {
- while (($entry_sticky_list = readdir($dh_sticky_list)) !== false) {
+ while (($sticky_entry = readdir($dh_sticky)) !== false) {
- if (file_exists("data/items/$entry_sticky_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$sticky_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
continue;
}
- if (file_exists("data/items/$entry_sticky_list/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$sticky_entry/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
- $get_cat_dir = file_get_contents("data/items/$entry_sticky_list/category.txt");
+ $private_categories = "0";
+
+ if (file_exists("data/items/$sticky_entry/categories")) {
+
+ if ($dh_sticky_categories = opendir("data/items/$sticky_entry/categories")) {
+
+ while (($sticky_category = readdir($dh_sticky_categories)) !== false) {
+
+ if ($sticky_category != "." && $sticky_category != "..") {
+
+ if (file_exists("data/categories/$sticky_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_sticky_categories);
+ }
+ }
- if (file_exists("data/categories/$get_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_sticky_list/cat.txt")) {
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$sticky_entry/cat.txt")) {
continue;
}
- if ($entry_sticky_list != "." && $entry_sticky_list != ".." && fnmatch("*",$entry_sticky_list)) {
- $show_sticky_list[] = $entry_sticky_list;
+ if ($sticky_entry != "." && $sticky_entry != "..") {
+ $sticky_entries[] = $sticky_entry;
}
}
- closedir($dh_sticky_list);
+ closedir($dh_sticky);
}
- sort($show_sticky_list);
- reset($show_sticky_list);
+ sort($sticky_entries);
+ reset($sticky_entries);
- $count_sticky_list = count($show_sticky_list);
+ $count_sticky_list = count($sticky_entries);
if ($count_sticky_list > 0) {
@@ -1518,8 +1643,8 @@ if (file_exists("data/sticky")) {
echo 'Quick Links</div>';
echo '<div id="panel_body">';
- foreach ($show_sticky_list as $sticky_list_entry) {
- echo "<a class=\"navlink\" href=\"{$_SERVER['PHP_SELF']}?entry=$sticky_list_entry\">";
+ foreach ($sticky_entries as $sticky_list_entry) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$sticky_list_entry\">";
readfile("data/items/$sticky_list_entry/title.txt");
echo "</a><br>";
}
@@ -1538,54 +1663,80 @@ if (file_exists("data/sticky")) {
if (file_exists("data/panels")) {
- if ($dh_panel_list = opendir("data/panels")) {
+ if ($dh_panels = opendir("data/panels")) {
- while (($entry_panel_list = readdir($dh_panel_list)) !== false) {
+ while (($panel = readdir($dh_panels)) !== false) {
- if (file_exists("data/panels/$entry_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ if ($panel != "." && $panel != "..") {
- if (file_exists("data/panels/$entry_panel_list/right.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/center.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/top.txt")) {
+ $top_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/top.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/center.txt")) {
+ $center_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/entry.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/entry.txt")) {
+ $entry_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $entry_panel_list)) {
- continue;
- }
+ if (file_exists("data/panels/$panel/right.txt")) {
+ $right_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $entry_panel_list)) {
- continue;
- }
+ if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $panel)) {
+ continue;
+ }
+
+ if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $panel)) {
+ continue;
+ }
- if ($entry_panel_list != "." && $entry_panel_list != ".." && fnmatch("*",$entry_panel_list)) {
- $show_panel_list[] = $entry_panel_list;
+ $left_panels[] = $panel;
}
}
- closedir($dh_panel_list);
+ closedir($dh_panels);
}
- sort($show_panel_list);
- reset($show_panel_list);
- $count_panel_list = count($show_panel_list);
-
- if ($count_panel_list > 0) {
+ sort($left_panels);
+ reset($left_panels);
+
+ $count_left_panels = count($left_panels);
+
+ sort($top_panels);
+ reset($top_panels);
+
+ $count_top_panels = count($top_panels);
+
+ sort($center_panels);
+ reset($center_panels);
+
+ $count_center_panels = count($center_panels);
+
+ sort($entry_panels);
+ reset($entry_panels);
+
+ $count_entry_panels = count($entry_panels);
- foreach ($show_panel_list as $panel_list_entry) {
+ sort($right_panels);
+ reset($right_panels);
- if (!file_exists("data/panels/$panel_list_entry/free.txt")) {
+ $count_right_panels = count($right_panels);
+
+ if ($count_left_panels > 0) {
+
+ foreach ($left_panels as $left_panel) {
+
+ if (!file_exists("data/panels/$left_panel/free.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">';
@@ -1594,29 +1745,29 @@ if (file_exists("data/panels")) {
echo '<div id="panel_title">';
}
- readfile("data/panels/$panel_list_entry/title.txt");
+ readfile("data/panels/$left_panel/title.txt");
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$panel_list_entry}>";
+ echo "<a href=panels.php#{$left_panel}>";
echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
- if (file_exists("data/panels/$panel_list_entry/private.txt")) {
+ if (file_exists("data/panels/$left_panel/private.txt")) {
echo '<img src=images/widget.private.png border=0 width=11 height=11 align=right>';
}
echo '</div><div id=panel_body>';
}
- if (file_exists("data/panels/$panel_list_entry/free.txt")) {
+ if (file_exists("data/panels/$left_panel/free.txt")) {
echo '<div id=panel_free>';
}
- include("data/panels/$panel_list_entry/panel.php");
+ include("data/panels/$left_panel/panel.php");
echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$panel_list_entry/free.txt")) {
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$left_panel/free.txt")) {
echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
}
}
@@ -1629,407 +1780,440 @@ if (file_exists("data/panels")) {
<td valign=top width=<?php if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) { echo "610"; } else { echo "525"; } ?>>
<?php
-if (file_exists("data/panels")) {
-
- if ($dh_top_panel_list = opendir("data/panels")) {
+
+if ($count_top_panels > 0) {
- while (($entry_top_panel_list = readdir($dh_top_panel_list)) !== false) {
+ foreach ($top_panels as $top_panel) {
- if (file_exists("data/panels/$entry_top_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ if (!file_exists("data/panels/$top_panel/free.txt")) {
- if (!file_exists("data/panels/$entry_top_panel_list/top.txt")) {
- continue;
+ 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">';
}
-
- if ($entry_top_panel_list != "." && $entry_top_panel_list != ".." && fnmatch("*",$entry_top_panel_list)) {
- $show_top_panel_list[] = $entry_top_panel_list;
+ else {
+ echo '<div id="panel_title">';
}
- }
- closedir($dh_top_panel_list);
- }
- sort($show_top_panel_list);
- reset($show_top_panel_list);
-
- $count_top_panel_list = count($show_top_panel_list);
-
- if ($count_top_panel_list > 0) {
-
- foreach ($show_top_panel_list as $top_panel_list_entry) {
-
- if (!file_exists("data/panels/$top_panel_list_entry/free.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 id="panel_title">';
- }
-
- readfile("data/panels/$top_panel_list_entry/title.txt");
-
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$top_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
- }
+ readfile("data/panels/$top_panel/title.txt");
- echo '</div><div id=panel_body>';
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+ echo "<a href=panels.php#{$top_panel}>";
+ echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
- if (file_exists("data/panels/$top_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
- }
+ echo '</div><div id=panel_body>';
+ }
- include("data/panels/$top_panel_list_entry/panel.php");
+ if (file_exists("data/panels/$top_panel/free.txt")) {
+ echo '<div id=panel_free>';
+ }
- echo '</div>';
+ include("data/panels/$top_panel/panel.php");
- if (file_exists("data/round.txt") and !file_exists("data/panels/$top_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
+ echo '</div>';
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$top_panel/free.txt")) {
+ echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
}
}
}
+
?>
<?php
-if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($entry) and !isset($category) and !isset($_REQUEST['start']) and !isset($_REQUEST['author']) and !isset($archive) and !isset($_REQUEST['find'])) {
+// clean-up (start)
- if ($dh_latest_post_items = opendir("data/items")) {
+if (file_exists("data/albums")) {
+ rmdirr("data/albums");
+}
- while (($entry_latest_post_items = readdir($dh_latest_post_items)) !== false) {
-
- $today = date("YmdHis",time() + $offset);
-
- if (($entry_latest_post_items > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if (file_exists("data/items/$entry_latest_post_items/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- $cat_dir = file_get_contents("data/items/$entry_latest_post_items/category.txt");
-
- if (file_exists("data/categories/$cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_latest_post_items/cat.txt")) {
- continue;
- }
-
- if ($entry_latest_post_items != "." && $entry_latest_post_items != ".." && fnmatch("*",$entry_latest_post_items)) {
- $show_latest_post_items[] = $entry_latest_post_items;
- }
- }
- closedir($dh_latest_post_items);
- }
+// clean-up (end)
- rsort($show_latest_post_items);
- reset($show_latest_post_items);
+// global entry items (start)
- $count_latest_post_items = count($show_latest_post_items);
+if ($dh_items = opendir("data/items")) {
- if ($count_latest_post_items > 0) {
+ while (($item = readdir($dh_items)) !== false) {
- 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 id="panel_title">';
- }
+ if ($item != "." && $item != "..") {
- echo "Latest Entries</div><div id=panel_body>";
- echo "<table border=0 cellspacing=1 cellpadding=2 bgcolor=#cccccc width=100%>";
- echo "<tr><td bgcolor=#eeeeee align=center><p>topic</p></td><td bgcolor=#eeeeee align=center><p>author</p></td><td bgcolor=#eeeeee align=center><p>views</p></td><td bgcolor=#eeeeee align=center><p>comments</p></td><td bgcolor=#eeeeee align=center><p>last post</p></td></tr>";
+ if (file_exists("data/items/$item/comments/live") and (count(glob("data/items/$item/comments/live/*")) < 1)) {
+ rmdirr("data/items/$item/comments/live");
+ }
- $increment_latest_post_entries = 0;
- $show_latest_post_entries = 5;
+ if (file_exists("data/items/$item/comments/pending") and (count(glob("data/items/$item/comments/pending/*")) < 1)) {
+ rmdirr("data/items/$item/comments/pending");
+ }
- while ($increment_latest_post_entries <= $show_latest_post_entries) {
+ if (file_exists("data/items/$item/comments") and (count(glob("data/items/$item/comments/*")) < 1)) {
+ rmdirr("data/items/$item/comments");
+ }
- echo '<tr><td bgcolor=#ffffff><a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $show_latest_post_items[$increment_latest_post_entries];
+ if (file_exists("data/items/$item/filedrop/files") and (count(glob("data/items/$item/filedrop/files/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop/files");
+ }
- if ($dh_summary_comments = opendir("data/items/$show_latest_post_items[$increment_latest_post_entries]/comments/live")) {
+ if (file_exists("data/items/$item/filedrop/count") and (count(glob("data/items/$item/filedrop/count/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop/count");
+ }
- while (($entry_summary_comments = readdir($dh_summary_comments)) !== false) {
+ if (file_exists("data/items/$item/filedrop") and (count(glob("data/items/$item/filedrop/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop");
+ }
- if ($entry_summary_comments != "." && $entry_summary_comments != ".." && fnmatch("*",$entry_summary_comments)) {
- $items_summary_comments[] = $entry_summary_comments;
- }
- }
- closedir($dh_summary_comments);
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/captions") and (count(glob("data/items/$item/album/captions/*")) < 1)) {
+ rmdirr("data/items/$item/album/captions");
}
- rsort($items_summary_comments);
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/count") and (count(glob("data/items/$item/album/count/*")) < 1)) {
+ rmdirr("data/items/$item/album/count");
+ }
- $summary_comments = count($items_summary_comments);
-
- if ($summary_comments > 0) {
- echo '&show=comments';
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album") and (count(glob("data/items/$item/album/*")) < 1)) {
+ rmdirr("data/items/$item/album");
}
-
- echo '>';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/title.txt");
- echo '</a></td>';
- echo '<td bgcolor=#ffffff><a href=member.php?id=';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/author.txt");
- echo '>';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/author.txt");
- echo '</a></td>';
- echo '<td bgcolor=#ffffff align=right>';
-
- if (!file_exists("data/items/$show_latest_post_items[$increment_latest_post_entries]/views.txt")) {
- echo 0;
+
+ if (file_exists("images/$item/album") and (count(glob("images/$item/album/*")) < 1)) {
+ rmdirr("images/$item/album");
}
- else {
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/views.txt");
+
+ if (file_exists("images/$item") and (count(glob("images/$item/*")) < 1)) {
+ rmdirr("images/$item");
}
-
- echo '</td>';
- if ($summary_comments < 1) {
+ if (file_exists("images/$item/categories") and (count(glob("images/$item/categories/*")) < 1)) {
+ rmdirr("images/$item/categories");
+ }
- $iso_year = substr($show_latest_post_items[$increment_latest_post_entries],0,4);
- $iso_month = substr($show_latest_post_items[$increment_latest_post_entries],4,2);
- $iso_day = substr($show_latest_post_items[$increment_latest_post_entries],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+ $grand[] = $item;
- echo "<td bgcolor=#ffffff align=right><p>0</p></td>";
- echo "<td bgcolor=#ffffff align=right><p>$iso_last</p></td>";
- }
- else {
- $iso_year = substr($items_summary_comments[0],0,4);
- $iso_month = substr($items_summary_comments[0],4,2);
- $iso_day = substr($items_summary_comments[0],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<td bgcolor=#ffffff align=right><p>$summary_comments</p></td>";
- echo "<td bgcolor=#ffffff align=right><p>$iso_last</p></td>";
- }
+ if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
- unset($items_summary_comments);
+ if (isset($req_entry) and file_exists("data/items/$req_entry")) {
+ $items[] = $req_entry;
+ }
- $increment_latest_post_entries = $increment_latest_post_entries + 1;
- }
- }
+ if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
+ $items[] = $item;
+ }
- if ($count_latest_post_items > 0) {
+ if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
+ $items[] = $item;
+ }
- echo "</table></div>";
+ if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
+ $items[] = $item;
+ }
- 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($req_find)) {
-}
+ if ((($req_find == "private") or ($req_find == "member") or ($req_find == "passwd")) and file_exists("data/items/$item/{$req_find}.txt")) {
+ $items[] = $item;
+ }
-?>
+ if ((($req_find == "comments") or ($req_find == "filedrop") or ($req_find == "album")) and file_exists("data/items/$item/$req_find")) {
+ $items[] = $item;
+ }
-<?php
+ if (($req_find == "unfiled") and !file_exists("data/items/$item/categories")) {
+ $items[] = $item;
+ }
+ }
+ }
+ else {
+ $items[] = $item;
+ }
-if (file_exists("data/panels")) {
+ $latest[] = $item;
- if ($dh_center_panel_list = opendir("data/panels")) {
+ if (file_exists("data/items/$item/album")) {
+ $albums[] = $item;
+ }
- while (($entry_center_panel_list = readdir($dh_center_panel_list)) !== false) {
+ $random[] = $item;
- if (file_exists("data/panels/$entry_center_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ $archives[] = substr($item,0,6);
}
+ else {
- if (!file_exists("data/panels/$entry_center_panel_list/center.txt")) {
- continue;
- }
+ // non-admin stuff (start)
- if ($entry_center_panel_list != "." && $entry_center_panel_list != ".." && fnmatch("*",$entry_center_panel_list)) {
- $show_center_panel_list[] = $entry_center_panel_list;
- }
- }
- closedir($dh_center_panel_list);
- }
-
- sort($show_center_panel_list);
- reset($show_center_panel_list);
-
- $count_center_panel_list = count($show_center_panel_list);
+ $today = date("YmdHis",time() + $offset);
- if ($count_center_panel_list > 0) {
+ if ($item > $today) {
+ continue;
+ }
- foreach ($show_center_panel_list as $center_panel_list_entry) {
+ if (file_exists("data/items/$item/private.txt")) {
+ continue;
+ }
- if (!file_exists("data/panels/$center_panel_list_entry/free.txt")) {
+ if (file_exists("data/items/$item/member.txt") and (!isset($_SESSION['logged_in']))) {
+ continue;
+ }
- 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">';
+ $private_categories = "0";
+
+ if (file_exists("data/items/$item/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$item/categories")) {
+
+ while (($item_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($item_category != "." && $item_category != "..") {
+
+ if (file_exists("data/categories/$item_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
}
- else {
- echo '<div id="panel_title">';
+
+ if (($private_categories > 0) and !file_exists("data/items/$item/cat.txt")) {
+ continue;
}
- readfile("data/panels/$center_panel_list_entry/title.txt");
+ $latest[] = $item;
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$center_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+ if (file_exists("data/nocat.txt") and file_exists("data/items/$item/categories") and !file_exists("data/items/$item/cat.txt") and (!isset($req_category) or empty($req_category)) and (!isset($req_entry) or empty($req_entry)) and (!isset($req_author) or empty($req_author))) {
+ continue;
}
- echo '</div><div id=panel_body>';
- }
+ if (file_exists("data/items/$item/album")) {
+ $albums[] = $item;
+ }
- if (file_exists("data/panels/$center_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
- }
+ $random[] = $item;
+ $archives[] = substr($item,0,6);
- include("data/panels/$center_panel_list_entry/panel.php");
+ if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
+
+ if (isset($req_entry) and file_exists("data/items/$req_entry")) {
+ $items[] = $req_entry;
+ }
- echo '</div>';
+ if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
+ $items[] = $item;
+ }
- if (file_exists("data/round.txt") and !file_exists("data/panels/$center_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
+ $items[] = $item;
+ }
+
+ if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
+ $items[] = $item;
+ }
+ }
+ else {
+ $items[] = $item;
+ }
+
+ // non-admin stuff (end)
}
}
}
+ closedir($dh_items);
}
+
+sort($grand);
+reset($grand);
+
+$count_grand = count($grand);
+
+$items = array_unique($items);
+$items = array_values($items);
+
+if (file_exists("data/old.txt")) {
+ sort($items);
+}
+else {
+ rsort($items);
+}
+
+reset($items);
+
+$count_items = count($items);
+
+rsort($latest);
+reset($latest);
+
+$count_latest = count($latest);
+
+rsort($albums);
+reset($albums);
+
+$count_albums = count($albums);
+
+rsort($random);
+reset($random);
+
+$count_random = count($random);
+
+rsort($archives);
+reset($archives);
+
+$count_archives = count($archives);
+
?>
<?php
-if (is_dir("data/items")) {
- if ($dh = opendir("data/items")) {
- while (($entry_main = readdir($dh)) !== false) {
+if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($req_entry) and !isset($req_category) and !isset($_REQUEST['start']) and !isset($req_author) and !isset($req_archive) and !isset($req_find)) {
- if ($entry_main != "." && $entry_main != "..") {
- $grand[] = $entry_main;
- }
+ if ($count_latest > 0) {
- $today = date("YmdHis",time() + $offset);
+ 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 id="panel_title">';
+ }
- if (($entry_main > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ echo "Latest Entries</div><div id=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>";
- if (file_exists("data/items/$entry_main/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ $increment_latest = 0;
+
+ while ($increment_latest <= 4) {
+
+ echo "<tr><td bgcolor=\"#ffffff\"><a href=\"index.php?entry=$latest[$increment_latest]";
+
+ if ($dh_summary_comments = opendir("data/items/$latest[$increment_latest]/comments/live")) {
+
+ while (($change_me_summary_comments = readdir($dh_summary_comments)) !== false) {
+
+ if ($change_me_summary_comments != "." && $change_me_summary_comments != "..") {
+ $items_summary_comments[] = $change_me_summary_comments;
+ }
+ }
+ closedir($dh_summary_comments);
}
- if (file_exists("data/items/$entry_main/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
+ rsort($items_summary_comments);
+
+ $summary_comments = count($items_summary_comments);
+
+ if ($summary_comments > 0) {
+ echo "&show=comments";
}
+
+ echo "\">";
+ readfile("data/items/$latest[$increment_latest]/title.txt");
+ echo "</a></td>";
+
+ echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
+ readfile("data/items/$latest[$increment_latest]/author.txt");
+ echo "\">";
+ readfile("data/items/$latest[$increment_latest]/author.txt");
+ echo "</a></td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">";
+
+ if (!file_exists("data/items/$latest[$increment_latest]/views.txt")) {
+ echo 0;
+ }
+ else {
+ readfile("data/items/$latest[$increment_latest]/views.txt");
+ }
+
+ echo "</td>";
- $cat_dir = file_get_contents("data/items/$entry_main/category.txt");
+ if ($summary_comments < 1) {
- if (file_exists("data/categories/$cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_main/cat.txt")) {
- continue;
+ $iso_year = substr($latest[$increment_latest],0,4);
+ $iso_month = substr($latest[$increment_latest],4,2);
+ $iso_day = substr($latest[$increment_latest],6,2);
+ $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">0</td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
}
+ else {
+ $iso_year = substr($items_summary_comments[0],0,4);
+ $iso_month = substr($items_summary_comments[0],4,2);
+ $iso_day = substr($items_summary_comments[0],6,2);
+ $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
- if (file_exists("data/nocat.txt") and file_exists("data/items/$entry_main/category.txt") and !file_exists("data/items/$entry_main/cat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($category) or empty($category)) and (!isset($entry) or empty($entry)) and (!isset($_REQUEST['author']) or empty($_REQUEST['author']))) {
- continue;
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$summary_comments</td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
}
+
+ unset($items_summary_comments);
- if ($entry_main != "." && $entry_main != ".." && fnmatch($filter,$entry_main)) {
+ $increment_latest = $increment_latest + 1;
+ }
+ }
- if (isset($category) and !empty($category) and file_exists("data/categories/{$category}")) {
+ if ($count_latest > 0) {
- if (file_exists("data/items/$entry_main/category.txt") and (file_get_contents("data/items/$entry_main/category.txt") == "$category")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['author']) and !empty($_REQUEST['author']) and file_exists("data/members/active/{$_REQUEST['author']}") and file_exists("data/bb.txt")) {
+ echo "</table></div>";
- if (file_exists("data/items/$entry_main/author.txt") and (file_get_contents("data/items/$entry_main/author.txt") == $_REQUEST['author'])) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['author']) and !empty($_REQUEST['author']) and !file_exists("data/members/active/{$_REQUEST['author']}") and (file_get_contents("data/username.txt") == $_REQUEST['author']) and file_exists("data/bb.txt")) {
+ 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/items/$entry_main/author.txt") and (file_get_contents("data/items/$entry_main/author.txt") == $_REQUEST['author'])) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "private")) {
- if (file_exists("data/items/$entry_main/private.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
+}
- if (file_exists("data/items/$entry_main/member.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
+?>
- if (file_exists("data/items/$entry_main/passwd.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
- if (!file_exists("data/items/$entry_main/category.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+<?php
- if (count(glob("data/items/$entry_main/comments/live/*")) === 0) {
- rmdir("data/items/$entry_main/comments/live");
- }
+if ($count_center_panels > 0) {
- if (file_exists("data/items/$entry_main/comments/live")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "filedrop")) {
+ foreach ($center_panels as $center_panel) {
- if (count(glob("data/items/$entry_main/filedrop/*")) === 0) {
- rmdir("data/items/$entry_main/filedrop");
- }
+ if (!file_exists("data/panels/$center_panel/free.txt")) {
- if (file_exists("data/items/$entry_main/filedrop")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
+ 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 id="panel_title">';
+ }
- if (file_exists("images/$entry_main/album")) {
- $items[] = $entry_main;
- }
- }
- else {
- $items[] = $entry_main;
- }
+ readfile("data/panels/$center_panel/title.txt");
+
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+ echo "<a href=panels.php#{$center_panel}>";
+ echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
+
+ echo '</div><div id=panel_body>';
}
- closedir($dh);
- }
-}
-if (!file_exists("data/old.txt")) {
- rsort($items);
-}
+ if (file_exists("data/panels/$center_panel/free.txt")) {
+ echo '<div id=panel_free>';
+ }
-if (file_exists("data/old.txt")) {
- sort($items);
+ include("data/panels/$center_panel/panel.php");
+
+ echo '</div>';
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$center_panel/free.txt")) {
+ echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ }
+ }
}
-if (isset($category) and !empty($category)) {
+?>
- $category = str_replace(" ","-",$category);
- $category = strtolower($category);
- $category = strip_tags($category);
+<?php
- if (file_exists("data/categories/$category/book.txt")) {
+if (isset($req_category) and !empty($req_category)) {
+
+ if (file_exists("data/categories/$req_category/book.txt")) {
sort($items);
+ reset($items);
}
}
-reset($items);
-
-sort($grand);
-reset($grand);
-
-if (count($items) == 0) {
+if ($count_items == 0) {
echo '<table border=0 cellspacing=0 cellpadding=0 bgcolor=#cccccc style="background-color: transparent;"><tr><td width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2050,7 +2234,7 @@ if (count($items) == 0) {
echo "Oops!</div><div id=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 ((count($grand) == 0) and (count($_GET) == 0)) {
+ if (($count_grand == 0) and (count($_GET) == 0)) {
echo "No entries found. Perhaps this is a fresh install.";
}
else {
@@ -2077,100 +2261,74 @@ if (!isset($_REQUEST['start']) or empty($_REQUEST['start'])) {
$start = 0;
}
-$end=$start+$increase;
+$end = $start + $increase;
-$disp=array_slice($items,$start,$increase);
+$disp = array_slice($items,$start,$increase);
foreach ($disp as $d) {
- if (file_exists("data/items/$d/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("data/items/$d/category.txt");
- if (!file_exists($category_check)) {
- unlink("data/items/$d/category.txt");
- }
- }
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"";
- if (file_exists("data/items/$d/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if (file_exists("data/items/$d/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
-
- echo '<table border=0 cellspacing=0 cellpadding=0 bgcolor=#cccccc style="background-color: transparent;"><tr><td width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
echo "610";
}
else {
echo "525";
}
- echo '>';
+ echo "\">";
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">';
+ 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 id="panel_title">';
+ echo "<div id=\"panel_title\">";
}
readfile("data/items/$d/title.txt");
- // start of wiki mod (20071130)
-
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$d/edit.txt") or (file_get_contents("data/items/$d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and !file_exists("data/items/$d/passwd.txt")) {
if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=wiki.php?entry=$d>";
- echo "<img src=images/widget.back.png border=0 width=11 height=11 align=right alt=revisions>";
+ echo "<a href=\"wiki.php?entry=$d\">";
+ echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
echo "</a>";
}
-
- echo '<a href=edit.php?entry=';
- echo $d;
- echo '><img src=images/widget.edit.png border=0 width=11 height=11 align=right alt="edit entry"></a>';
+ echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
}
- // end of wiki mod (20071130)
-
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $d;
- echo '><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete entry"></a>';
+ echo "<a href=\"del.php?entry=$d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("data/items/$d/private.txt") and !file_exists("data/items/$d/category.txt") and file_exists("data/bb.txt") and (count(glob("data/items/$d/comments/live/*")) === 0) and (count(glob("data/items/$d/comments/pending/*")) === 0)) {
- echo '<a href=move.php?entry=';
- echo $d;
- echo '><img src=images/widget.move.png border=0 width=11 height=11 align=right alt="move to comment"></a>';
+ if (!file_exists("data/items/$d/private.txt") and !file_exists("data/items/$d/categories") and file_exists("data/bb.txt") and (count(glob("data/items/$d/comments/live/*")) === 0) and (count(glob("data/items/$d/comments/pending/*")) === 0)) {
+ echo "<a href=\"move.php?entry=$d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
}
-
if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=wiki.php?entry=$d>";
- echo "<img src=images/widget.back.png border=0 width=11 height=11 align=right alt=revisions>";
- echo "</a>";
+ echo "<a href=\"wiki.php?entry=$d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
}
- echo '<a href=edit.php?entry=';
- echo $d;
- echo '><img src=images/widget.edit.png border=0 width=11 height=11 align=right alt="edit entry"></a>';
+ echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
+
if (file_exists("data/items/$d/passwd.txt")) {
- echo '<img src=images/widget.protected.png border=0 width=11 height=11 align=right alt="protected entry">';
+ echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
}
if (file_exists("data/items/$d/private.txt")) {
- echo '<img src=images/widget.private.png border=0 width=11 height=11 align=right alt="private entry">';
+ echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
}
+
if (file_exists("data/items/$d/member.txt")) {
- echo '<img src=images/widget.member.png border=0 width=11 height=11 align=right alt="member-only entry">';
+ echo "<img src=\"images/widget.member.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"members-only entry\">";
}
+
if (file_exists("data/items/$d/cat.txt")) {
- echo '<img src=images/widget.cat.png border=0 width=11 height=11 align=right alt="always display">';
+ echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
}
- if (file_exists("data/items/$d/category.txt")) {
- $read_cat_dir = file_get_contents("data/items/$d/category.txt");
+ if (file_exists("data/items/$d/categories/$req_category")) {
+
+ $read_cat_dir = file_get_contents("data/items/$d/categories/$req_category");
if (file_exists("data/categories/$read_cat_dir/private.txt")) {
echo '<img src=images/widget.hidden.png border=0 width=11 height=11 align=right alt="category hidden">';
@@ -2185,20 +2343,26 @@ foreach ($disp as $d) {
}
echo '<img src=images/widget.filed.png border=0 width=11 height=11 align=right alt="filed under ';
- readfile("data/items/$d/category.txt");
+ readfile("data/items/$d/categories/$req_category");
echo '">';
}
}
- echo '</div><div id=panel_entry_body><table border=0 cellspacing=0 cellpadding=0><tr>';
+ echo "</div><div id=\"panel_entry_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/author.txt")) {
- echo "<td width=85 valign=top><p>";
+
+ echo "<td width=\"85\" valign=\"top\">";
+
$author = file_get_contents("data/items/$d/author.txt");
- echo "<a href=member.php?id=$author>";
+
+ echo "<a href=\"member.php?id=$author\">";
+
if ((file_get_contents("data/username.txt") == $author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
if (file_exists("images/avatar.gif")) {
+
$avatar_gif_image_size = getimagesize("images/avatar.gif");
$avatar_gif_image_width = $avatar_gif_image_size[0];
$avatar_gif_image_height = $avatar_gif_image_size[1];
@@ -2210,13 +2374,11 @@ foreach ($disp as $d) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
}
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $avatar_gif_image_width;
- echo " height=";
- echo $avatar_gif_image_height;
+ echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
}
+
if (file_exists("images/avatar.jpg")) {
+
$avatar_jpg_image_size = getimagesize("images/avatar.jpg");
$avatar_jpg_image_width = $avatar_jpg_image_size[0];
$avatar_jpg_image_height = $avatar_jpg_image_size[1];
@@ -2228,13 +2390,11 @@ foreach ($disp as $d) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
}
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $avatar_jpg_image_width;
- echo " height=";
- echo $avatar_jpg_image_height;
+ echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
}
+
if (file_exists("images/avatar.png")) {
+
$avatar_png_image_size = getimagesize("images/avatar.png");
$avatar_png_image_width = $avatar_png_image_size[0];
$avatar_png_image_height = $avatar_png_image_size[1];
@@ -2247,15 +2407,14 @@ foreach ($disp as $d) {
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
}
- echo "<img src=images/avatar.png border=0 width=";
- echo $avatar_png_image_width;
- echo " height=";
- echo $avatar_png_image_height;
+ echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
}
- echo "><br>";
+ echo "<br>";
}
elseif (file_exists("images/members/$author/avatar.jpg") or file_exists("images/members/$author/avatar.gif") or file_exists("images/members/$author/avatar.png")) {
+
if (file_exists("images/members/$author/avatar.gif")) {
+
$avatar_gif_image_size = getimagesize("images/members/$author/avatar.gif");
$avatar_gif_image_width = $avatar_gif_image_size[0];
$avatar_gif_image_height = $avatar_gif_image_size[1];
@@ -2267,13 +2426,11 @@ foreach ($disp as $d) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
}
-
- echo "<img src=images/members/$author/avatar.gif border=0 width=";
- echo $avatar_gif_image_width;
- echo " height=";
- echo $avatar_gif_image_height;
+ echo "<img src=\"images/members/$author/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
}
+
if (file_exists("images/members/$author/avatar.jpg")) {
+
$avatar_jpg_image_size = getimagesize("images/members/$author/avatar.jpg");
$avatar_jpg_image_width = $avatar_jpg_image_size[0];
$avatar_jpg_image_height = $avatar_jpg_image_size[1];
@@ -2285,13 +2442,11 @@ foreach ($disp as $d) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
}
-
- echo "<img src=images/members/$author/avatar.jpg border=0 width=";
- echo $avatar_jpg_image_width;
- echo " height=";
- echo $avatar_jpg_image_height;
+ echo "<img src=\"images/members/$author/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
}
+
if (file_exists("images/members/$author/avatar.png")) {
+
$avatar_png_image_size = getimagesize("images/members/$author/avatar.png");
$avatar_png_image_width = $avatar_png_image_size[0];
$avatar_png_image_height = $avatar_png_image_size[1];
@@ -2304,14 +2459,13 @@ foreach ($disp as $d) {
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
}
- echo "<img src=images/members/$author/avatar.png border=0 width=";
- echo $avatar_png_image_width;
- echo " height=";
- echo $avatar_png_image_height;
+ echo "<img src=\"images/members/$author/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
}
- echo "><br>";
+ echo "<br>";
}
+
echo "<b>$author</b></a><br>";
+
if ((file_get_contents("data/username.txt") == $author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
@@ -2323,50 +2477,69 @@ foreach ($disp as $d) {
echo "member<br>";
}
- if ($dh_posts = opendir("data/items")) {
- while (($entry_posts = readdir($dh_posts)) !== false) {
+ if ($dh_author_posts = opendir("data/items")) {
- if (file_exists("data/items/$entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ while (($author_post = readdir($dh_author_posts)) !== false) {
- // hide_member (20070606)
- //if (file_exists("data/items/$entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- // continue;
- //}
+ if ($author_post != "." && $author_post != "..") {
- $post_cat_dir = file_get_contents("data/items/$entry_posts/category.txt");
+ if (file_exists("data/items/$author_post/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
- if (file_exists("data/categories/$post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_posts/cat.txt")) {
- continue;
- }
+ $private_categories = "0";
+
+ if (file_exists("data/items/$author_post/categories")) {
+
+ if ($dh_entry_categories_posts = opendir("data/items/$author_post/categories")) {
+
+ while (($entry_category_posts = readdir($dh_entry_categories_posts)) !== false) {
+
+ if ($entry_category_posts != "." && $entry_category_posts != "..") {
+
+ if (file_exists("data/categories/$entry_category_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories_posts);
+ }
+ }
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$author_post/cat.txt")) {
+ continue;
+ }
- if ($entry_posts != "." && $entry_posts != ".." && fnmatch("*",$entry_posts)) {
if (file_exists("data/members/active/$author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$entry_posts/author.txt") and (file_get_contents("data/items/$entry_posts/author.txt") == $author)) {
- $items_posts[] = $entry_posts;
+
+ if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
+ $items_posts[] = $author_post;
}
}
elseif (!file_exists("data/members/active/$author") and (file_get_contents("data/username.txt") == $author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$entry_posts/author.txt") and (file_get_contents("data/items/$entry_posts/author.txt") == $author)) {
- $items_posts[] = $entry_posts;
+
+ if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
+ $items_posts[] = $author_post;
}
}
}
}
- closedir($dh_posts);
+ closedir($dh_author_posts);
}
+
$posts = count($items_posts);
+
if ($posts == 1) {
echo "$posts post";
}
+
if ($posts > 1) {
echo "$posts posts";
}
- unset($items_posts);
- echo "</p></td><td width=513 valign=top>";
+ unset($items_posts);
+ echo "</td><td width=513 valign=top>";
}
else {
echo "<td width=598 valign=top>";
@@ -2382,54 +2555,47 @@ foreach ($disp as $d) {
$crypt_passwd = crypt($crypt_passwd,$crypt_passwd);
}
- echo '<font style="font-size: 10px; color: #999999;">';
+ echo "<font style=\"font-size: 10px; color: #999999;\">";
+
if ((file_exists("data/items/$d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
$xavatar_author = file_get_contents("data/items/$d/author.txt");
- echo "<a href=member.php?id=$xavatar_author>$xavatar_author</a> - ";
+ echo "$xavatar_author - ";
}
+
readfile("data/items/$d/date.txt");
+
if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) or file_exists("data/items/$d/lastmod.txt")) {
+
if (file_exists("data/items/$d/revisions.txt")) {
- echo ' (Revision ';
+ echo " (Revision ";
readfile("data/items/$d/revisions.txt");
echo " - ";
- echo date("l,M j,Y,g:i A",filemtime("data/items/$d/body.txt"));
- echo ')';
+ echo date("l, M j, Y, g:i A",filemtime("data/items/$d/body.txt"));
+ echo ")";
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("data/items/$d/category.txt")) {
- echo ' Filed under ';
- $category_key = file_get_contents("data/items/$d/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
- }
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><font style=\"font-size: 5px;\"><br><br></font>";
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d>here</a> to enter it.";
+ echo "This entry is password protected. If you know the magic word,click <a href=\"passwd.php?entry=$d\">here</a> to enter it.";
}
else {
- $entry_body = file_get_contents("data/items/$d/body.txt");
+ $change_me_body = file_get_contents("data/items/$d/body.txt");
+
if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
+
$badwords = file_get_contents("data/pf-badwords.txt");
+
if (file_exists("data/pf-censor.txt")) {
$censor = file_get_contents("data/pf-censor.txt");
}
else {
$censor = "[expletive]";
}
- $entry_body = preg_replace("/\b($badwords)\b/i",$censor,$entry_body);
+ $change_me_body = preg_replace("/\b($badwords)\b/i",$censor,$change_me_body);
}
- echo $entry_body;
+ echo $change_me_body;
}
if ((file_get_contents("data/username.txt") == $author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
@@ -2441,285 +2607,312 @@ foreach ($disp as $d) {
echo "<br><br>--<br>$sig";
}
- echo '</td></tr></table>';
+ echo "</td></tr></table>";
if (file_exists("data/round.txt")) {
- echo "<div class=rbspace></div>";
- }
-
- echo '</div><div id=panel_footer>';
- echo '<font style="font-size: 10px; color: ';
- if (file_exists("data/colors/pf-font.txt")) {
- readfile("data/colors/pf-font.txt");
- }
- else {
- echo "#999999";
+ echo "<div class=\"rbspace\"></div>";
}
- echo ';">';
-if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ echo "</div>";
- if (!file_exists("data/items/$d/comments/live")) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>add comment</a>';
- }
- else {
- if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*",$entry_comments)) {
- $items_comments[] = $entry_comments;
+ if (file_exists("data/items/$d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+
+ if ($dh_entry_categories = opendir("data/items/$d/categories")) {
+
+ while (($change_me_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($change_me_category != "." && $change_me_category != "..") {
+ $change_me_categories[] = $change_me_category;
}
}
- closedir($dh_comments);
+ closedir($dh_entry_categories);
}
- $comments = count($items_comments);
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>';
- if ($comments == 1) {
- echo $comments . ' comment';
+
+ sort($change_me_categories);
+ reset($change_me_categories);
+
+ if (count($change_me_categories) > 0) {
+
+ if (count($change_me_categories) > 1) {
+ $category_list = "categories";
+ }
+ else {
+ $category_list = "category";
+ }
+
+ foreach ($change_me_categories as $filed_under) {
+ $category_list = $category_list . " | <a href=\"index.php?category=$filed_under\">$filed_under</a>";
+ }
+
+ echo "<div id=\"panel_category\">$category_list</div>";
}
- elseif ($comments < 1) {
- echo 'add comment';
+ unset($change_me_categories);
+ }
+
+ echo "<div id=\"panel_footer\">";
+
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+
+ if (!file_exists("data/items/$d/comments/live")) {
+ echo "<a href=\"index.php?entry=$d&show=comments\">add comment</a>";
}
else {
- echo $comments . ' comments';
+ if ($dh_comments = opendir("data/items/$d/comments/live")) {
+
+ while (($live_comment = readdir($dh_comments)) !== false) {
+
+ if ($live_comment != "." && $live_comment != "..") {
+ $live_comments[] = $live_comment;
+ }
+ }
+ closedir($dh_comments);
+ }
+
+ $count_live_comments = count($live_comments);
+
+ echo "<a href=\"index.php?entry=$d&show=comments\">";
+
+ if ($count_live_comments == 1) {
+ echo "$count_live_comments comment";
+ }
+ elseif ($count_live_comments < 1) {
+ echo "add comment";
+ }
+ else {
+ echo "$count_live_comments comments";
+ }
+ echo "</a>";
+
+ unset($live_comments);
}
- echo '</a>';
- unset($items_comments);
}
-
-}
-else {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a>';
-}
+ else {
+ echo "<a href=\"index.php?entry=$d\">permalink</a>";
+ }
if (file_exists("data/items/$d/views.txt")) {
- $fp_views_txt = fopen("data/items/$d/views.txt","r");
- $views_value = fread($fp_views_txt,filesize("data/items/$d/views.txt"));
- fclose($fp_views_txt);
+
+ $views_value = file_get_contents("data/items/$d/views.txt");
+
if ($views_value == 1) {
- echo ' ( ' . $views_value . ' view ) ';
+ echo " ( $views_value view ) ";
}
elseif ($views_value > 1) {
- echo ' ( ' . $views_value . ' views ) ';
+ echo " ( $views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
}
if (!file_exists("images/$d/album")) {
- echo ' ';
+ echo " ";
}
else {
if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != ".." && fnmatch("*",$entry_album)) {
- $items_album[] = $entry_album;
+
+ while (($change_me_album = readdir($dh_album)) !== false) {
+
+ if ($change_me_album != "." && $change_me_album != "..") {
+ $items_album[] = $change_me_album;
}
}
- closedir($dh_album);
+ closedir($dh_album);
}
+
$album = count($items_album);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=album>';
+
+ echo " | <a href=\"index.php?entry=$d&show=album\">";
+
if ($album == 1) {
- echo $album . ' image';
+ echo "$album image";
}
elseif ($album < 1) {
- echo 'album';
+ echo "album";
}
else {
- echo $album . ' images';
+ echo "$album images";
}
- echo '</a>';
+
+ echo "</a>";
+
unset($items_album);
}
- if (file_exists("images/$d/album") and isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == album)) {
+ if (file_exists("images/$d/album") and isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album)) {
+
if (!file_exists("data/items/$d/album")) {
mkdir("data/items/$d/album");
}
+
if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $fp_album_views_txt = fopen("data/items/$d/album/views.txt","r");
- $album_views_value = fread($fp_album_views_txt,filesize("data/items/$d/album/views.txt"));
- fclose($fp_album_views_txt);
+
+ $album_views_value = file_get_contents("data/items/$d/album/views.txt");
+
$album_views_value = $album_views_value + 1;
+
$fp_album_views_txt = fopen("data/items/$d/album/views.txt","w");
fwrite($fp_album_views_txt,$album_views_value);
fclose($fp_album_views_txt);
}
}
- $fp_album_views_txt = fopen("data/items/$d/album/views.txt","r");
- $album_views_value = fread($fp_album_views_txt,filesize("data/items/$d/album/views.txt"));
- fclose($fp_album_views_txt);
+
+ $album_views_value = file_get_contents("data/items/$d/album/views.txt");
+
if ($album_views_value == 1) {
- echo ' ( ' . $album_views_value . ' view ) ';
+ echo " ( $album_views_value view ) ";
}
elseif ($album_views_value > 1) {
- echo ' ( ' . $album_views_value . ' views ) ';
+ echo " ( $album_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
if (!file_exists("data/items/$d/filedrop/files")) {
- echo ' ';
+ echo " ";
}
else {
if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
+
while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+
+ if ($dl_file != "." && $dl_file != "..") {
$items_filedrop[] = $dl_file;
}
}
- closedir($dh_filedrop);
+ closedir($dh_filedrop);
}
+
$filedrop = count($items_filedrop);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=filedrop>';
+
+ echo " | <a href=\"index.php?entry=$d&show=filedrop\">";
+
if ($filedrop == 1) {
- echo $filedrop . ' file';
+ echo "$filedrop file";
}
elseif ($filedrop < 1) {
- echo 'filedrop';
+ echo "filedrop";
}
else {
- echo $filedrop . ' files';
+ echo "$filedrop files";
}
- echo '</a> ';
+
+ echo "</a> ";
+
unset($items_filedrop);
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == filedrop)) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop)) {
+
if (!file_exists("data/items/$d/filedrop")) {
mkdir("data/items/$d/filedrop");
}
+
if (file_exists("data/items/$d/filedrop/files") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","r");
- $filedrop_views_value = fread($fp_filedrop_views_txt,filesize("data/items/$d/filedrop/views.txt"));
- fclose($fp_filedrop_views_txt);
+
+ $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
+
$filedrop_views_value = $filedrop_views_value + 1;
+
$fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","w");
fwrite($fp_filedrop_views_txt,$filedrop_views_value);
fclose($fp_filedrop_views_txt);
}
}
- $fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","r");
- $filedrop_views_value = fread($fp_filedrop_views_txt,filesize("data/items/$d/filedrop/views.txt"));
- fclose($fp_filedrop_views_txt);
+
+ $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
+
if ($filedrop_views_value == 1) {
- echo ' ( ' . $filedrop_views_value . ' view ) ';
+ echo " ( $filedrop_views_value view ) ";
}
elseif ($filedrop_views_value > 1) {
- echo ' ( ' . $filedrop_views_value . ' views ) ';
+ echo " ( $filedrop_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
if (!file_exists("data/nopdf.txt") and file_exists("data/items/$d/pdf/file")) {
- echo "| <a href={$_SERVER['PHP_SELF']}?entry=$d&show=pdf>pdf</a> ";
+ echo "| <a href=\"index.php?entry=$d&show=pdf\">pdf</a> ";
if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
+
$pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
+
$pdf_views_value = $pdf_views_value + 1;
+
$fp_pdf_views_txt = fopen("data/items/$d/pdf/count/views.txt","w");
fwrite($fp_pdf_views_txt,$pdf_views_value);
fclose($fp_pdf_views_txt);
}
$pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
+
if ($pdf_views_value == 1) {
- echo ' ( ' . $pdf_views_value . ' view ) ';
+ echo " ( $pdf_views_value view ) ";
}
elseif ($pdf_views_value > 1) {
- echo ' ( ' . $pdf_views_value . ' views ) ';
+ echo " ( $pdf_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
}
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo '| <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a></font>';
+ echo "| <a href=\"index.php?entry=$d\">permalink</a>";
}
- echo '</div>';
+ echo "</div>";
if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4e"></b><b class="rb3e"></b><b class="rb2e"></b><b class="rb1e"></b></b>';
+ echo "<b class=\"rbbottom\"><b class=\"rb4e\"></b><b class=\"rb3e\"></b><b class=\"rb2e\"></b><b class=\"rb1e\"></b></b>";
}
- echo '</td></tr></table>';
-
-// entry panel
-
-unset($show_per_entry_panel_list);
-
-if (file_exists("data/panels")) {
- if ($dh_per_entry_panel_list = opendir("data/panels")) {
- while (($entry_per_entry_panel_list = readdir($dh_per_entry_panel_list)) !== false) {
-
- if (file_exists("data/panels/$entry_per_entry_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ echo "</td></tr></table>";
- if (!file_exists("data/panels/$entry_per_entry_panel_list/entry.txt")) {
- continue;
- }
+ if ($count_entry_panels > 0) {
- if ($entry_per_entry_panel_list != "." && $entry_per_entry_panel_list != ".." && fnmatch("*",$entry_per_entry_panel_list)) {
- $show_per_entry_panel_list[] = $entry_per_entry_panel_list;
- }
- }
- closedir($dh_per_entry_panel_list);
- }
+ foreach ($entry_panels as $entry_panel) {
- sort($show_per_entry_panel_list);
- reset($show_per_entry_panel_list);
- $count_per_entry_panel_list = count($show_per_entry_panel_list);
+ if (!file_exists("data/panels/$entry_panel/free.txt")) {
- if ($count_per_entry_panel_list > 0) {
- foreach ($show_per_entry_panel_list as $per_entry_panel_list_entry) {
- if (!file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
-
if (file_exists("data/round.txt")) {
- echo '<b class="rbper_entry"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
+ echo "<b class=\"rbper_entry\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
}
else {
- echo '<div id="panel_title">';
+ echo "<div id=\"panel_title\">";
}
-
- readfile("data/panels/$per_entry_panel_list_entry/title.txt");
-
+
+ readfile("data/panels/$entry_panel/title.txt");
+
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$per_entry_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+ echo "<a href=\"panels.php#$entry_panel\">";
+ echo "<img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\"></a>";
}
-
- echo '</div><div id=panel_body>';
+
+ echo "</div><div id=panel_body>";
}
-
- if (file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
+
+ if (file_exists("data/panels/$entry_panel/free.txt")) {
+ echo "<div id=\"panel_free\">";
}
+
+ include("data/panels/$entry_panel/panel.php");
- include("data/panels/$per_entry_panel_list_entry/panel.php");
- echo '</div>';
-
- if (file_exists("data/round.txt") and !file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ echo "</div>";
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$entry_panel/free.txt")) {
+ echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
}
}
}
-}
-
-// entry panel
-
-
-
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == album) and file_exists("images/$d/album")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album) and file_exists("images/$d/album")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2750,13 +2943,10 @@ if (file_exists("data/panels")) {
echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=album>here</a> to enter it.";
}
else {
-
- /* thumbnail auto-clean-up (20060409) - This should delete thumbnails of non-existent album images. */
-
if (file_exists("images/$d/thumbnails")) {
if ($dh_album = opendir("images/$d/thumbnails")) {
while (($thumbnail_album = readdir($dh_album)) !== false) {
- if ($thumbnail_album != "." && $thumbnail_album != ".." && fnmatch("*",$thumbnail_album)) {
+ if ($thumbnail_album != "." && $thumbnail_album != "..") {
$current_thumbnail = "images/$d/thumbnails/$thumbnail_album";
$parent_image = str_replace("-thumbnail.jpg","",$thumbnail_album);
$parent_image = "images/$d/album/$parent_image";
@@ -2768,12 +2958,10 @@ if (file_exists("data/panels")) {
}
}
- /* caption auto-clean-up (20070216) This should delete captions of non-existent album images. */
-
if (file_exists("data/items/$d/album/captions")) {
if ($dh_album = opendir("data/items/$d/album/captions")) {
while (($caption_album = readdir($dh_album)) !== false) {
- if ($caption_album != "." && $caption_album != ".." && fnmatch("*",$caption_album)) {
+ if ($caption_album != "." && $caption_album != "..") {
$current_caption = "data/items/$d/album/captions/$caption_album";
$parent_image = str_replace(".txt","",$caption_album);
$parent_image = "images/$d/album/$parent_image";
@@ -2785,13 +2973,11 @@ if (file_exists("data/panels")) {
}
}
- /* auto-sort entries (20060409) - MAJ previously relied on readdir() alone,causing entries to be displayed in the order in which they are stored by the filesystem. */
-
if (file_exists("images/$d/album")) {
if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != ".." && fnmatch("*",$entry_album)) {
- $sort_album[] = $entry_album;
+ while (($change_me_album = readdir($dh_album)) !== false) {
+ if ($change_me_album != "." && $change_me_album != "..") {
+ $sort_album[] = $change_me_album;
}
}
closedir($dh_album);
@@ -2830,8 +3016,6 @@ if (file_exists("data/panels")) {
$new_width = $current_width;
$new_height = $current_height;
}
-
- /* auto-thumbnails (20060213) - In maj-0.14-20060131,album thumbnails were simply the original images displayed with smaller "width=" and "height=" values. Album index loading was painfully slow since the browser had to download the original images from the server. This should speed things up. We placed the "function" here instead of edit.php or add.php to make auto-thumbnail generation available for maj-0.14-20060131 users who may already have existing albums. */
if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
@@ -2863,8 +3047,6 @@ if (file_exists("data/panels")) {
echo "<a href=\"album.php?entry=$d&show=$album_entry\">";
- /* auto-thumbnails (20060519) - Just in case php-gd does not exist,do it the old way. */
-
if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
echo "<img src=\"images/$d/album/$album_entry\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
}
@@ -2894,7 +3076,7 @@ if (file_exists("data/panels")) {
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == filedrop) and file_exists("data/items/$d/filedrop/files")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop) and file_exists("data/items/$d/filedrop/files")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2927,7 +3109,7 @@ if (file_exists("data/panels")) {
if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+ if ($dl_file != "." && $dl_file != "..") {
$filedrop_files[] = $dl_file;
}
}
@@ -2940,23 +3122,23 @@ if (file_exists("data/panels")) {
foreach ($filedrop_files as $filedrop_file) {
echo "<table border=0 cellspacing=0 cellpadding=4><tr><td>";
- echo "<a href=\"{$_SERVER['PHP_SELF']}?entry=$d&download=$filedrop_file&type=filedrop\">";
+ echo "<a href=\"index.php?entry=$d&download=$filedrop_file&type=filedrop\">";
echo "<img src=images/filedrop.png width=36 height=36 border=0 alt=\"download file\"></a></td>";
- echo "<td><p><b>$filedrop_file</b>";
+ echo "<td><b>$filedrop_file</b>";
if (file_exists("data/items/$d/filedrop/sha1.txt")) {
$sha1 = sha1_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br />$sha1 (<a href=http://www.faqs.org/rfcs/rfc3174 target=_maj>sha1</a>)";
+ echo "<br>$sha1 (<a href=\"http://www.faqs.org/rfcs/rfc3174\" target=\"_maj\">sha1</a>)";
}
if (file_exists("data/items/$d/filedrop/md5.txt")) {
$md5 = md5_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br />$md5 (<a href=http://www.faqs.org/rfcs/rfc1321 target=_maj>md5</a>)";
+ echo "<br>$md5 (<a href=\"http://www.faqs.org/rfcs/rfc1321\" target=\"_maj\">md5</a>)";
}
$size = filesize("data/items/$d/filedrop/files/$filedrop_file");
$size_string = ($size > 512)?( ($size/1024 > 512) ?sprintf("%.02f MB",($size/1024)/1024) :sprintf("%.02f KB",$size/1024)) :sprintf("%d B",$size);
- echo "<br />$size_string";
+ echo "<br>$size_string";
$filedrop_count_file = "data/items/$d/filedrop/count/$filedrop_file" . '.txt';
@@ -2973,7 +3155,7 @@ if (file_exists("data/panels")) {
echo " downloads";
}
}
- echo "</p></td></tr></table>";
+ echo "</td></tr></table>";
}
}
echo "</div>";
@@ -2985,7 +3167,7 @@ if (file_exists("data/panels")) {
echo '</td></tr></table>';
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == pdf) and file_exists("data/items/$d/pdf/file")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == pdf) and file_exists("data/items/$d/pdf/file")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -3019,11 +3201,11 @@ if (file_exists("data/panels")) {
if ($dh_pdf = opendir("data/items/$d/pdf/file")) {
while (($dl_file = readdir($dh_pdf)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+ if ($dl_file != "." && $dl_file != "..") {
echo '<table border=0 cellspacing=0 cellpadding=4><tr><td>';
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&download=' . $dl_file. '&type=pdf>';
+ echo "<a href=\"index.php?entry=$d&download=$dl_file&type=pdf\">";
echo '<img src=images/pdf.png width=36 height=36 border=0 alt="download file"></a></td>';
- echo '<td><p><b>';
+ echo '<td><b>';
echo $dl_file;
echo'</b><br>';
$size = filesize("data/items/$d/pdf/file/$dl_file");
@@ -3043,7 +3225,7 @@ if (file_exists("data/panels")) {
echo ' downloads';
}
}
- echo '</p></td></tr></table>';
+ echo '</td></tr></table>';
}
}
closedir($dh_pdf);
@@ -3058,7 +3240,7 @@ if (file_exists("data/panels")) {
echo '</td></tr></table>';
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
}
@@ -3074,9 +3256,9 @@ if (file_exists("data/panels")) {
echo '><tr><td>';
if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*",$entry_comments)) {
- $show_comments[] = $entry_comments;
+ while (($live_comment = readdir($dh_comments)) !== false) {
+ if ($live_comment != "." && $live_comment != "..") {
+ $show_comments[] = $live_comment;
}
}
closedir($dh_comments);
@@ -3121,7 +3303,7 @@ if (file_exists("data/panels")) {
echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/live/$comment/author.txt")) {
- echo "<td width=85 valign=top><p>";
+ echo "<td width=85 valign=top>";
$c_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
echo "<a href=member.php?id=$c_author>";
if ((file_get_contents("data/username.txt") == $c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
@@ -3260,14 +3442,31 @@ if (file_exists("data/panels")) {
if (file_exists("data/items/$c_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
-
- $c_post_cat_dir = file_get_contents("data/items/$c_entry_posts/category.txt");
-
- if (file_exists("data/categories/$c_post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$c_entry_posts/cat.txt")) {
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$change_me_c_entry_posts/categories")) {
+
+ if ($dh_cat2_c_entry_posts = opendir("data/items/$change_me_c_entry_posts/categories")) {
+
+ while (($change_me_cat2_c_entry_posts = readdir($dh_cat2_c_entry_posts)) !== false) {
+
+ if ($change_me_cat2_c_entry_posts != "." && $change_me_cat2_c_entry_posts != "..") {
+
+ if (file_exists("data/categories/$change_me_cat2_c_entry_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_cat2_c_entry_posts);
+ }
+ }
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$c_entry_posts/cat.txt")) {
continue;
}
- if ($c_entry_posts != "." && $c_entry_posts != ".." && fnmatch("*",$c_entry_posts)) {
+ if ($c_entry_posts != "." && $c_entry_posts != "..") {
if (file_exists("data/members/active/$c_author") and file_exists("data/bb.txt")) {
if (file_exists("data/items/$c_entry_posts/author.txt") and (file_get_contents("data/items/$c_entry_posts/author.txt") == $c_author)) {
$c_items_posts[] = $c_entry_posts;
@@ -3291,13 +3490,13 @@ if (file_exists("data/panels")) {
}
unset($c_items_posts);
- echo "</p></td><td width=513 valign=top>";
+ echo "</td><td width=513 valign=top>";
}
else {
echo "<td width=598 valign=top>";
}
- echo '<p><font style="font-size: 10px; color: #999999;">';
+ echo '<font style="font-size: 10px; color: #999999;">';
if ((file_exists("data/items/$d/comments/live/$comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/comments/live/$comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
$cxavatar_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
echo "<a href=member.php?id=$cxavatar_author>$cxavatar_author</a> - ";
@@ -3311,7 +3510,7 @@ if (file_exists("data/panels")) {
}
}
echo '</font><font style="font-size: 5px;"><br><br></font>';
- $entry_comment = file_get_contents("data/items/$d/comments/live/$comment/comment.txt");
+ $change_me_comment = file_get_contents("data/items/$d/comments/live/$comment/comment.txt");
if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
$badwords = file_get_contents("data/pf-badwords.txt");
if (file_exists("data/pf-censor.txt")) {
@@ -3320,9 +3519,9 @@ if (file_exists("data/panels")) {
else {
$censor = "[expletive]";
}
- $entry_comment = preg_replace("/\b($badwords)\b/i",$censor,$entry_comment);
+ $change_me_comment = preg_replace("/\b($badwords)\b/i",$censor,$change_me_comment);
}
- echo $entry_comment;
+ echo $change_me_comment;
echo '</p></tr></table></div>';
if (file_exists("data/round.txt")) {
@@ -3335,7 +3534,7 @@ if (file_exists("data/panels")) {
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=';
+ echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
echo "610";
@@ -3348,21 +3547,21 @@ if (file_exists("data/panels")) {
if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}")))) {
- if (isset($show) and !empty($show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
+ if (isset($req_show) and !empty($req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0><tr><td><p><font style="font-size: 12px;"><b>Thanks!</b></font></p><p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</p></td></tr></table></p>';
+ echo '<table border=0 cellspacing=0 cellpadding=0><tr><td><font style="font-size: 12px;"><b>Thanks!</b></font></p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</td></tr></table></p>';
}
}
- echo '<p><font style="font-size: 12px;"><b>Add Comment</b></font></p>';
+ echo '<font style="font-size: 12px;"><b>Add Comment</b></font></p>';
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "<p>This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=comments>here</a> to enter it.</p>";
+ echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=comments>here</a> to enter it.</p>";
}
else {
$captcha_rand = str_rand(7);
- echo "<p>Fill out the form below";
+ echo "Fill out the form below";
if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
echo " and enter <b>$captcha_rand</b> in the anti-spam field";
@@ -3391,56 +3590,56 @@ if (file_exists("data/panels")) {
?>
<table border=0 cellspacing=2 cellpadding=0 width=500>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>?entry=<?php echo $d; ?>&show=comments" method="post">
+ <form enctype="multipart/form-data" action="index.php?entry=<?php echo $d; ?>&show=comments" method="post">
<input type=hidden name=captcha_get value="<?php echo $captcha_rand; ?>">
<tr>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php $logged_in_author = explode(" ",file_get_contents("data/author.txt")); echo trim(str_replace(",","",$logged_in_author[0])); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php $logged_in_author = explode(" ",file_get_contents("data/author.txt")); echo trim(str_replace(",","",$logged_in_author[0])); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt"); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt"); ?>"></td>
<?php
}
else {
?>
- <td width=75><p>First Name*</p></td><td width=300><input class=input type=text autocomplete=off name=firstname maxlength=30></td>
+ <td width=75>First Name*</td><td width=300><input class=input type=text autocomplete=off name=firstname maxlength=30></td>
<?php
}
?>
<td rowspan=7 valign=top width=75 align=right>
<table border=0 cellspacing=1 cellpadding=2>
- <tr><td><img src=images/smileys/crying.png border=0></td><td><p>:((</p></td><td ><p>crying</p></td></tr>
- <tr><td><img src=images/smileys/frown.png border=0></td><td><p>:(</p></td><td><p>frown</p></td></tr>
- <tr><td><img src=images/smileys/indifferent.png border=0></td><td><p>:|</p></td><td><p>indifferent</p></td></tr>
- <tr><td><img src=images/smileys/laughing.png border=0></td><td><p>:D</p></td><td><p>laughing</p></td></tr>
- <tr><td><img src=images/smileys/lick.png border=0></td><td><p>:P</p></td><td><p>lick</p></td></tr>
- <tr><td><img src=images/smileys/ohno.png border=0></td><td><p>:O</p></td><td><p>oh no!</p></td></tr>
- <tr><td><img src=images/smileys/smile.png border=0></td><td><p>:)</p></td><td><p>smile</p></td></tr>
- <tr><td><img src=images/smileys/surprised.png border=0></td><td><p>=)</p></td><td><p>surprised</p></td></tr>
- <tr><td><img src=images/smileys/undecided.png border=0></td><td><p>:\</p></td><td><p>undecided</p></td></tr>
- <tr><td><img src=images/smileys/wink.png border=0></td><td><p>;)</p></td><td><p>wink</p></td></tr>
+ <tr><td><img src="images/smileys/crying.png" border="0"></td><td>:((</td><td >crying</td></tr>
+ <tr><td><img src="images/smileys/frown.png" border="0"></td><td>:(</td><td>frown</td></tr>
+ <tr><td><img src="images/smileys/indifferent.png" border="0"></td><td>:|</td><td>indifferent</td></tr>
+ <tr><td><img src="images/smileys/laughing.png" border="0"></td><td>:D</td><td>laughing</td></tr>
+ <tr><td><img src="images/smileys/lick.png" border="0"></td><td>:P</td><td>lick</td></tr>
+ <tr><td><img src="images/smileys/ohno.png" border="0"></td><td>:O</td><td>oh no!</td></tr>
+ <tr><td><img src="images/smileys/smile.png" border="0"></td><td>:)</td><td>smile</td></tr>
+ <tr><td><img src="images/smileys/surprised.png" border="0"></td><td>=)</td><td>surprised</td></tr>
+ <tr><td><img src="images/smileys/undecided.png" border="0"></td><td>:\</td><td>undecided</td></tr>
+ <tr><td><img src="images/smileys/wink.png" border="0"></td><td>;)</td><td>wink</td></tr>
</td></tr>
</table>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td><input type=hidden name=lastname value="<?php echo trim(str_replace(",","",$logged_in_author[1])); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo trim(str_replace(",","",$logged_in_author[1])); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt"); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt"); ?>"></td>
<?php
}
else {
?>
- <tr><td><p>Last Name*</p></td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
+ <tr><td>Last Name*</td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
<?php
}
@@ -3448,52 +3647,52 @@ if (file_exists("data/panels")) {
if (file_exists("data/email.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/email.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/email.txt"); ?>"></td>
<?php
}
else {
- echo "<tr><td><p>E-mail*</p></td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>";
+ echo "<tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>";
}
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>"></td>
<?php
}
else {
?>
- <tr><td><p>E-mail*</p></td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
+ <tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
<?php
}
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("data/url.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("data/url.txt"); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>"></td>
<?php
}
else {
?>
- <tr><td><p>Website</p></td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
+ <tr><td>Website</td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
<?php
}
?>
- <tr><td><p>Comment*</p></td><td><textarea class=input name=new_comment rows=15></textarea></td></tr>
+ <tr><td>Comment*</td><td><textarea class=input name=new_comment rows=15></textarea></td></tr>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
echo "<input type=hidden name=captcha_put value=\"$captcha_rand\">";
}
else {
- echo "<tr><td><p>Anti-Spam*</p></td><td><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
+ echo "<tr><td>Anti-Spam*</td><td><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
}
?>
- <tr><td><p></p></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
+ <tr><td></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
</form>
</table>
<?php
@@ -3503,378 +3702,417 @@ if (file_exists("data/panels")) {
<?php
}
}
-}
-
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($entry) and !empty($entry)) {
- if ($dh_pending_comments = opendir("data/items/$d/comments/pending")) {
-
- while (($entry_pending_comments = readdir($dh_pending_comments)) !== false) {
-
- if ($entry_pending_comments != "." && $entry_pending_comments != ".." && fnmatch("*",$entry_pending_comments)) {
- $show_pending_comments[] = $entry_pending_comments;
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($req_entry) and !empty($req_entry)) {
+
+ if ($dh_pending_comments = opendir("data/items/$d/comments/pending")) {
+
+ while (($change_me_pending_comments = readdir($dh_pending_comments)) !== false) {
+
+ if ($change_me_pending_comments != "." && $change_me_pending_comments != "..") {
+ $show_pending_comments[] = $change_me_pending_comments;
+ }
}
+ closedir($dh_pending_comments);
}
- closedir($dh_pending_comments);
- }
-
- asort($show_pending_comments);
- reset($show_pending_comments);
-
- $count_pending_comments = count($show_pending_comments);
-
- if ($count_pending_comments > 0) {
-
- if ($count_pending_comments == 1) {
- echo '<p><b>Pending Comment</b></p>';
- }
- else {
- echo '<p><b>Pending Comments</b></p>';
- }
- foreach ($show_pending_comments as $pending_comment) {
-
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=';
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
- echo "610";
- }
- else {
- echo "525";
- }
-
- echo '><tr><td>';
+ asort($show_pending_comments);
+ reset($show_pending_comments);
+
+ $count_pending_comments = count($show_pending_comments);
- 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">';
+ if ($count_pending_comments > 0) {
+
+ if ($count_pending_comments == 1) {
+ echo '<b>Pending Comment</b></p>';
}
else {
- echo '<div id="panel_title">';
+ echo '<b>Pending Comments</b></p>';
}
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("data/items/$d/comments/pending/$pending_comment/url.txt");
- echo '>';
- }
+ foreach ($show_pending_comments as $pending_comment) {
- readfile("data/items/$d/comments/pending/$pending_comment/firstname.txt");
- echo ' ';
- readfile("data/items/$d/comments/pending/$pending_comment/lastname.txt");
+ echo '<table border=0 cellspacing=0 cellpadding=0 width=';
+
+ if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ echo "610";
+ }
+ else {
+ echo "525";
+ }
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '</a>';
- }
+ echo '><tr><td>';
- echo ' <';
- readfile("data/items/$d/comments/pending/$pending_comment/email.txt");
- echo '>';
-
- echo '<a href=del.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
-
- $pending_comment_key_file = "data/items/$d/comments/pending/$pending_comment/key.txt";
- $open_pending_comment_key_file = fopen($pending_comment_key_file,"r");
- $pending_comment_login_key = fread($open_pending_comment_key_file,filesize($pending_comment_key_file));
- fclose($open_pending_comment_key_file);
-
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&comment=' . $pending_comment . '&key=' . $pending_comment_login_key . '&action=approve><img src=images/widget.cat.png width=11 height=11 border=0 align=right alt="post comment"></a>';
-
- echo '<a href=move.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.move.png width=11 height=11 border=0 align=right alt="move comment"></a>';
-
- echo '<a href=edit.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
-
- echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
-
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/pending/$pending_comment/author.txt")) {
-
- echo "<td width=85 valign=top><p>";
-
- $pc_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
-
- echo "<a href=member.php?id=$pc_author>";
-
- if ((file_get_contents("data/username.txt") == $pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
-
- $pc_max_avatar_gif_image_width = 80;
-
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
- }
+ 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 id="panel_title">';
+ }
+
+ if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
+ echo '<a target=_maj href=';
+ readfile("data/items/$d/comments/pending/$pending_comment/url.txt");
+ echo '>';
+ }
- echo "<img src=images/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
-
- $pc_max_avatar_jpg_image_width = 80;
-
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
- }
+ readfile("data/items/$d/comments/pending/$pending_comment/firstname.txt");
+ echo ' ';
+ readfile("data/items/$d/comments/pending/$pending_comment/lastname.txt");
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
-
- $pc_max_avatar_png_image_width = 80;
-
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
- }
- echo "><br>";
+ if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
+ echo '</a>';
}
- elseif (file_exists("images/members/$pc_author/avatar.jpg") or file_exists("images/members/$pc_author/avatar.gif") or file_exists("images/members/$pc_author/avatar.png")) {
-
- if (file_exists("images/members/$pc_author/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/members/$pc_author/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
- $pc_max_avatar_gif_image_width = 80;
-
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ echo ' <';
+ readfile("data/items/$d/comments/pending/$pending_comment/email.txt");
+ echo '>';
+
+ echo '<a href=del.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
+
+ $pending_comment_key_file = "data/items/$d/comments/pending/$pending_comment/key.txt";
+ $open_pending_comment_key_file = fopen($pending_comment_key_file,"r");
+ $pending_comment_login_key = fread($open_pending_comment_key_file,filesize($pending_comment_key_file));
+ fclose($open_pending_comment_key_file);
+
+ echo "<a href=\"index.php?entry=$d&comment=$pending_comment&key=$pending_comment_login_key&action=approve\"><img src=\"images/widget.cat.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"post comment\"></a>";
+
+ echo "<a href=\"move.php?entry=$d&comment=$pending_comment&type=pending\"><img src=\"images/widget.move.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"move comment\"></a>";
+
+ echo '<a href=edit.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
+
+ echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
+
+ if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/pending/$pending_comment/author.txt")) {
+
+ echo "<td width=85 valign=top>";
+
+ $pc_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
+
+ echo "<a href=member.php?id=$pc_author>";
+
+ if ((file_get_contents("data/username.txt") == $pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
+ if (file_exists("images/avatar.gif")) {
+ $pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
+ $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
+ $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
+
+ $pc_max_avatar_gif_image_width = 80;
+
+ if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
+ $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
+ $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.gif border=0 width=";
+ echo $pc_avatar_gif_image_width;
+ echo " height=";
+ echo $pc_avatar_gif_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/members/$pc_author/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
-
- $pc_max_avatar_jpg_image_width = 80;
-
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("images/avatar.jpg")) {
+ $pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
+ $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
+ $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
+
+ $pc_max_avatar_jpg_image_width = 80;
+
+ if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
+ $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
+ $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.jpg border=0 width=";
+ echo $pc_avatar_jpg_image_width;
+ echo " height=";
+ echo $pc_avatar_jpg_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/members/$pc_author/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
-
- $pc_max_avatar_png_image_width = 80;
+
+ if (file_exists("images/avatar.png")) {
+ $pc_avatar_png_image_size = getimagesize("images/avatar.png");
+ $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
+ $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ $pc_max_avatar_png_image_width = 80;
+
+ if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
+ $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
+ $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.png border=0 width=";
+ echo $pc_avatar_png_image_width;
+ echo " height=";
+ echo $pc_avatar_png_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
+ echo "><br>";
}
- echo "><br>";
- }
- echo "$pc_author</a><br>";
-
- if ((file_get_contents("data/username.txt") == $pc_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- $pc_rank = file_get_contents("data/members/active/$pc_author/rank.txt");
- echo "$pc_rank<br>";
- }
- elseif (!file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
- if ($pc_dh_posts = opendir("data/items")) {
-
- while (($pc_entry_posts = readdir($pc_dh_posts)) !== false) {
-
- if (file_exists("data/items/$pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ elseif (file_exists("images/members/$pc_author/avatar.jpg") or file_exists("images/members/$pc_author/avatar.gif") or file_exists("images/members/$pc_author/avatar.png")) {
+
+ if (file_exists("images/members/$pc_author/avatar.gif")) {
+ $pc_avatar_gif_image_size = getimagesize("images/members/$pc_author/avatar.gif");
+ $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
+ $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
+
+ $pc_max_avatar_gif_image_width = 80;
+
+ if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
+ $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
+ $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.gif border=0 width=";
+ echo $pc_avatar_gif_image_width;
+ echo " height=";
+ echo $pc_avatar_gif_image_height;
}
- if (file_exists("data/items/$pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
+ if (file_exists("images/members/$pc_author/avatar.jpg")) {
+ $pc_avatar_jpg_image_size = getimagesize("images/members/$pc_author/avatar.jpg");
+ $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
+ $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
+
+ $pc_max_avatar_jpg_image_width = 80;
+
+ if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
+ $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
+ $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.jpg border=0 width=";
+ echo $pc_avatar_jpg_image_width;
+ echo " height=";
+ echo $pc_avatar_jpg_image_height;
}
- $pc_post_cat_dir = file_get_contents("data/items/$pc_entry_posts/category.txt");
-
- if (file_exists("data/categories/$pc_post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$pc_entry_posts/cat.txt")) {
- continue;
+ if (file_exists("images/members/$pc_author/avatar.png")) {
+ $pc_avatar_png_image_size = getimagesize("images/members/$pc_author/avatar.png");
+ $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
+ $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
+
+ $pc_max_avatar_png_image_width = 80;
+
+ if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
+ $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
+ $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.png border=0 width=";
+ echo $pc_avatar_png_image_width;
+ echo " height=";
+ echo $pc_avatar_png_image_height;
}
+ echo "><br>";
+ }
+ echo "$pc_author</a><br>";
+
+ if ((file_get_contents("data/username.txt") == $pc_author) and file_exists("data/rank.txt")) {
+ echo "administrator<br>";
+ }
+ elseif (file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
+ $pc_rank = file_get_contents("data/members/active/$pc_author/rank.txt");
+ echo "$pc_rank<br>";
+ }
+ elseif (!file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
+ echo "member<br>";
+ }
- if ($pc_entry_posts != "." && $pc_entry_posts != ".." && fnmatch("*",$pc_entry_posts)) {
- if (file_exists("data/members/active/$pc_author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
+ if ($pc_dh_posts = opendir("data/items")) {
+
+ while (($pc_entry_posts = readdir($pc_dh_posts)) !== false) {
+
+ if (file_exists("data/items/$pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
+
+ if (file_exists("data/items/$pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ continue;
+ }
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$change_me_pc_entry_posts/categories")) {
+
+ if ($dh_cat2_pc_entry_posts = opendir("data/items/$change_me_pc_entry_posts/categories")) {
+
+ while (($change_me_cat2_pc_entry_posts = readdir($dh_cat2_pc_entry_posts)) !== false) {
+
+ if ($change_me_cat2_pc_entry_posts != "." && $change_me_cat2_pc_entry_posts != "..") {
+
+ if (file_exists("data/categories/$change_me_cat2_pc_entry_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_cat2_pc_entry_posts);
}
}
- elseif (!file_exists("data/members/active/$pc_author") and (file_get_contents("data/username.txt") == $pc_author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']
tree 784fc35e7a2e470dd95702b09f50602d79cb078f
parent e011ee437bfb34cf32d77eb1f22ae07947616f69
author Engels Antonio <engels@majcms.org> 1277314202 +0800
committer Engels Antonio <engels@majcms.org> 1277314202 +0800
maj-1.0-20081123-bb.zip
diff --git a/add.php b/add.php
index b31967a..01b761f 100644
--- a/add.php
+++ b/add.php
@@ -6,9 +6,16 @@ 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);
}
@@ -18,7 +25,6 @@ if (get_magic_quotes_gpc()) {
return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -33,7 +39,9 @@ if ($_SESSION['logged_in'] == 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");
}
@@ -136,7 +144,6 @@ $entry_hour = date("H", time() + $offset);
$entry_min = date("i", time() + $offset);
$entry_sec = date("s", time() + $offset);
-$image_path = "images/";
$max_image_size = 8000000;
$max_file_size = 8000000;
@@ -332,6 +339,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input autocomplete="off" type="file" name="file_input"> Select optional file.</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")) {
@@ -350,7 +358,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
if ($count_cat > 0) {
- echo "<p><select name=\"category\"><option selected>unfiled";
+ echo "<p><select name=\"category\"><option value=\"\" selected>unfiled";
foreach ($show_cat as $category) {
echo "<option value=\"";
@@ -370,6 +378,7 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
}
}
?>
+
<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>
@@ -828,8 +837,9 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$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 = "<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);
@@ -852,89 +862,79 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
function PDF($orientation='P',$unit='mm',$format='letter')
{
- //Call parent constructor
- $this->FPDF($orientation,$unit,$format);
- //Initialization
- $this->B=0;
- $this->I=0;
- $this->U=0;
- $this->HREF='';
+ $this->FPDF($orientation,$unit,$format);
+ $this->B=0;
+ $this->I=0;
+ $this->U=0;
+ $this->HREF='';
}
function WriteHTML($html)
{
- //HTML parser
- $html=str_replace("\n",' ',$html);
- $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
- foreach($a as $i=>$e)
- {
- if($i%2==0)
- {
- //Text
- if($this->HREF)
- $this->PutLink($this->HREF,$e);
- else
- $this->Write(5,$e);
- }
- else
- {
- //Tag
- if($e{0}=='/')
- $this->CloseTag(strtoupper(substr($e,1)));
- else
- {
- //Extract attributes
- $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);
- }
- }
- }
+ $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)
{
- //Opening tag
- 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);
+ 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)
{
- //Closing tag
- if($tag=='B' or $tag=='I' or $tag=='U')
- $this->SetStyle($tag,false);
- if($tag=='A')
- $this->HREF='';
+ if($tag=='B' or $tag=='I' or $tag=='U')
+ $this->SetStyle($tag,false);
+ if($tag=='A')
+ $this->HREF='';
}
function SetStyle($tag,$enable)
{
- //Modify style and select corresponding font
- $this->$tag+=($enable ? 1 : -1);
- $style='';
- foreach(array('B','I','U') as $s)
- if($this->$s>0)
- $style.=$s;
- $this->SetFont('',$style);
+ $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)
{
- //Put a hyperlink
- $this->SetTextColor(0,0,255);
- $this->SetStyle('U',true);
- $this->Write(5,$txt,$URL);
- $this->SetStyle('U',false);
- $this->SetTextColor(0);
+ $this->SetTextColor(0,0,255);
+ $this->SetStyle('U',true);
+ $this->Write(5,$txt,$URL);
+ $this->SetStyle('U',false);
+ $this->SetTextColor(0);
}
}
@@ -949,22 +949,31 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$pdf->Output($filename);
}
-if (isset($_POST['category']) and !empty($_POST['category'])) {
- if (!file_exists("data/categories")) {
- mkdir("data/categories");
+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/categories/{$_POST['category']}")) {
- $fp_category_txt = fopen("data/items/$entry/category.txt","w");
- fwrite($fp_category_txt, $_POST['category']);
- fclose($fp_category_txt);
+
+ 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")) {
- copy("data/members/active/{$_SESSION['logged_in']}/category.txt","data/items/$entry/category.txt");
+
+ 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");
+ }
}
}
@@ -982,18 +991,15 @@ if (isset($_POST['passwd']) and !empty($_POST['passwd'])) {
}
}
-$default_ping_urls = "http://technorati.com/ping/http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
-$ping_urls_file = "data/ping.txt";
+$default_ping_url = "http://technorati.com/ping/http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
-if (!file_exists($ping_urls_file)) {
- $fp_default_ping_txt = fopen($ping_urls_file,"w");
- fwrite($fp_default_ping_txt, $default_ping_urls);
+if (!file_exists("data/ping.txt")) {
+ $fp_default_ping_txt = fopen("data/ping.txt","w");
+ fwrite($fp_default_ping_txt, $default_ping_url);
fclose($fp_default_ping_txt);
}
-$fp_ping_urls = fopen($ping_urls_file, "r");
-$ping_urls = fread($fp_ping_urls, filesize($ping_urls_file));
-fclose($fp_ping_urls);
+$ping_urls = file_get_contents("data/ping.txt");
$get_ping_urls = explode("|", $ping_urls);
diff --git a/album.php b/album.php
index c93a220..08231cc 100644
--- a/album.php
+++ b/album.php
@@ -1,14 +1,19 @@
<?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){
+ foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
return $data;
@@ -77,16 +82,16 @@ if ((!isset($_POST['caption']) or empty($_POST['caption'])) and isset($_SESSION[
if (isset($_POST['caption']) and !empty($_POST['caption']) and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "caption")) {
$caption_put = ucfirst($_POST['caption']);
- $caption_put = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $caption_put);
- $caption_put = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $caption_put);
- $caption_put = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $caption_put);
- $caption_put = str_replace(':D', '<img src=images/smileys/laughing.png border=0>', $caption_put);
- $caption_put = str_replace(':P', '<img src=images/smileys/lick.png border=0>', $caption_put);
- $caption_put = str_replace(':O', '<img src=images/smileys/ohno.png border=0>', $caption_put);
- $caption_put = str_replace(':)', '<img src=images/smileys/smile.png border=0>', $caption_put);
- $caption_put = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $caption_put);
- $caption_put = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $caption_put);
- $caption_put = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $caption_put);
+ $caption_put = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_put);
+ $caption_put = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_put);
+ $caption_put = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $caption_put);
+ $caption_put = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $caption_put);
+ $caption_put = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $caption_put);
+ $caption_put = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $caption_put);
+ $caption_put = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $caption_put);
+ $caption_put = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $caption_put);
+ $caption_put = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $caption_put);
+ $caption_put = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_put);
$caption_put = str_replace('[code]', '<code>', $caption_put);
$caption_put = str_replace('[/code]', '</code>', $caption_put);
$caption_put = str_replace("\n", '<br />', $caption_put);
@@ -243,16 +248,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
$caption_get = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
$caption_get = str_replace('<br />', "\n", $caption_get);
- $caption_get = str_replace('<img src=images/smileys/crying.png border=0>', ':((', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/frown.png border=0>', ':(', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/indifferent.png border=0>', ':|', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/laughing.png border=0>', ':D', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/lick.png border=0>', ':P', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/ohno.png border=0>', ':O', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/smile.png border=0>', ':)', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/surprised.png border=0>', '=)', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/undecided.png border=0>', ':\\', $caption_get);
- $caption_get = str_replace('<img src=images/smileys/wink.png border=0>', ';)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/lick.png" border="0">', ':P', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/smile.png" border="0">', ':)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $caption_get);
+ $caption_get = str_replace('<img src="images/smileys/wink.png" border="0">', ';)', $caption_get);
$caption_get = str_replace('<span style="background-color: #ffff00;">', '<highlight>', $caption_get);
$caption_get = str_replace('</span>', '</highlight>', $caption_get);
echo $caption_get;
diff --git a/cat.php b/cat.php
index 7ac90c2..2c13521 100644
--- a/cat.php
+++ b/cat.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -27,29 +31,58 @@ if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username
exit();
}
-function rmdirr($recurse_dirname)
-{
+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")) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
+ while (($entry_cat_txt = readdir($dh_cat_txt)) !== false) {
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
+ if ($entry_cat_txt != "." && $entry_cat_txt != "..") {
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
+ if (file_exists("data/items/$entry_cat_txt/category.txt")) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
+ $category_txt = file_get_contents("data/items/$entry_cat_txt/category.txt");
+ $category_txt = strtolower($category_txt);
+ $category_txt = str_replace(" ","_",$category_txt);
+ $category_txt = trim($category_txt);
- rmdirr("$recurse_dirname/$recurse_entry");
- }
+ if (!file_exists("data/items/$entry_cat_txt/categories")) {
+ mkdir("data/items/$entry_cat_txt/categories");
+ }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
+ if (!file_exists("data/items/$entry_cat_txt/categories/$category_txt")) {
+ mkdir("data/items/$entry_cat_txt/categories/$category_txt");
+ }
+
+ unlink("data/items/$entry_cat_txt/category.txt");
+ }
+ }
+ }
+ closedir($dh_cat_txt);
+ }
}
if (isset($_POST['new_id']) and !empty($_POST['new_id'])) {
@@ -115,6 +148,39 @@ if (empty($_POST['cat_title']) and file_exists("data/categories/{$_POST['cat_id'
unlink("data/categories/{$_POST['cat_id']}/title.txt");
}
+if (isset($_POST['cat_ren']) and !empty($_POST['cat_ren'])) {
+
+ $cat_rename = strtolower($_POST['cat_ren']);
+ $cat_rename = str_replace(" ","_",$cat_rename);
+ $cat_rename = trim($cat_rename);
+
+ $cat_oldname = strtolower($_POST['cat_id']);
+ $cat_oldname = str_replace(" ","_",$cat_oldname);
+ $cat_oldname = trim($cat_oldname);
+
+ if (($cat_rename != $cat_oldname) and !file_exists("data/categories/$cat_rename")) {
+ rename("data/categories/$cat_oldname","data/categories/$cat_rename");
+ }
+
+
+ if (file_exists("data/items")) {
+
+ if ($dh_cat_ren = opendir("data/items")) {
+
+ while (($entry_cat_ren = readdir($dh_cat_ren)) !== false) {
+
+ if ($entry_cat_ren != "." && $entry_cat_ren != "..") {
+
+ if (file_exists("data/items/$entry_cat_ren/categories/$cat_oldname") and !file_exists("data/items/$entry_cat_ren/categories/$cat_rename")) {
+ rename("data/items/$entry_cat_ren/categories/$cat_oldname","data/items/$entry_cat_ren/categories/$cat_rename");
+ }
+ }
+ }
+ closedir($dh_cat_ren);
+ }
+ }
+}
+
?>
<title>Categories</title>
@@ -132,10 +198,11 @@ body {
echo "{$font_body},";
}
?> arial, helvetica, sans-serif;
+ font-size: 11px;
background-color: #FFFFFF;
}
-p {
+p, td {
font-size: 11px;
}
@@ -167,7 +234,21 @@ a:active {
echo "{$font_input},";
}
?> arial, helvetica, sans-serif;
- font-size: 11px
+ font-size: 11px;
+}
+
+.id {
+ color: #666666;
+ background: #ffffff;
+ border: #999999 solid 1px;
+ width: 150px;
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$font_input},";
+ }
+ ?> arial, helvetica, sans-serif;
+ font-size: 11px;
}
.submit {
@@ -185,16 +266,16 @@ a:active {
}
</style>
-<p><b>Add Category</b></p><p>Enter a unique category ID and optional title or description.</p>
+<p><b>Add Category</b><br>Enter a unique category ID and optional title or description.</p>
-<table border=0 cellspacing=1 cellpadding=2>
-<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
-<tr><td><p>category id*</p></td><td><input type=text class=input name=new_id autocomplete=off maxlength=30></td></tr>
-<tr><td><p>title or description</p></td><td><input type=text class=input name=new_title autocomplete=off maxlength=90></td></tr>
-<tr><td><p></p></td><td><input type=submit class=input value="click here to add a new category"></td></tr>
+<table border="0" cellspacing="1" cellpadding="2">
+<form enctype="multipart/form-data" action="cat.php" method="post">
+<tr><td>category id*</td><td><input type="text" class="input" name="new_id" autocomplete="off" maxlength="30"></td></tr>
+<tr><td>title or description</td><td><input type="text" class="input" name="new_title" autocomplete="off" maxlength="90"></td></tr>
+<tr><td></td><td><input type="submit" class="input" value="click here to add a new category"></td></tr>
</form>
-<form enctype="multipart/form-data" action="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" method="post">
-<tr><td><p></p></td><td><input class=input type=submit value="click here to go to the index page"></td></tr>
+<form enctype="multipart/form-data" action="index.php" method="post">
+<tr><td></td><td><input class="input" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -216,33 +297,34 @@ a:active {
if ($count_cat > 0) {
- echo "<p><br><b>Category Management</b></p><p>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
- echo "<table border=0 cellspacing=1 cellpadding=2>";
- echo "<tr><td><p>category id</p></td><td><p align=center>title or description</p></td><td><p align=center>hide</p></td><td><p align=center>book</p></td><td><p align=center>delete</p></td><td><p></p></td></tr>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
+ echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td><td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
foreach ($show_cat as $category) {
- echo '<form enctype="multipart/form-data" action="';
- echo $_SERVER['PHP_SELF'];
- echo '" method="post">';
- echo "<tr><td><p><b>";
- echo strtolower(str_replace("_", " ", $category));
- echo '</b></p></td><td><p><input type=text class=input name=cat_title value="';
+ echo "<form enctype=\"multipart/form-data\" action=\"cat.php\" method=\"post\">";
+ echo "<tr><td><input type=\"text\" class=\"id\" name=\"cat_ren\" value=\"$category\" maxlength=\"30\" autocomplete=\"off\"></td>";
+ echo "<td><input type=\"text\" class=\"input\" name=\"cat_title\" value=\"";
readfile("data/categories/$category/title.txt");
- echo '" autocomplete=off maxlength=90></p></td><td><p align=center><input type=checkbox name=cat_hide';
+ echo "\" autocomplete=\"off\" maxlength=\"90\"></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_hide\"";
+
if (file_exists("data/categories/$category/private.txt")) {
echo " checked";
}
- echo "></p></td>";
- echo "<td><p align=center><input type=checkbox name=cat_book";
+
+ echo "></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_book\"";
+
if (file_exists("data/categories/$category/book.txt")) {
echo " checked";
}
- echo "></p></td>";
- echo "<td><p align=center><input type=checkbox name=cat_del></p></td><td><p><input type=hidden name=cat_id value=$category><input type=hidden name=cat_edit value=on><input type=submit class=submit value=submit></p></td>";
+ echo "></td>";
+ echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_del\"></td>";
+ echo "<td><input type=\"hidden\" name=\"cat_id\" value=\"$category\"><input type=\"hidden\" name=\"cat_edit\" value=\"on\"><input type=\"submit\" class=\"submit\" value=\"submit\"></td>";
echo "</tr></form>";
}
-
echo "</table>";
}
}
diff --git a/colors.php b/colors.php
index f8bc755..474fefb 100644
--- a/colors.php
+++ b/colors.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
diff --git a/del.php b/del.php
index 7a1b3f0..b3f9fc3 100644
--- a/del.php
+++ b/del.php
@@ -6,6 +6,10 @@ 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)) {
diff --git a/dig.php b/dig.php
index 3d42668..5c90d8d 100644
--- a/dig.php
+++ b/dig.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
@@ -47,7 +51,7 @@ body {
background-color: #FFFFFF;
}
-p {
+p, td {
font-size: 11px;
}
@@ -178,9 +182,26 @@ if ($dh_search_items = opendir($dir)) {
continue;
}
- $cat_dir = file_get_contents("data/items/$entry_search_items/category.txt");
+ $private = "0";
+
+ if (file_exists("data/items/$entry_search_items/categories")) {
+
+ if ($dh_cat_dig = opendir("data/items/$entry_search_items/categories")) {
+
+ while (($entry_cat_dig = readdir($dh_cat_dig)) !== false) {
+
+ if ($entry_cat_dig != "." && $entry_cat_dig != "..") {
+
+ if (file_exists("data/categories/$entry_cat_dig/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_cat_dig);
+ }
+ }
- if (file_exists("data/categories/$cat_dir/private.txt") and !file_exists("data/items/$entry_search_items/cat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (($private > 0) and !file_exists("data/items/$entry_search_items/cat.txt")) {
continue;
}
diff --git a/edit.php b/edit.php
index 79ae111..adfebf7 100644
--- a/edit.php
+++ b/edit.php
@@ -6,6 +6,10 @@ 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)) {
@@ -15,10 +19,9 @@ if (get_magic_quotes_gpc()) {
return $data;
}
else {
- return stripslashes($data);
+ return stripslashes($data);
}
}
-
$_REQUEST = stripslashes_array($_REQUEST);
}
@@ -88,13 +91,6 @@ $revisions_file = 'data/items/' . $_REQUEST['entry'] . '/revisions.txt';
$max_image_size = 8000000;
$max_file_size = 8000000;
-if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- if (!file_exists($category_check)) {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
-}
-
?>
<title>Edit</title>
@@ -226,16 +222,16 @@ a:active {
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 = 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);
@@ -283,16 +279,16 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
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);
+ $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;
@@ -318,6 +314,8 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
?>
+<table border="0" cellspacing="0" cellpadding="0"><tr><td>
+
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="525">
<div id="panel_title"><?php readfile($title_file); ?></div>
@@ -339,18 +337,18 @@ if (file_exists($revisions_file)) {
echo ')';
}
-if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- echo " Filed under ";
- $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
-}
+//if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
+// echo " Filed under ";
+// $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
+// $category_key = strtolower($category_key);
+// if (file_exists("data/categories/{$category_key}/title.txt")) {
+// $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
+// echo "$category_key ($category_dsp)";
+// }
+// else {
+// echo "$category_key";
+// }
+//}
?></font></div>
</td></tr></table>
@@ -396,50 +394,6 @@ if ($_SESSION['logged_in'] == $login_username) {
}
?></td></tr>
- <?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 "<tr><td><select name=\"category\"><option>unfiled";
-
- foreach ($show_cat as $category) {
- echo "<option value=\"";
- echo strtolower($category);
- echo "\"";
-
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt") and (file_get_contents("data/items/{$_REQUEST['entry']}/category.txt") == $category)) {
- echo " selected";
- }
-
- echo ">";
-
- if (file_exists("data/categories/$category/title.txt")) {
- readfile("data/categories/$category/title.txt");
- }
- else {
- echo strtolower($category);
- }
- }
-
- echo "</select> Select category.</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>
@@ -453,24 +407,18 @@ if ($_SESSION['logged_in'] == $login_username) {
<?php
- // start of wiki mod (20071130)
-
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>
<?php
- // end of wiki mod (20071130)
-
}
?>
<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 } ?>
</table></p>
@@ -489,16 +437,16 @@ $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('<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);
@@ -538,6 +486,81 @@ echo $body_read_content;
</td></tr></table>
+</td><td width="25"></td><td valign="top">
+
+<?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)) {
+
+ 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>This entry has been filed under the following ";
+
+ if ($count_filed_cat == 1) {
+ echo "category";
+ }
+ else {
+ echo "categories";
+ }
+
+ echo ":</p><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($filed_cat as $filed_category) {
+ echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td><td width=\"16\"></td></tr>";
+ }
+
+ echo "</table>";
+ }
+ }
+?>
+
+</td><td width="25"></td><td valign="top">
+
+<?php
+
+if ($count_unfiled_cat > 0) {
+
+ echo "This entry has been filed under the following categories";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($unfiled_cat as $unfiled_category) {
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"16\"></td><td align=\"right\">$unfiled_category</td></tr>";
+ }
+
+ echo "</table>";
+}
+
+?>
+
+</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();
@@ -575,16 +598,16 @@ function reformat_code($defang_code) {
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] = 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)
@@ -600,16 +623,16 @@ $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(':((', '<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);
@@ -680,16 +703,16 @@ if (isset($_FILES['album_image_input']) and !empty($_FILES['album_image_input'])
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(':((', '<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);
@@ -823,8 +846,6 @@ if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
}
}
-// start of wiki mod (20071130)
-
$title_get_content = ucfirst($_POST['title_input']);
$title_get_content = str_replace('<','<',$title_get_content);
$title_get_content = str_replace('>','>',$title_get_content);
@@ -871,22 +892,16 @@ if (file_exists("data/wiki.txt") and (($title_get_content != file_get_contents("
}
-// end of wiki mod (20071130)
-
$open_body_file = fopen($body_file,"w");
fwrite($open_body_file,$body_write_content);
fclose($open_body_file);
-// start of wiki mod (20071130)
-
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);
}
-// end of wiki mod (20071130)
-
if ($_SESSION['logged_in'] == $login_username) {
$sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
@@ -985,8 +1000,9 @@ if ($_SESSION['logged_in'] == $login_username) {
$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 = "<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);
@@ -1103,20 +1119,23 @@ if ($_SESSION['logged_in'] == $login_username) {
}
if (isset($_POST['category']) and !empty($_POST['category'])) {
+
if (!file_exists("data/categories")) {
mkdir("data/categories");
}
- if ($_POST['category'] == "unfiled") {
- unlink("data/items/{$_REQUEST['entry']}/category.txt");
- }
- if (file_exists("data/categories/{$_POST['category']}")) {
- $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
- fwrite($fp_category_txt, $_POST['category']);
- fclose($fp_category_txt);
- }
+
+// if ($_POST['category'] == "unfiled") {
+// unlink("data/items/{$_REQUEST['entry']}/category.txt");
+// }
+// if (file_exists("data/categories/{$_POST['category']}")) {
+// $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
+// fwrite($fp_category_txt, $_POST['category']);
+// fclose($fp_category_txt);
+// }
}
$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']);
@@ -1125,6 +1144,7 @@ if ($_SESSION['logged_in'] == $login_username) {
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);
diff --git a/fonts.php b/fonts.php
index 13f67bd..2018bc1 100644
--- a/fonts.php
+++ b/fonts.php
@@ -1,23 +1,27 @@
<?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;
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
}
- else{
- return stripslashes($data);
+ else {
+ return stripslashes($data);
}
}
-
$_POST = stripslashes_array($_POST);
}
diff --git a/index.php b/index.php
index 6804582..adce78a 100644
--- a/index.php
+++ b/index.php
@@ -12,38 +12,52 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP
header("Location: login.php");
}
-if (get_magic_quotes_gpc()){
- function stripslashes_array($f_data){
- if (is_array($f_data)){
- foreach ($f_data as $f_key => $f_value){
- $f_data[$f_key] = stripslashes_array($f_value);
+if (get_magic_quotes_gpc()) {
+ function stripslashes_array($data) {
+ if (is_array($data)) {
+ foreach ($data as $key => $value) {
+ $data[$key] = stripslashes_array($value);
}
- return $f_data;
+ return $data;
}
else {
- return stripslashes($f_data);
+ return stripslashes($data);
}
}
$_REQUEST = stripslashes_array($_REQUEST);
}
if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $entry = trim($_REQUEST['entry']);
+ $req_entry = trim($_REQUEST['entry']);
}
if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
- $show = trim($_REQUEST['show']);
+ $req_show = trim($_REQUEST['show']);
+}
+
+if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
+ $req_find = trim($_REQUEST['find']);
+ $req_find = str_replace(" ","-",$req_find);
+ $req_find = strtolower($req_find);
+ $req_find = strip_tags($req_find);
}
if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $category = trim($_REQUEST['category']);
- $category = str_replace(" ","-",$category);
- $category = strtolower($category);
- $category = strip_tags($category);
+ $req_category = trim($_REQUEST['category']);
+ $req_category = str_replace(" ","-",$req_category);
+ $req_category = strtolower($req_category);
+ $req_category = strip_tags($req_category);
}
if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
- $archive = trim($_REQUEST['archive']);
+ $req_archive = trim($_REQUEST['archive']);
+}
+
+if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
+ $req_author = trim($_REQUEST['author']);
+ $req_author = str_replace(" ","-",$req_author);
+ $req_author = strtolower($req_author);
+ $req_author = strip_tags($req_author);
}
if (file_exists("data/offset.txt")) {
@@ -63,7 +77,7 @@ else {
$default_blog_title = "My Activity Journal";
$default_username = "maj";
$default_password = "php";
-$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>GPL</a>'ed blog written from scratch as a spare time family project by <a href=http://engels.mortega.net/ target=_maj>Engels</a>,<a href=http://gaffud.com/ target=_maj>Magie</a>,and <a href=http://psylocke.org/ target=_maj>Psylocke</a> Antonio.";
+$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://engels.mortega.net/" target="_maj">Engels</a>,<a href="http://gaffud.com/" target="_maj">Magie</a>,and <a href="http://psylocke.org/" target="_maj">Psylocke</a> Antonio.';
$default_blog_author = "My Activity Journal";
if (!file_exists("data")) {
@@ -145,43 +159,43 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
fclose($google_hits_file);
}
-function str_rand($f_length = 8,$f_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $f_str = '';
- $f_seeds_count = strlen($f_seeds);
+function str_rand($length = 8,$seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
+ $str = '';
+ $seeds_count = strlen($seeds);
- list($f_usec,$f_sec) = explode(' ',microtime());
- $f_seed = (float) $f_sec + ((float) $f_usec * 100000);
- mt_srand($f_seed);
+ list($usec,$sec) = explode(' ',microtime());
+ $seed = (float) $sec + ((float) $usec * 100000);
+ mt_srand($seed);
- for ($f_i = 0; $f_length > $f_i; $f_i++) {
- $f_str .= $f_seeds{mt_rand(0,$f_seeds_count - 1)};
+ for ($i = 0; $length > $i; $i++) {
+ $str .= $seeds{mt_rand(0,$seeds_count - 1)};
}
- return $f_str;
+ return $str;
}
-function rmdirr($f_recurse_dirname) {
+function rmdirr($recurse_dirname) {
- if (!file_exists($f_recurse_dirname)) {
+ if (!file_exists($recurse_dirname)) {
return false;
}
- if (is_file($f_recurse_dirname)) {
- return unlink($f_recurse_dirname);
+ if (is_file($recurse_dirname)) {
+ return unlink($recurse_dirname);
}
- $f_recurse_dir = dir($f_recurse_dirname);
+ $recurse_dir = dir($recurse_dirname);
- while (false !== $f_recurse_entry = $f_recurse_dir->read()) {
+ while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($f_recurse_entry == '.' || $f_recurse_entry == '..') {
+ if ($recurse_entry == '.' || $recurse_entry == '..') {
continue;
}
- rmdirr("$f_recurse_dirname/$f_recurse_entry");
+ rmdirr("$recurse_dirname/$recurse_entry");
}
- $f_recurse_dir->close();
- return rmdir($f_recurse_dirname);
+ $recurse_dir->close();
+ return rmdir($recurse_dirname);
}
if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
@@ -191,64 +205,64 @@ if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
die();
}
-function go_download($f_dl_file) {
+function go_download($dl_file) {
- $entry = trim($_REQUEST['entry']);
+ $req_entry = trim($_REQUEST['entry']);
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pdf")) {
- $f_dl_path = "data/items/$entry/pdf/file";
- $f_count_path = "data/items/$entry/pdf/count";
- $f_count_file = "dl.txt";
+ $dl_path = "data/items/$req_entry/pdf/file";
+ $count_path = "data/items/$req_entry/pdf/count";
+ $count_file = "dl.txt";
}
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "filedrop")) {
- $f_dl_path = "data/items/$entry/filedrop/files";
- $f_count_path = "data/items/$entry/filedrop/count";
- $f_count_file = "{$f_dl_file}.txt";
+ $dl_path = "data/items/$req_entry/filedrop/files";
+ $count_path = "data/items/$req_entry/filedrop/count";
+ $count_file = "{$dl_file}.txt";
}
- $f_dl_file_size = filesize("$f_dl_path/$f_dl_file");
+ $dl_file_size = filesize("$dl_path/$dl_file");
header("Cache-Control: ");
header("Pragma: ");
header("Content-type: application/octet-stream");
- header("Content-Disposition: attachment; filename=$f_dl_file");
- header("Content-length: $f_dl_file_size");
+ header("Content-Disposition: attachment; filename=$dl_file");
+ header("Content-length: $dl_file_size");
- $f_get_it = fopen("$f_dl_path/$f_dl_file","rb");
+ $get_it = fopen("$dl_path/$dl_file","rb");
- while (!feof($f_get_it)) {
- $f_buf = fread($f_get_it,4096);
- echo $f_buf;
- $f_bytes_sent += strlen($f_buf);
+ while (!feof($get_it)) {
+ $buf = fread($get_it,4096);
+ echo $buf;
+ $bytes_sent += strlen($buf);
}
- if ($f_bytes_sent == $f_dl_file_size) {
+ if ($bytes_sent == $dl_file_size) {
- if (!file_exists($f_count_path)) {
- mkdir($f_count_path);
+ if (!file_exists($count_path)) {
+ mkdir($count_path);
}
- $f_unique_downloads = "$f_count_path/$f_count_file";
+ $unique_downloads = "$count_path/$count_file";
- if (file_exists($f_unique_downloads)) {
- $f_count_unique_downloads = file_get_contents($f_unique_downloads);
+ if (file_exists($unique_downloads)) {
+ $count_unique_downloads = file_get_contents($unique_downloads);
}
else {
- $f_count_unique_downloads = "0";
+ $count_unique_downloads = "0";
}
- $f_count_unique_downloads = $f_count_unique_downloads + 1;
+ $count_unique_downloads = $count_unique_downloads + 1;
- $f_fp_unique_downloads = fopen($f_unique_downloads,"w");
- fwrite($f_fp_unique_downloads,$f_count_unique_downloads);
- fclose($f_fp_unique_downloads);
+ $fp_unique_downloads = fopen($unique_downloads,"w");
+ fwrite($fp_unique_downloads,$count_unique_downloads);
+ fclose($fp_unique_downloads);
}
}
-if (isset($entry) and !empty($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'])) {
+if (isset($req_entry) and !empty($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'])) {
- $comment_dir = "data/items/$entry/comments/pending/{$_REQUEST['comment']}";
+ $comment_dir = "data/items/$req_entry/comments/pending/{$_REQUEST['comment']}";
$login_key = file_get_contents("$comment_dir/key.txt");
@@ -256,9 +270,18 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
if ($_REQUEST['action'] == "approve") {
- $live_dir = "data/items/$entry/comments/live/{$_REQUEST['comment']}";
+ $live_dir = "data/items/$req_entry/comments/live/{$_REQUEST['comment']}";
+
+ if (!file_exists("data/items/$req_entry/comments/live")) {
+ mkdir("data/items/$req_entry/comments/live");
+ }
+
+ if (!file_exists("data/items/$req_entry/comments/live/{$_REQUEST['comment']}")) {
+ mkdir("data/items/$req_entry/comments/live/{$_REQUEST['comment']}");
+ }
rename($comment_dir,$live_dir);
+
unlink("$live_dir/key.txt");
$cmonth = date("Ym",time() + $offset);
@@ -271,17 +294,34 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
mkdir("data/comments/latest/$cmonth");
}
- if (!file_exists("data/comments/latest/$cmonth/$entry")) {
- mkdir("data/comments/latest/$cmonth/$entry");
+ if (!file_exists("data/comments/latest/$cmonth/$req_entry")) {
+ mkdir("data/comments/latest/$cmonth/$req_entry");
}
- if (!file_exists("data/comments/latest/$cmonth/$entry/{$_REQUEST['comment']}")) {
- mkdir("data/comments/latest/$cmonth/$entry/{$_REQUEST['comment']}");
+ if (!file_exists("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}")) {
+ mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
}
- $cat_dir = file_get_contents("data/items/$entry/category.txt");
+ $private_categories = "0";
+
+ if (file_exists("data/items/$req_entry/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
+
+ while (($entry_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($entry_category != "." && $entry_category != "..") {
+
+ if (file_exists("data/categories/$entry_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
+ }
- if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$entry/private.txt") and !file_exists("data/categories/$cat_dir/private.txt")) {
+ if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$req_entry/private.txt") and ($private_categories == "0")) {
if (file_exists("data/ml-reply2.txt")) {
$ml_reply2 = file_get_contents("data/ml-reply2.txt");
@@ -301,7 +341,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$ml_from = '"' . "$ml_from_firstname $ml_from_lastname" . '" <' . $ml_from . '>';
- $ml_subject = file_get_contents("data/items/$entry/title.txt");
+ $ml_subject = file_get_contents("data/items/$req_entry/title.txt");
if (file_exists("data/ml-prepend.txt")) {
$ml_prepend = file_get_contents("data/ml-prepend.txt");
@@ -315,17 +355,17 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = file_get_contents("$live_dir/comment.txt");
- $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('<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('&','&',$ml_body);
$ml_body = str_replace('<','<',$ml_body);
$ml_body = str_replace('>','>',$ml_body);
@@ -352,11 +392,11 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
$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_url = "http://$ml_url/index.php?entry=$req_entry&show=comments";
$ml_body = $ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $ml_url;
- if (file_exists("data/items/$entry/member.txt")) {
+ if (file_exists("data/items/$req_entry/member.txt")) {
$ml_body = $ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
}
@@ -368,7 +408,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
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 ($ml_member != "." && $ml_member != "..") {
if (file_exists("data/members/active/$ml_member/noml.txt")) {
continue;
@@ -387,13 +427,13 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
mail($ml_to,$ml_subject,$ml_body,
"From: $ml_from\r\n" .
"Reply-To: $ml_reply2\r\n" .
- "References: $entry\r\n" .
+ "References: $req_entry\r\n" .
"X-Mailer: $ml_mailer");
}
else {
mail($ml_to,$ml_subject,$ml_body,
"From: $ml_from\r\n" .
- "References: $entry\r\n" .
+ "References: $req_entry\r\n" .
"X-Mailer: $ml_mailer");
}
}
@@ -408,7 +448,7 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
rmdirr($comment_dir);
}
- $pending_comment_flag_dir = $entry;
+ $pending_comment_flag_dir = $req_entry;
$fp_comment_count_txt = fopen("data/comments/pending/$pending_comment_flag_dir/count.txt","r");
$comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$pending_comment_flag_dir/count.txt"));
@@ -427,24 +467,24 @@ if (isset($entry) and !empty($entry) and isset($_REQUEST['comment']) and !empty(
fclose($fp_comment_count_txt);
}
- header("Location: index.php?entry=$entry&show=comments");
+ header("Location: index.php?entry=$req_entry&show=comments");
}
}
-if (isset($entry) and !empty($entry)) {
+if (isset($req_entry) and !empty($req_entry)) {
- if (file_exists("data/items/$entry")) {
+ if (file_exists("data/items/$req_entry")) {
- $filter = $entry;
+ $filter = $req_entry;
- $title = file_get_contents("data/items/$entry/title.txt");
+ $title = file_get_contents("data/items/$req_entry/title.txt");
echo "<title>$title</title>";
if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- if (file_exists("data/items/$entry/views.txt")) {
- $count_views = file_get_contents("data/items/$entry/views.txt");
+ if (file_exists("data/items/$req_entry/views.txt")) {
+ $count_views = file_get_contents("data/items/$req_entry/views.txt");
}
else {
$count_views = "0";
@@ -452,55 +492,55 @@ if (isset($entry) and !empty($entry)) {
$count_views = $count_views + 1;
- $fp_views = fopen("data/items/$entry/views.txt","w");
+ $fp_views = fopen("data/items/$req_entry/views.txt","w");
fwrite($fp_views,$count_views);
fclose($fp_views);
}
- if (isset($show) and !empty($show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
+ if (isset($req_show) and !empty($req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- if (!file_exists("data/items/$entry/comments")) {
- mkdir("data/items/$entry/comments");
+ if (!file_exists("data/items/$req_entry/comments")) {
+ mkdir("data/items/$req_entry/comments");
}
- if (!file_exists("data/items/$entry/comments/pending")) {
- mkdir("data/items/$entry/comments/pending");
+ if (!file_exists("data/items/$req_entry/comments/pending")) {
+ mkdir("data/items/$req_entry/comments/pending");
}
- if (!file_exists("data/items/$entry/comments/live")) {
- mkdir("data/items/$entry/comments/live");
+ if (!file_exists("data/items/$req_entry/comments/live")) {
+ mkdir("data/items/$req_entry/comments/live");
}
$timestamp = date("l,M j,Y,g:i A",time() + $offset);
$comment_entry_dir = date("YmdHis",time() + $offset);
- mkdir("data/items/$entry/comments/pending/$comment_entry_dir");
+ mkdir("data/items/$req_entry/comments/pending/$comment_entry_dir");
$body_content = ucfirst($_POST['new_comment']);
$body_content = htmlentities($body_content,ENT_NOQUOTES);
- $body_content = str_replace("\n",'<br />',$body_content);
+ $body_content = str_replace("\n",'<br>',$body_content);
$body_content = trim($body_content);
- $body_content = str_replace(':((','<img src=images/smileys/crying.png border=0>',$body_content);
- $body_content = str_replace(':(','<img src=images/smileys/frown.png border=0>',$body_content);
- $body_content = str_replace(':|','<img src=images/smileys/indifferent.png border=0>',$body_content);
- $body_content = str_replace(':D','<img src=images/smileys/laughing.png border=0>',$body_content);
- $body_content = str_replace(':P','<img src=images/smileys/lick.png border=0>',$body_content);
- $body_content = str_replace(':O','<img src=images/smileys/ohno.png border=0>',$body_content);
- $body_content = str_replace(':)','<img src=images/smileys/smile.png border=0>',$body_content);
- $body_content = str_replace('=)','<img src=images/smileys/surprised.png border=0>',$body_content);
- $body_content = str_replace(':\\','<img src=images/smileys/undecided.png border=0>',$body_content);
- $body_content = str_replace(';)','<img src=images/smileys/wink.png border=0>',$body_content);
-
- $fp_body_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/comment.txt","w");
+ $body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$body_content);
+ $body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$body_content);
+ $body_content = str_replace(':|','<img src="images/smileys/indifferent.png" border="0">',$body_content);
+ $body_content = str_replace(':D','<img src="images/smileys/laughing.png" border="0">',$body_content);
+ $body_content = str_replace(':P','<img src="images/smileys/lick.png" border="0">',$body_content);
+ $body_content = str_replace(':O','<img src="images/smileys/ohno.png" border="0">',$body_content);
+ $body_content = str_replace(':)','<img src="images/smileys/smile.png" border="0">',$body_content);
+ $body_content = str_replace('=)','<img src="images/smileys/surprised.png" border="0">',$body_content);
+ $body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$body_content);
+ $body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$body_content);
+
+ $fp_body_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/comment.txt","w");
fwrite($fp_body_txt,$body_content);
fclose($fp_body_txt);
- $fp_timestamp_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/timestamp.txt","w");
+ $fp_timestamp_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/timestamp.txt","w");
fwrite($fp_timestamp_txt,$timestamp);
fclose($fp_timestamp_txt);
- $fp_firstname_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/firstname.txt","w");
+ $fp_firstname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/firstname.txt","w");
$firstname = strtolower($_POST['firstname']);
$firstname = ucwords($firstname);
$firstname = trim($firstname);
@@ -508,7 +548,7 @@ if (isset($entry) and !empty($entry)) {
fwrite($fp_firstname_txt,$firstname);
fclose($fp_firstname_txt);
- $fp_lastname_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/lastname.txt","w");
+ $fp_lastname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/lastname.txt","w");
$lastname = strtolower($_POST['lastname']);
$lastname = ucwords($lastname);
$lastname = trim($lastname);
@@ -516,7 +556,7 @@ if (isset($entry) and !empty($entry)) {
fwrite($fp_lastname_txt,$lastname);
fclose($fp_lastname_txt);
- $fp_email_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/email.txt","w");
+ $fp_email_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/email.txt","w");
$email = strtolower($_POST['email']);
$email = trim($email);
$email = htmlentities($email,ENT_NOQUOTES);
@@ -524,7 +564,7 @@ if (isset($entry) and !empty($entry)) {
fclose($fp_email_txt);
if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.",$_POST['url']))) {
- $fp_url_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/url.txt","w");
+ $fp_url_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/url.txt","w");
$url = str_replace("http://","",$_POST['url']);
$url = strtolower($url);
$url = trim($url);
@@ -535,13 +575,13 @@ if (isset($entry) and !empty($entry)) {
}
if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $fp_cauthor_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/author.txt","w");
+ $fp_cauthor_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/author.txt","w");
fwrite($fp_cauthor_txt,$_POST['cauthor']);
fclose($fp_cauthor_txt);
}
$key_rand = str_rand(14);
- $fp_key_txt = fopen("data/items/$entry/comments/pending/$comment_entry_dir/key.txt","w");
+ $fp_key_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/key.txt","w");
fwrite($fp_key_txt,$key_rand);
fclose($fp_key_txt);
@@ -567,14 +607,14 @@ if (isset($entry) and !empty($entry)) {
$mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $commented_entry_title_file = "data/items/$entry/title.txt";
+ $commented_entry_title_file = "data/items/$req_entry/title.txt";
$fp_commented_entry_title = fopen($commented_entry_title_file,"r");
$commented_entry_title = fread($fp_commented_entry_title,filesize($commented_entry_title_file));
fclose($fp_commented_entry_title);
if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
- $comment_thanks = "Hi $firstname,\n\nThanks for submitting the following comment last $timestamp:\n\n\"$comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$sig_url}index.php?entry=$entry&show=comments\n\nThanks again! =)\n\n--\n$sig_author\n$sig_url\n";
+ $comment_thanks = "Hi $firstname,\n\nThanks for submitting the following comment last $timestamp:\n\n\"$comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$sig_url}index.php?entry=$req_entry&show=comments\n\nThanks again! =)\n\n--\n$sig_author\n$sig_url\n";
$comment_thanks = wordwrap($comment_thanks);
mail($email_to,"Thanks for sharing your thoughts!",$comment_thanks,
@@ -585,7 +625,7 @@ if (isset($entry) and !empty($entry)) {
if (file_exists("data/email.txt") and !file_exists("data/xscreen.txt")) {
- $comment_notice = "The following comment was submitted by $email_to last $timestamp for the entry \"$commented_entry_title\":\n\n\"$comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$sig_url}index.php?entry=$entry&comment={$comment_entry_dir}&key={$key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$sig_url}index.php?entry=$entry&comment={$comment_entry_dir}&key={$key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
+ $comment_notice = "The following comment was submitted by $email_to last $timestamp for the entry \"$commented_entry_title\":\n\n\"$comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
$comment_notice = wordwrap($comment_notice);
mail($from_email,"Pending Comment",$comment_notice,
@@ -602,7 +642,7 @@ if (isset($entry) and !empty($entry)) {
mkdir("data/comments/pending");
}
- $pending_comment_flag = $entry;
+ $pending_comment_flag = $req_entry;
if (!file_exists("data/comments/pending/$pending_comment_flag")) {
mkdir("data/comments/pending/$pending_comment_flag");
@@ -625,8 +665,8 @@ if (isset($entry) and !empty($entry)) {
else {
echo "<title>$default_title</title>";
- if (isset($archive) and !empty($archive)) {
- $filter = trim($archive) . "*";
+ if (isset($req_archive) and !empty($req_archive)) {
+ $filter = trim($req_archive) . "*";
}
else {
$filter = "*";
@@ -636,35 +676,33 @@ if (isset($entry) and !empty($entry)) {
else {
echo "<title>$default_title</title>";
- if (isset($archive) and !empty($archive)) {
- $filter = trim($archive) . "*";
+ if (isset($req_archive) and !empty($req_archive)) {
+ $filter = trim($req_archive) . "*";
}
else {
$filter = "*";
}
}
-// start: auto-approve comments without rewriting "comment approval system" (20080521)
-
if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
- if ($dh_xscreen_list = opendir("data/comments/pending")) {
+ if ($dh_xscreen_comments = opendir("data/comments/pending")) {
- while (($entry_xscreen = readdir($dh_xscreen_list)) !== false) {
+ while (($xscreen_comment = readdir($dh_xscreen_comments)) !== false) {
- if ($entry_xscreen != "." && $entry_xscreen != "..") {
- $show_xscreen_list[] = $entry_xscreen;
+ if ($xscreen_comment != "." && $xscreen_comment != "..") {
+ $xscreen_comments[] = $xscreen_comment;
}
}
- closedir($dh_xscreen_list);
+ closedir($dh_xscreen_comments);
}
- rsort($show_xscreen_list);
- reset($show_xscreen_list);
+ rsort($xscreen_comments);
+ reset($xscreen_comments);
- if (count($show_xscreen_list) > 0) {
+ if (count($xscreen_comments) > 0) {
- foreach ($show_xscreen_list as $xscreen_dir) {
+ foreach ($xscreen_comments as $xscreen_dir) {
if ($dh_xscreen_pending = opendir("data/items/$xscreen_dir/comments/pending")) {
@@ -683,30 +721,46 @@ if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
}
}
-// end: auto-approve comments without rewriting "comment approval system" (20080521)
-
?>
<?php
-if (isset($entry) and !empty($entry) and file_exists("data/items/$entry")) {
+if (isset($req_entry) and !empty($req_entry) and file_exists("data/items/$req_entry")) {
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$req_entry/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
+
+ while (($entry_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($entry_category != "." && $entry_category != "..") {
+
+ if (file_exists("data/categories/$entry_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
+ }
- $cat_dir = file_get_contents("data/items/$entry/category.txt");
- if (!file_exists("data/categories/$cat_dir/private.txt")) {
+ if ($private_categories == "0") {
- if (!file_exists("data/items/$entry/passwd.txt")) {
+ if (!file_exists("data/items/$req_entry/passwd.txt")) {
- if (!file_exists("data/items/$entry/private.txt")) {
+ if (!file_exists("data/items/$req_entry/private.txt")) {
- $description = file_get_contents("data/items/$entry/body.txt");
+ $description = file_get_contents("data/items/$req_entry/body.txt");
$description = strip_tags($description);
$description = html_entity_decode($description);
$description = str_replace("&","&",$description);
$description = str_replace("<","<",$description);
$description = str_replace(">",">",$description);
$description = str_replace("<br>"," ",$description);
- $description = str_replace("<br />"," ",$description);
+ $description = str_replace("<br>"," ",$description);
$description = str_replace("\r"," ",$description);
$description = str_replace("\n"," ",$description);
$description = str_replace(chr(10)," ",$description);
@@ -975,14 +1029,14 @@ a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
echo "{$font_panel_footer},";
}
?> arial,helvetica,sans-serif;
- font-size: 11px;
+ font-size: 10px;
color: <?php
if (file_exists("data/colors/pf-font.txt")) {
$panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
echo $panel_footer_font_color;
}
else {
- echo "#666666";
+ echo "#999999";
}
?>;
<?php
@@ -1303,6 +1357,60 @@ a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
?>
}
+#panel_category {
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$font_panel_category},";
+ }
+ ?> arial,helvetica,sans-serif;
+ font-size: 10px;
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $panel_category_font_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?>;
+
+ padding: 5px 5px 5px 5px;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $panel_category_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ margin: 0px 0px 0px 0px;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $panel_category_border_color = file_get_contents("data/colors/border.txt");
+ echo $panel_category_border_color;
+ }
+ else {
+ echo "#cccccc";
+ }
+ ?>;
+ <?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;';
+ }
+ ?>
+ text-align: left;
+}
+
<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
</style>
@@ -1421,7 +1529,7 @@ else {
Navigation</div>
<div id="panel_body">
-<a class="navlink" href="<?php echo $_SERVER['PHP_SELF']; ?>">Home</a><br>
+<a class="navlink" href="index.php">Home</a><br>
<?php
@@ -1440,14 +1548,14 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.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']}/categories/$req_category")) {
+
+ if (!file_exists("data/categories/$req_category")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/categories/$req_category");
}
}
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") or file_exists("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']}/categories/$req_category")) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -1476,35 +1584,52 @@ else {
if (file_exists("data/sticky")) {
- if ($dh_sticky_list = opendir("data/sticky")) {
+ if ($dh_sticky = opendir("data/sticky")) {
- while (($entry_sticky_list = readdir($dh_sticky_list)) !== false) {
+ while (($sticky_entry = readdir($dh_sticky)) !== false) {
- if (file_exists("data/items/$entry_sticky_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$sticky_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
continue;
}
- if (file_exists("data/items/$entry_sticky_list/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$sticky_entry/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
- $get_cat_dir = file_get_contents("data/items/$entry_sticky_list/category.txt");
+ $private_categories = "0";
+
+ if (file_exists("data/items/$sticky_entry/categories")) {
+
+ if ($dh_sticky_categories = opendir("data/items/$sticky_entry/categories")) {
+
+ while (($sticky_category = readdir($dh_sticky_categories)) !== false) {
+
+ if ($sticky_category != "." && $sticky_category != "..") {
+
+ if (file_exists("data/categories/$sticky_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_sticky_categories);
+ }
+ }
- if (file_exists("data/categories/$get_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_sticky_list/cat.txt")) {
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$sticky_entry/cat.txt")) {
continue;
}
- if ($entry_sticky_list != "." && $entry_sticky_list != ".." && fnmatch("*",$entry_sticky_list)) {
- $show_sticky_list[] = $entry_sticky_list;
+ if ($sticky_entry != "." && $sticky_entry != "..") {
+ $sticky_entries[] = $sticky_entry;
}
}
- closedir($dh_sticky_list);
+ closedir($dh_sticky);
}
- sort($show_sticky_list);
- reset($show_sticky_list);
+ sort($sticky_entries);
+ reset($sticky_entries);
- $count_sticky_list = count($show_sticky_list);
+ $count_sticky_list = count($sticky_entries);
if ($count_sticky_list > 0) {
@@ -1518,8 +1643,8 @@ if (file_exists("data/sticky")) {
echo 'Quick Links</div>';
echo '<div id="panel_body">';
- foreach ($show_sticky_list as $sticky_list_entry) {
- echo "<a class=\"navlink\" href=\"{$_SERVER['PHP_SELF']}?entry=$sticky_list_entry\">";
+ foreach ($sticky_entries as $sticky_list_entry) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$sticky_list_entry\">";
readfile("data/items/$sticky_list_entry/title.txt");
echo "</a><br>";
}
@@ -1538,54 +1663,80 @@ if (file_exists("data/sticky")) {
if (file_exists("data/panels")) {
- if ($dh_panel_list = opendir("data/panels")) {
+ if ($dh_panels = opendir("data/panels")) {
- while (($entry_panel_list = readdir($dh_panel_list)) !== false) {
+ while (($panel = readdir($dh_panels)) !== false) {
- if (file_exists("data/panels/$entry_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ if ($panel != "." && $panel != "..") {
- if (file_exists("data/panels/$entry_panel_list/right.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/center.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/top.txt")) {
+ $top_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/top.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/center.txt")) {
+ $center_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/panels/$entry_panel_list/entry.txt")) {
- continue;
- }
+ if (file_exists("data/panels/$panel/entry.txt")) {
+ $entry_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $entry_panel_list)) {
- continue;
- }
+ if (file_exists("data/panels/$panel/right.txt")) {
+ $right_panels[] = $panel;
+ continue;
+ }
- if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $entry_panel_list)) {
- continue;
- }
+ if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $panel)) {
+ continue;
+ }
+
+ if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $panel)) {
+ continue;
+ }
- if ($entry_panel_list != "." && $entry_panel_list != ".." && fnmatch("*",$entry_panel_list)) {
- $show_panel_list[] = $entry_panel_list;
+ $left_panels[] = $panel;
}
}
- closedir($dh_panel_list);
+ closedir($dh_panels);
}
- sort($show_panel_list);
- reset($show_panel_list);
- $count_panel_list = count($show_panel_list);
-
- if ($count_panel_list > 0) {
+ sort($left_panels);
+ reset($left_panels);
+
+ $count_left_panels = count($left_panels);
+
+ sort($top_panels);
+ reset($top_panels);
+
+ $count_top_panels = count($top_panels);
+
+ sort($center_panels);
+ reset($center_panels);
+
+ $count_center_panels = count($center_panels);
+
+ sort($entry_panels);
+ reset($entry_panels);
+
+ $count_entry_panels = count($entry_panels);
- foreach ($show_panel_list as $panel_list_entry) {
+ sort($right_panels);
+ reset($right_panels);
- if (!file_exists("data/panels/$panel_list_entry/free.txt")) {
+ $count_right_panels = count($right_panels);
+
+ if ($count_left_panels > 0) {
+
+ foreach ($left_panels as $left_panel) {
+
+ if (!file_exists("data/panels/$left_panel/free.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">';
@@ -1594,29 +1745,29 @@ if (file_exists("data/panels")) {
echo '<div id="panel_title">';
}
- readfile("data/panels/$panel_list_entry/title.txt");
+ readfile("data/panels/$left_panel/title.txt");
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$panel_list_entry}>";
+ echo "<a href=panels.php#{$left_panel}>";
echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
- if (file_exists("data/panels/$panel_list_entry/private.txt")) {
+ if (file_exists("data/panels/$left_panel/private.txt")) {
echo '<img src=images/widget.private.png border=0 width=11 height=11 align=right>';
}
echo '</div><div id=panel_body>';
}
- if (file_exists("data/panels/$panel_list_entry/free.txt")) {
+ if (file_exists("data/panels/$left_panel/free.txt")) {
echo '<div id=panel_free>';
}
- include("data/panels/$panel_list_entry/panel.php");
+ include("data/panels/$left_panel/panel.php");
echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$panel_list_entry/free.txt")) {
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$left_panel/free.txt")) {
echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
}
}
@@ -1629,407 +1780,440 @@ if (file_exists("data/panels")) {
<td valign=top width=<?php if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) { echo "610"; } else { echo "525"; } ?>>
<?php
-if (file_exists("data/panels")) {
-
- if ($dh_top_panel_list = opendir("data/panels")) {
+
+if ($count_top_panels > 0) {
- while (($entry_top_panel_list = readdir($dh_top_panel_list)) !== false) {
+ foreach ($top_panels as $top_panel) {
- if (file_exists("data/panels/$entry_top_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ if (!file_exists("data/panels/$top_panel/free.txt")) {
- if (!file_exists("data/panels/$entry_top_panel_list/top.txt")) {
- continue;
+ 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">';
}
-
- if ($entry_top_panel_list != "." && $entry_top_panel_list != ".." && fnmatch("*",$entry_top_panel_list)) {
- $show_top_panel_list[] = $entry_top_panel_list;
+ else {
+ echo '<div id="panel_title">';
}
- }
- closedir($dh_top_panel_list);
- }
- sort($show_top_panel_list);
- reset($show_top_panel_list);
-
- $count_top_panel_list = count($show_top_panel_list);
-
- if ($count_top_panel_list > 0) {
-
- foreach ($show_top_panel_list as $top_panel_list_entry) {
-
- if (!file_exists("data/panels/$top_panel_list_entry/free.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 id="panel_title">';
- }
-
- readfile("data/panels/$top_panel_list_entry/title.txt");
-
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$top_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
- }
+ readfile("data/panels/$top_panel/title.txt");
- echo '</div><div id=panel_body>';
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+ echo "<a href=panels.php#{$top_panel}>";
+ echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
- if (file_exists("data/panels/$top_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
- }
+ echo '</div><div id=panel_body>';
+ }
- include("data/panels/$top_panel_list_entry/panel.php");
+ if (file_exists("data/panels/$top_panel/free.txt")) {
+ echo '<div id=panel_free>';
+ }
- echo '</div>';
+ include("data/panels/$top_panel/panel.php");
- if (file_exists("data/round.txt") and !file_exists("data/panels/$top_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
+ echo '</div>';
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$top_panel/free.txt")) {
+ echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
}
}
}
+
?>
<?php
-if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($entry) and !isset($category) and !isset($_REQUEST['start']) and !isset($_REQUEST['author']) and !isset($archive) and !isset($_REQUEST['find'])) {
+// clean-up (start)
- if ($dh_latest_post_items = opendir("data/items")) {
+if (file_exists("data/albums")) {
+ rmdirr("data/albums");
+}
- while (($entry_latest_post_items = readdir($dh_latest_post_items)) !== false) {
-
- $today = date("YmdHis",time() + $offset);
-
- if (($entry_latest_post_items > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if (file_exists("data/items/$entry_latest_post_items/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- $cat_dir = file_get_contents("data/items/$entry_latest_post_items/category.txt");
-
- if (file_exists("data/categories/$cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_latest_post_items/cat.txt")) {
- continue;
- }
-
- if ($entry_latest_post_items != "." && $entry_latest_post_items != ".." && fnmatch("*",$entry_latest_post_items)) {
- $show_latest_post_items[] = $entry_latest_post_items;
- }
- }
- closedir($dh_latest_post_items);
- }
+// clean-up (end)
- rsort($show_latest_post_items);
- reset($show_latest_post_items);
+// global entry items (start)
- $count_latest_post_items = count($show_latest_post_items);
+if ($dh_items = opendir("data/items")) {
- if ($count_latest_post_items > 0) {
+ while (($item = readdir($dh_items)) !== false) {
- 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 id="panel_title">';
- }
+ if ($item != "." && $item != "..") {
- echo "Latest Entries</div><div id=panel_body>";
- echo "<table border=0 cellspacing=1 cellpadding=2 bgcolor=#cccccc width=100%>";
- echo "<tr><td bgcolor=#eeeeee align=center><p>topic</p></td><td bgcolor=#eeeeee align=center><p>author</p></td><td bgcolor=#eeeeee align=center><p>views</p></td><td bgcolor=#eeeeee align=center><p>comments</p></td><td bgcolor=#eeeeee align=center><p>last post</p></td></tr>";
+ if (file_exists("data/items/$item/comments/live") and (count(glob("data/items/$item/comments/live/*")) < 1)) {
+ rmdirr("data/items/$item/comments/live");
+ }
- $increment_latest_post_entries = 0;
- $show_latest_post_entries = 5;
+ if (file_exists("data/items/$item/comments/pending") and (count(glob("data/items/$item/comments/pending/*")) < 1)) {
+ rmdirr("data/items/$item/comments/pending");
+ }
- while ($increment_latest_post_entries <= $show_latest_post_entries) {
+ if (file_exists("data/items/$item/comments") and (count(glob("data/items/$item/comments/*")) < 1)) {
+ rmdirr("data/items/$item/comments");
+ }
- echo '<tr><td bgcolor=#ffffff><a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $show_latest_post_items[$increment_latest_post_entries];
+ if (file_exists("data/items/$item/filedrop/files") and (count(glob("data/items/$item/filedrop/files/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop/files");
+ }
- if ($dh_summary_comments = opendir("data/items/$show_latest_post_items[$increment_latest_post_entries]/comments/live")) {
+ if (file_exists("data/items/$item/filedrop/count") and (count(glob("data/items/$item/filedrop/count/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop/count");
+ }
- while (($entry_summary_comments = readdir($dh_summary_comments)) !== false) {
+ if (file_exists("data/items/$item/filedrop") and (count(glob("data/items/$item/filedrop/*")) < 1)) {
+ rmdirr("data/items/$item/filedrop");
+ }
- if ($entry_summary_comments != "." && $entry_summary_comments != ".." && fnmatch("*",$entry_summary_comments)) {
- $items_summary_comments[] = $entry_summary_comments;
- }
- }
- closedir($dh_summary_comments);
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/captions") and (count(glob("data/items/$item/album/captions/*")) < 1)) {
+ rmdirr("data/items/$item/album/captions");
}
- rsort($items_summary_comments);
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/count") and (count(glob("data/items/$item/album/count/*")) < 1)) {
+ rmdirr("data/items/$item/album/count");
+ }
- $summary_comments = count($items_summary_comments);
-
- if ($summary_comments > 0) {
- echo '&show=comments';
+ if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album") and (count(glob("data/items/$item/album/*")) < 1)) {
+ rmdirr("data/items/$item/album");
}
-
- echo '>';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/title.txt");
- echo '</a></td>';
- echo '<td bgcolor=#ffffff><a href=member.php?id=';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/author.txt");
- echo '>';
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/author.txt");
- echo '</a></td>';
- echo '<td bgcolor=#ffffff align=right>';
-
- if (!file_exists("data/items/$show_latest_post_items[$increment_latest_post_entries]/views.txt")) {
- echo 0;
+
+ if (file_exists("images/$item/album") and (count(glob("images/$item/album/*")) < 1)) {
+ rmdirr("images/$item/album");
}
- else {
- readfile("data/items/$show_latest_post_items[$increment_latest_post_entries]/views.txt");
+
+ if (file_exists("images/$item") and (count(glob("images/$item/*")) < 1)) {
+ rmdirr("images/$item");
}
-
- echo '</td>';
- if ($summary_comments < 1) {
+ if (file_exists("images/$item/categories") and (count(glob("images/$item/categories/*")) < 1)) {
+ rmdirr("images/$item/categories");
+ }
- $iso_year = substr($show_latest_post_items[$increment_latest_post_entries],0,4);
- $iso_month = substr($show_latest_post_items[$increment_latest_post_entries],4,2);
- $iso_day = substr($show_latest_post_items[$increment_latest_post_entries],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+ $grand[] = $item;
- echo "<td bgcolor=#ffffff align=right><p>0</p></td>";
- echo "<td bgcolor=#ffffff align=right><p>$iso_last</p></td>";
- }
- else {
- $iso_year = substr($items_summary_comments[0],0,4);
- $iso_month = substr($items_summary_comments[0],4,2);
- $iso_day = substr($items_summary_comments[0],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<td bgcolor=#ffffff align=right><p>$summary_comments</p></td>";
- echo "<td bgcolor=#ffffff align=right><p>$iso_last</p></td>";
- }
+ if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
- unset($items_summary_comments);
+ if (isset($req_entry) and file_exists("data/items/$req_entry")) {
+ $items[] = $req_entry;
+ }
- $increment_latest_post_entries = $increment_latest_post_entries + 1;
- }
- }
+ if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
+ $items[] = $item;
+ }
- if ($count_latest_post_items > 0) {
+ if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
+ $items[] = $item;
+ }
- echo "</table></div>";
+ if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
+ $items[] = $item;
+ }
- 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($req_find)) {
-}
+ if ((($req_find == "private") or ($req_find == "member") or ($req_find == "passwd")) and file_exists("data/items/$item/{$req_find}.txt")) {
+ $items[] = $item;
+ }
-?>
+ if ((($req_find == "comments") or ($req_find == "filedrop") or ($req_find == "album")) and file_exists("data/items/$item/$req_find")) {
+ $items[] = $item;
+ }
-<?php
+ if (($req_find == "unfiled") and !file_exists("data/items/$item/categories")) {
+ $items[] = $item;
+ }
+ }
+ }
+ else {
+ $items[] = $item;
+ }
-if (file_exists("data/panels")) {
+ $latest[] = $item;
- if ($dh_center_panel_list = opendir("data/panels")) {
+ if (file_exists("data/items/$item/album")) {
+ $albums[] = $item;
+ }
- while (($entry_center_panel_list = readdir($dh_center_panel_list)) !== false) {
+ $random[] = $item;
- if (file_exists("data/panels/$entry_center_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ $archives[] = substr($item,0,6);
}
+ else {
- if (!file_exists("data/panels/$entry_center_panel_list/center.txt")) {
- continue;
- }
+ // non-admin stuff (start)
- if ($entry_center_panel_list != "." && $entry_center_panel_list != ".." && fnmatch("*",$entry_center_panel_list)) {
- $show_center_panel_list[] = $entry_center_panel_list;
- }
- }
- closedir($dh_center_panel_list);
- }
-
- sort($show_center_panel_list);
- reset($show_center_panel_list);
-
- $count_center_panel_list = count($show_center_panel_list);
+ $today = date("YmdHis",time() + $offset);
- if ($count_center_panel_list > 0) {
+ if ($item > $today) {
+ continue;
+ }
- foreach ($show_center_panel_list as $center_panel_list_entry) {
+ if (file_exists("data/items/$item/private.txt")) {
+ continue;
+ }
- if (!file_exists("data/panels/$center_panel_list_entry/free.txt")) {
+ if (file_exists("data/items/$item/member.txt") and (!isset($_SESSION['logged_in']))) {
+ continue;
+ }
- 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">';
+ $private_categories = "0";
+
+ if (file_exists("data/items/$item/categories")) {
+
+ if ($dh_entry_categories = opendir("data/items/$item/categories")) {
+
+ while (($item_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($item_category != "." && $item_category != "..") {
+
+ if (file_exists("data/categories/$item_category/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories);
+ }
}
- else {
- echo '<div id="panel_title">';
+
+ if (($private_categories > 0) and !file_exists("data/items/$item/cat.txt")) {
+ continue;
}
- readfile("data/panels/$center_panel_list_entry/title.txt");
+ $latest[] = $item;
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$center_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+ if (file_exists("data/nocat.txt") and file_exists("data/items/$item/categories") and !file_exists("data/items/$item/cat.txt") and (!isset($req_category) or empty($req_category)) and (!isset($req_entry) or empty($req_entry)) and (!isset($req_author) or empty($req_author))) {
+ continue;
}
- echo '</div><div id=panel_body>';
- }
+ if (file_exists("data/items/$item/album")) {
+ $albums[] = $item;
+ }
- if (file_exists("data/panels/$center_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
- }
+ $random[] = $item;
+ $archives[] = substr($item,0,6);
- include("data/panels/$center_panel_list_entry/panel.php");
+ if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
+
+ if (isset($req_entry) and file_exists("data/items/$req_entry")) {
+ $items[] = $req_entry;
+ }
- echo '</div>';
+ if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
+ $items[] = $item;
+ }
- if (file_exists("data/round.txt") and !file_exists("data/panels/$center_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
+ $items[] = $item;
+ }
+
+ if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
+ $items[] = $item;
+ }
+ }
+ else {
+ $items[] = $item;
+ }
+
+ // non-admin stuff (end)
}
}
}
+ closedir($dh_items);
}
+
+sort($grand);
+reset($grand);
+
+$count_grand = count($grand);
+
+$items = array_unique($items);
+$items = array_values($items);
+
+if (file_exists("data/old.txt")) {
+ sort($items);
+}
+else {
+ rsort($items);
+}
+
+reset($items);
+
+$count_items = count($items);
+
+rsort($latest);
+reset($latest);
+
+$count_latest = count($latest);
+
+rsort($albums);
+reset($albums);
+
+$count_albums = count($albums);
+
+rsort($random);
+reset($random);
+
+$count_random = count($random);
+
+rsort($archives);
+reset($archives);
+
+$count_archives = count($archives);
+
?>
<?php
-if (is_dir("data/items")) {
- if ($dh = opendir("data/items")) {
- while (($entry_main = readdir($dh)) !== false) {
+if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($req_entry) and !isset($req_category) and !isset($_REQUEST['start']) and !isset($req_author) and !isset($req_archive) and !isset($req_find)) {
- if ($entry_main != "." && $entry_main != "..") {
- $grand[] = $entry_main;
- }
+ if ($count_latest > 0) {
- $today = date("YmdHis",time() + $offset);
+ 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 id="panel_title">';
+ }
- if (($entry_main > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ echo "Latest Entries</div><div id=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>";
- if (file_exists("data/items/$entry_main/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ $increment_latest = 0;
+
+ while ($increment_latest <= 4) {
+
+ echo "<tr><td bgcolor=\"#ffffff\"><a href=\"index.php?entry=$latest[$increment_latest]";
+
+ if ($dh_summary_comments = opendir("data/items/$latest[$increment_latest]/comments/live")) {
+
+ while (($change_me_summary_comments = readdir($dh_summary_comments)) !== false) {
+
+ if ($change_me_summary_comments != "." && $change_me_summary_comments != "..") {
+ $items_summary_comments[] = $change_me_summary_comments;
+ }
+ }
+ closedir($dh_summary_comments);
}
- if (file_exists("data/items/$entry_main/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
+ rsort($items_summary_comments);
+
+ $summary_comments = count($items_summary_comments);
+
+ if ($summary_comments > 0) {
+ echo "&show=comments";
}
+
+ echo "\">";
+ readfile("data/items/$latest[$increment_latest]/title.txt");
+ echo "</a></td>";
+
+ echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
+ readfile("data/items/$latest[$increment_latest]/author.txt");
+ echo "\">";
+ readfile("data/items/$latest[$increment_latest]/author.txt");
+ echo "</a></td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">";
+
+ if (!file_exists("data/items/$latest[$increment_latest]/views.txt")) {
+ echo 0;
+ }
+ else {
+ readfile("data/items/$latest[$increment_latest]/views.txt");
+ }
+
+ echo "</td>";
- $cat_dir = file_get_contents("data/items/$entry_main/category.txt");
+ if ($summary_comments < 1) {
- if (file_exists("data/categories/$cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_main/cat.txt")) {
- continue;
+ $iso_year = substr($latest[$increment_latest],0,4);
+ $iso_month = substr($latest[$increment_latest],4,2);
+ $iso_day = substr($latest[$increment_latest],6,2);
+ $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
+
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">0</td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
}
+ else {
+ $iso_year = substr($items_summary_comments[0],0,4);
+ $iso_month = substr($items_summary_comments[0],4,2);
+ $iso_day = substr($items_summary_comments[0],6,2);
+ $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
- if (file_exists("data/nocat.txt") and file_exists("data/items/$entry_main/category.txt") and !file_exists("data/items/$entry_main/cat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($category) or empty($category)) and (!isset($entry) or empty($entry)) and (!isset($_REQUEST['author']) or empty($_REQUEST['author']))) {
- continue;
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$summary_comments</td>";
+ echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
}
+
+ unset($items_summary_comments);
- if ($entry_main != "." && $entry_main != ".." && fnmatch($filter,$entry_main)) {
+ $increment_latest = $increment_latest + 1;
+ }
+ }
- if (isset($category) and !empty($category) and file_exists("data/categories/{$category}")) {
+ if ($count_latest > 0) {
- if (file_exists("data/items/$entry_main/category.txt") and (file_get_contents("data/items/$entry_main/category.txt") == "$category")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['author']) and !empty($_REQUEST['author']) and file_exists("data/members/active/{$_REQUEST['author']}") and file_exists("data/bb.txt")) {
+ echo "</table></div>";
- if (file_exists("data/items/$entry_main/author.txt") and (file_get_contents("data/items/$entry_main/author.txt") == $_REQUEST['author'])) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['author']) and !empty($_REQUEST['author']) and !file_exists("data/members/active/{$_REQUEST['author']}") and (file_get_contents("data/username.txt") == $_REQUEST['author']) and file_exists("data/bb.txt")) {
+ 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/items/$entry_main/author.txt") and (file_get_contents("data/items/$entry_main/author.txt") == $_REQUEST['author'])) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "private")) {
- if (file_exists("data/items/$entry_main/private.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
+}
- if (file_exists("data/items/$entry_main/member.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
+?>
- if (file_exists("data/items/$entry_main/passwd.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
- if (!file_exists("data/items/$entry_main/category.txt")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+<?php
- if (count(glob("data/items/$entry_main/comments/live/*")) === 0) {
- rmdir("data/items/$entry_main/comments/live");
- }
+if ($count_center_panels > 0) {
- if (file_exists("data/items/$entry_main/comments/live")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "filedrop")) {
+ foreach ($center_panels as $center_panel) {
- if (count(glob("data/items/$entry_main/filedrop/*")) === 0) {
- rmdir("data/items/$entry_main/filedrop");
- }
+ if (!file_exists("data/panels/$center_panel/free.txt")) {
- if (file_exists("data/items/$entry_main/filedrop")) {
- $items[] = $entry_main;
- }
- }
- elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
+ 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 id="panel_title">';
+ }
- if (file_exists("images/$entry_main/album")) {
- $items[] = $entry_main;
- }
- }
- else {
- $items[] = $entry_main;
- }
+ readfile("data/panels/$center_panel/title.txt");
+
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+ echo "<a href=panels.php#{$center_panel}>";
+ echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
}
+
+ echo '</div><div id=panel_body>';
}
- closedir($dh);
- }
-}
-if (!file_exists("data/old.txt")) {
- rsort($items);
-}
+ if (file_exists("data/panels/$center_panel/free.txt")) {
+ echo '<div id=panel_free>';
+ }
-if (file_exists("data/old.txt")) {
- sort($items);
+ include("data/panels/$center_panel/panel.php");
+
+ echo '</div>';
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$center_panel/free.txt")) {
+ echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ }
+ }
}
-if (isset($category) and !empty($category)) {
+?>
- $category = str_replace(" ","-",$category);
- $category = strtolower($category);
- $category = strip_tags($category);
+<?php
- if (file_exists("data/categories/$category/book.txt")) {
+if (isset($req_category) and !empty($req_category)) {
+
+ if (file_exists("data/categories/$req_category/book.txt")) {
sort($items);
+ reset($items);
}
}
-reset($items);
-
-sort($grand);
-reset($grand);
-
-if (count($items) == 0) {
+if ($count_items == 0) {
echo '<table border=0 cellspacing=0 cellpadding=0 bgcolor=#cccccc style="background-color: transparent;"><tr><td width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2050,7 +2234,7 @@ if (count($items) == 0) {
echo "Oops!</div><div id=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 ((count($grand) == 0) and (count($_GET) == 0)) {
+ if (($count_grand == 0) and (count($_GET) == 0)) {
echo "No entries found. Perhaps this is a fresh install.";
}
else {
@@ -2077,100 +2261,74 @@ if (!isset($_REQUEST['start']) or empty($_REQUEST['start'])) {
$start = 0;
}
-$end=$start+$increase;
+$end = $start + $increase;
-$disp=array_slice($items,$start,$increase);
+$disp = array_slice($items,$start,$increase);
foreach ($disp as $d) {
- if (file_exists("data/items/$d/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("data/items/$d/category.txt");
- if (!file_exists($category_check)) {
- unlink("data/items/$d/category.txt");
- }
- }
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"";
- if (file_exists("data/items/$d/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if (file_exists("data/items/$d/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
-
- echo '<table border=0 cellspacing=0 cellpadding=0 bgcolor=#cccccc style="background-color: transparent;"><tr><td width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
echo "610";
}
else {
echo "525";
}
- echo '>';
+ echo "\">";
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">';
+ 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 id="panel_title">';
+ echo "<div id=\"panel_title\">";
}
readfile("data/items/$d/title.txt");
- // start of wiki mod (20071130)
-
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$d/edit.txt") or (file_get_contents("data/items/$d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and !file_exists("data/items/$d/passwd.txt")) {
if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=wiki.php?entry=$d>";
- echo "<img src=images/widget.back.png border=0 width=11 height=11 align=right alt=revisions>";
+ echo "<a href=\"wiki.php?entry=$d\">";
+ echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
echo "</a>";
}
-
- echo '<a href=edit.php?entry=';
- echo $d;
- echo '><img src=images/widget.edit.png border=0 width=11 height=11 align=right alt="edit entry"></a>';
+ echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
}
- // end of wiki mod (20071130)
-
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $d;
- echo '><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete entry"></a>';
+ echo "<a href=\"del.php?entry=$d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("data/items/$d/private.txt") and !file_exists("data/items/$d/category.txt") and file_exists("data/bb.txt") and (count(glob("data/items/$d/comments/live/*")) === 0) and (count(glob("data/items/$d/comments/pending/*")) === 0)) {
- echo '<a href=move.php?entry=';
- echo $d;
- echo '><img src=images/widget.move.png border=0 width=11 height=11 align=right alt="move to comment"></a>';
+ if (!file_exists("data/items/$d/private.txt") and !file_exists("data/items/$d/categories") and file_exists("data/bb.txt") and (count(glob("data/items/$d/comments/live/*")) === 0) and (count(glob("data/items/$d/comments/pending/*")) === 0)) {
+ echo "<a href=\"move.php?entry=$d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
}
-
if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=wiki.php?entry=$d>";
- echo "<img src=images/widget.back.png border=0 width=11 height=11 align=right alt=revisions>";
- echo "</a>";
+ echo "<a href=\"wiki.php?entry=$d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
}
- echo '<a href=edit.php?entry=';
- echo $d;
- echo '><img src=images/widget.edit.png border=0 width=11 height=11 align=right alt="edit entry"></a>';
+ echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
+
if (file_exists("data/items/$d/passwd.txt")) {
- echo '<img src=images/widget.protected.png border=0 width=11 height=11 align=right alt="protected entry">';
+ echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
}
if (file_exists("data/items/$d/private.txt")) {
- echo '<img src=images/widget.private.png border=0 width=11 height=11 align=right alt="private entry">';
+ echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
}
+
if (file_exists("data/items/$d/member.txt")) {
- echo '<img src=images/widget.member.png border=0 width=11 height=11 align=right alt="member-only entry">';
+ echo "<img src=\"images/widget.member.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"members-only entry\">";
}
+
if (file_exists("data/items/$d/cat.txt")) {
- echo '<img src=images/widget.cat.png border=0 width=11 height=11 align=right alt="always display">';
+ echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
}
- if (file_exists("data/items/$d/category.txt")) {
- $read_cat_dir = file_get_contents("data/items/$d/category.txt");
+ if (file_exists("data/items/$d/categories/$req_category")) {
+
+ $read_cat_dir = file_get_contents("data/items/$d/categories/$req_category");
if (file_exists("data/categories/$read_cat_dir/private.txt")) {
echo '<img src=images/widget.hidden.png border=0 width=11 height=11 align=right alt="category hidden">';
@@ -2185,20 +2343,26 @@ foreach ($disp as $d) {
}
echo '<img src=images/widget.filed.png border=0 width=11 height=11 align=right alt="filed under ';
- readfile("data/items/$d/category.txt");
+ readfile("data/items/$d/categories/$req_category");
echo '">';
}
}
- echo '</div><div id=panel_entry_body><table border=0 cellspacing=0 cellpadding=0><tr>';
+ echo "</div><div id=\"panel_entry_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/author.txt")) {
- echo "<td width=85 valign=top><p>";
+
+ echo "<td width=\"85\" valign=\"top\">";
+
$author = file_get_contents("data/items/$d/author.txt");
- echo "<a href=member.php?id=$author>";
+
+ echo "<a href=\"member.php?id=$author\">";
+
if ((file_get_contents("data/username.txt") == $author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
if (file_exists("images/avatar.gif")) {
+
$avatar_gif_image_size = getimagesize("images/avatar.gif");
$avatar_gif_image_width = $avatar_gif_image_size[0];
$avatar_gif_image_height = $avatar_gif_image_size[1];
@@ -2210,13 +2374,11 @@ foreach ($disp as $d) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
}
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $avatar_gif_image_width;
- echo " height=";
- echo $avatar_gif_image_height;
+ echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
}
+
if (file_exists("images/avatar.jpg")) {
+
$avatar_jpg_image_size = getimagesize("images/avatar.jpg");
$avatar_jpg_image_width = $avatar_jpg_image_size[0];
$avatar_jpg_image_height = $avatar_jpg_image_size[1];
@@ -2228,13 +2390,11 @@ foreach ($disp as $d) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
}
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $avatar_jpg_image_width;
- echo " height=";
- echo $avatar_jpg_image_height;
+ echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
}
+
if (file_exists("images/avatar.png")) {
+
$avatar_png_image_size = getimagesize("images/avatar.png");
$avatar_png_image_width = $avatar_png_image_size[0];
$avatar_png_image_height = $avatar_png_image_size[1];
@@ -2247,15 +2407,14 @@ foreach ($disp as $d) {
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
}
- echo "<img src=images/avatar.png border=0 width=";
- echo $avatar_png_image_width;
- echo " height=";
- echo $avatar_png_image_height;
+ echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
}
- echo "><br>";
+ echo "<br>";
}
elseif (file_exists("images/members/$author/avatar.jpg") or file_exists("images/members/$author/avatar.gif") or file_exists("images/members/$author/avatar.png")) {
+
if (file_exists("images/members/$author/avatar.gif")) {
+
$avatar_gif_image_size = getimagesize("images/members/$author/avatar.gif");
$avatar_gif_image_width = $avatar_gif_image_size[0];
$avatar_gif_image_height = $avatar_gif_image_size[1];
@@ -2267,13 +2426,11 @@ foreach ($disp as $d) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
}
-
- echo "<img src=images/members/$author/avatar.gif border=0 width=";
- echo $avatar_gif_image_width;
- echo " height=";
- echo $avatar_gif_image_height;
+ echo "<img src=\"images/members/$author/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
}
+
if (file_exists("images/members/$author/avatar.jpg")) {
+
$avatar_jpg_image_size = getimagesize("images/members/$author/avatar.jpg");
$avatar_jpg_image_width = $avatar_jpg_image_size[0];
$avatar_jpg_image_height = $avatar_jpg_image_size[1];
@@ -2285,13 +2442,11 @@ foreach ($disp as $d) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
}
-
- echo "<img src=images/members/$author/avatar.jpg border=0 width=";
- echo $avatar_jpg_image_width;
- echo " height=";
- echo $avatar_jpg_image_height;
+ echo "<img src=\"images/members/$author/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
}
+
if (file_exists("images/members/$author/avatar.png")) {
+
$avatar_png_image_size = getimagesize("images/members/$author/avatar.png");
$avatar_png_image_width = $avatar_png_image_size[0];
$avatar_png_image_height = $avatar_png_image_size[1];
@@ -2304,14 +2459,13 @@ foreach ($disp as $d) {
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
}
- echo "<img src=images/members/$author/avatar.png border=0 width=";
- echo $avatar_png_image_width;
- echo " height=";
- echo $avatar_png_image_height;
+ echo "<img src=\"images/members/$author/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
}
- echo "><br>";
+ echo "<br>";
}
+
echo "<b>$author</b></a><br>";
+
if ((file_get_contents("data/username.txt") == $author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
@@ -2323,50 +2477,69 @@ foreach ($disp as $d) {
echo "member<br>";
}
- if ($dh_posts = opendir("data/items")) {
- while (($entry_posts = readdir($dh_posts)) !== false) {
+ if ($dh_author_posts = opendir("data/items")) {
- if (file_exists("data/items/$entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ while (($author_post = readdir($dh_author_posts)) !== false) {
- // hide_member (20070606)
- //if (file_exists("data/items/$entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- // continue;
- //}
+ if ($author_post != "." && $author_post != "..") {
- $post_cat_dir = file_get_contents("data/items/$entry_posts/category.txt");
+ if (file_exists("data/items/$author_post/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
- if (file_exists("data/categories/$post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_posts/cat.txt")) {
- continue;
- }
+ $private_categories = "0";
+
+ if (file_exists("data/items/$author_post/categories")) {
+
+ if ($dh_entry_categories_posts = opendir("data/items/$author_post/categories")) {
+
+ while (($entry_category_posts = readdir($dh_entry_categories_posts)) !== false) {
+
+ if ($entry_category_posts != "." && $entry_category_posts != "..") {
+
+ if (file_exists("data/categories/$entry_category_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_entry_categories_posts);
+ }
+ }
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$author_post/cat.txt")) {
+ continue;
+ }
- if ($entry_posts != "." && $entry_posts != ".." && fnmatch("*",$entry_posts)) {
if (file_exists("data/members/active/$author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$entry_posts/author.txt") and (file_get_contents("data/items/$entry_posts/author.txt") == $author)) {
- $items_posts[] = $entry_posts;
+
+ if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
+ $items_posts[] = $author_post;
}
}
elseif (!file_exists("data/members/active/$author") and (file_get_contents("data/username.txt") == $author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$entry_posts/author.txt") and (file_get_contents("data/items/$entry_posts/author.txt") == $author)) {
- $items_posts[] = $entry_posts;
+
+ if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
+ $items_posts[] = $author_post;
}
}
}
}
- closedir($dh_posts);
+ closedir($dh_author_posts);
}
+
$posts = count($items_posts);
+
if ($posts == 1) {
echo "$posts post";
}
+
if ($posts > 1) {
echo "$posts posts";
}
- unset($items_posts);
- echo "</p></td><td width=513 valign=top>";
+ unset($items_posts);
+ echo "</td><td width=513 valign=top>";
}
else {
echo "<td width=598 valign=top>";
@@ -2382,54 +2555,47 @@ foreach ($disp as $d) {
$crypt_passwd = crypt($crypt_passwd,$crypt_passwd);
}
- echo '<font style="font-size: 10px; color: #999999;">';
+ echo "<font style=\"font-size: 10px; color: #999999;\">";
+
if ((file_exists("data/items/$d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
$xavatar_author = file_get_contents("data/items/$d/author.txt");
- echo "<a href=member.php?id=$xavatar_author>$xavatar_author</a> - ";
+ echo "$xavatar_author - ";
}
+
readfile("data/items/$d/date.txt");
+
if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) or file_exists("data/items/$d/lastmod.txt")) {
+
if (file_exists("data/items/$d/revisions.txt")) {
- echo ' (Revision ';
+ echo " (Revision ";
readfile("data/items/$d/revisions.txt");
echo " - ";
- echo date("l,M j,Y,g:i A",filemtime("data/items/$d/body.txt"));
- echo ')';
+ echo date("l, M j, Y, g:i A",filemtime("data/items/$d/body.txt"));
+ echo ")";
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("data/items/$d/category.txt")) {
- echo ' Filed under ';
- $category_key = file_get_contents("data/items/$d/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
- }
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><font style=\"font-size: 5px;\"><br><br></font>";
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d>here</a> to enter it.";
+ echo "This entry is password protected. If you know the magic word,click <a href=\"passwd.php?entry=$d\">here</a> to enter it.";
}
else {
- $entry_body = file_get_contents("data/items/$d/body.txt");
+ $change_me_body = file_get_contents("data/items/$d/body.txt");
+
if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
+
$badwords = file_get_contents("data/pf-badwords.txt");
+
if (file_exists("data/pf-censor.txt")) {
$censor = file_get_contents("data/pf-censor.txt");
}
else {
$censor = "[expletive]";
}
- $entry_body = preg_replace("/\b($badwords)\b/i",$censor,$entry_body);
+ $change_me_body = preg_replace("/\b($badwords)\b/i",$censor,$change_me_body);
}
- echo $entry_body;
+ echo $change_me_body;
}
if ((file_get_contents("data/username.txt") == $author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
@@ -2441,285 +2607,312 @@ foreach ($disp as $d) {
echo "<br><br>--<br>$sig";
}
- echo '</td></tr></table>';
+ echo "</td></tr></table>";
if (file_exists("data/round.txt")) {
- echo "<div class=rbspace></div>";
- }
-
- echo '</div><div id=panel_footer>';
- echo '<font style="font-size: 10px; color: ';
- if (file_exists("data/colors/pf-font.txt")) {
- readfile("data/colors/pf-font.txt");
- }
- else {
- echo "#999999";
+ echo "<div class=\"rbspace\"></div>";
}
- echo ';">';
-if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ echo "</div>";
- if (!file_exists("data/items/$d/comments/live")) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>add comment</a>';
- }
- else {
- if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*",$entry_comments)) {
- $items_comments[] = $entry_comments;
+ if (file_exists("data/items/$d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+
+ if ($dh_entry_categories = opendir("data/items/$d/categories")) {
+
+ while (($change_me_category = readdir($dh_entry_categories)) !== false) {
+
+ if ($change_me_category != "." && $change_me_category != "..") {
+ $change_me_categories[] = $change_me_category;
}
}
- closedir($dh_comments);
+ closedir($dh_entry_categories);
}
- $comments = count($items_comments);
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>';
- if ($comments == 1) {
- echo $comments . ' comment';
+
+ sort($change_me_categories);
+ reset($change_me_categories);
+
+ if (count($change_me_categories) > 0) {
+
+ if (count($change_me_categories) > 1) {
+ $category_list = "categories";
+ }
+ else {
+ $category_list = "category";
+ }
+
+ foreach ($change_me_categories as $filed_under) {
+ $category_list = $category_list . " | <a href=\"index.php?category=$filed_under\">$filed_under</a>";
+ }
+
+ echo "<div id=\"panel_category\">$category_list</div>";
}
- elseif ($comments < 1) {
- echo 'add comment';
+ unset($change_me_categories);
+ }
+
+ echo "<div id=\"panel_footer\">";
+
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+
+ if (!file_exists("data/items/$d/comments/live")) {
+ echo "<a href=\"index.php?entry=$d&show=comments\">add comment</a>";
}
else {
- echo $comments . ' comments';
+ if ($dh_comments = opendir("data/items/$d/comments/live")) {
+
+ while (($live_comment = readdir($dh_comments)) !== false) {
+
+ if ($live_comment != "." && $live_comment != "..") {
+ $live_comments[] = $live_comment;
+ }
+ }
+ closedir($dh_comments);
+ }
+
+ $count_live_comments = count($live_comments);
+
+ echo "<a href=\"index.php?entry=$d&show=comments\">";
+
+ if ($count_live_comments == 1) {
+ echo "$count_live_comments comment";
+ }
+ elseif ($count_live_comments < 1) {
+ echo "add comment";
+ }
+ else {
+ echo "$count_live_comments comments";
+ }
+ echo "</a>";
+
+ unset($live_comments);
}
- echo '</a>';
- unset($items_comments);
}
-
-}
-else {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a>';
-}
+ else {
+ echo "<a href=\"index.php?entry=$d\">permalink</a>";
+ }
if (file_exists("data/items/$d/views.txt")) {
- $fp_views_txt = fopen("data/items/$d/views.txt","r");
- $views_value = fread($fp_views_txt,filesize("data/items/$d/views.txt"));
- fclose($fp_views_txt);
+
+ $views_value = file_get_contents("data/items/$d/views.txt");
+
if ($views_value == 1) {
- echo ' ( ' . $views_value . ' view ) ';
+ echo " ( $views_value view ) ";
}
elseif ($views_value > 1) {
- echo ' ( ' . $views_value . ' views ) ';
+ echo " ( $views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
}
if (!file_exists("images/$d/album")) {
- echo ' ';
+ echo " ";
}
else {
if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != ".." && fnmatch("*",$entry_album)) {
- $items_album[] = $entry_album;
+
+ while (($change_me_album = readdir($dh_album)) !== false) {
+
+ if ($change_me_album != "." && $change_me_album != "..") {
+ $items_album[] = $change_me_album;
}
}
- closedir($dh_album);
+ closedir($dh_album);
}
+
$album = count($items_album);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=album>';
+
+ echo " | <a href=\"index.php?entry=$d&show=album\">";
+
if ($album == 1) {
- echo $album . ' image';
+ echo "$album image";
}
elseif ($album < 1) {
- echo 'album';
+ echo "album";
}
else {
- echo $album . ' images';
+ echo "$album images";
}
- echo '</a>';
+
+ echo "</a>";
+
unset($items_album);
}
- if (file_exists("images/$d/album") and isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == album)) {
+ if (file_exists("images/$d/album") and isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album)) {
+
if (!file_exists("data/items/$d/album")) {
mkdir("data/items/$d/album");
}
+
if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $fp_album_views_txt = fopen("data/items/$d/album/views.txt","r");
- $album_views_value = fread($fp_album_views_txt,filesize("data/items/$d/album/views.txt"));
- fclose($fp_album_views_txt);
+
+ $album_views_value = file_get_contents("data/items/$d/album/views.txt");
+
$album_views_value = $album_views_value + 1;
+
$fp_album_views_txt = fopen("data/items/$d/album/views.txt","w");
fwrite($fp_album_views_txt,$album_views_value);
fclose($fp_album_views_txt);
}
}
- $fp_album_views_txt = fopen("data/items/$d/album/views.txt","r");
- $album_views_value = fread($fp_album_views_txt,filesize("data/items/$d/album/views.txt"));
- fclose($fp_album_views_txt);
+
+ $album_views_value = file_get_contents("data/items/$d/album/views.txt");
+
if ($album_views_value == 1) {
- echo ' ( ' . $album_views_value . ' view ) ';
+ echo " ( $album_views_value view ) ";
}
elseif ($album_views_value > 1) {
- echo ' ( ' . $album_views_value . ' views ) ';
+ echo " ( $album_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
if (!file_exists("data/items/$d/filedrop/files")) {
- echo ' ';
+ echo " ";
}
else {
if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
+
while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+
+ if ($dl_file != "." && $dl_file != "..") {
$items_filedrop[] = $dl_file;
}
}
- closedir($dh_filedrop);
+ closedir($dh_filedrop);
}
+
$filedrop = count($items_filedrop);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=filedrop>';
+
+ echo " | <a href=\"index.php?entry=$d&show=filedrop\">";
+
if ($filedrop == 1) {
- echo $filedrop . ' file';
+ echo "$filedrop file";
}
elseif ($filedrop < 1) {
- echo 'filedrop';
+ echo "filedrop";
}
else {
- echo $filedrop . ' files';
+ echo "$filedrop files";
}
- echo '</a> ';
+
+ echo "</a> ";
+
unset($items_filedrop);
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == filedrop)) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop)) {
+
if (!file_exists("data/items/$d/filedrop")) {
mkdir("data/items/$d/filedrop");
}
+
if (file_exists("data/items/$d/filedrop/files") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","r");
- $filedrop_views_value = fread($fp_filedrop_views_txt,filesize("data/items/$d/filedrop/views.txt"));
- fclose($fp_filedrop_views_txt);
+
+ $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
+
$filedrop_views_value = $filedrop_views_value + 1;
+
$fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","w");
fwrite($fp_filedrop_views_txt,$filedrop_views_value);
fclose($fp_filedrop_views_txt);
}
}
- $fp_filedrop_views_txt = fopen("data/items/$d/filedrop/views.txt","r");
- $filedrop_views_value = fread($fp_filedrop_views_txt,filesize("data/items/$d/filedrop/views.txt"));
- fclose($fp_filedrop_views_txt);
+
+ $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
+
if ($filedrop_views_value == 1) {
- echo ' ( ' . $filedrop_views_value . ' view ) ';
+ echo " ( $filedrop_views_value view ) ";
}
elseif ($filedrop_views_value > 1) {
- echo ' ( ' . $filedrop_views_value . ' views ) ';
+ echo " ( $filedrop_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
if (!file_exists("data/nopdf.txt") and file_exists("data/items/$d/pdf/file")) {
- echo "| <a href={$_SERVER['PHP_SELF']}?entry=$d&show=pdf>pdf</a> ";
+ echo "| <a href=\"index.php?entry=$d&show=pdf\">pdf</a> ";
if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
+
$pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
+
$pdf_views_value = $pdf_views_value + 1;
+
$fp_pdf_views_txt = fopen("data/items/$d/pdf/count/views.txt","w");
fwrite($fp_pdf_views_txt,$pdf_views_value);
fclose($fp_pdf_views_txt);
}
$pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
+
if ($pdf_views_value == 1) {
- echo ' ( ' . $pdf_views_value . ' view ) ';
+ echo " ( $pdf_views_value view ) ";
}
elseif ($pdf_views_value > 1) {
- echo ' ( ' . $pdf_views_value . ' views ) ';
+ echo " ( $pdf_views_value views ) ";
}
else {
- echo ' ';
+ echo " ";
}
}
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo '| <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a></font>';
+ echo "| <a href=\"index.php?entry=$d\">permalink</a>";
}
- echo '</div>';
+ echo "</div>";
if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4e"></b><b class="rb3e"></b><b class="rb2e"></b><b class="rb1e"></b></b>';
+ echo "<b class=\"rbbottom\"><b class=\"rb4e\"></b><b class=\"rb3e\"></b><b class=\"rb2e\"></b><b class=\"rb1e\"></b></b>";
}
- echo '</td></tr></table>';
-
-// entry panel
-
-unset($show_per_entry_panel_list);
-
-if (file_exists("data/panels")) {
- if ($dh_per_entry_panel_list = opendir("data/panels")) {
- while (($entry_per_entry_panel_list = readdir($dh_per_entry_panel_list)) !== false) {
-
- if (file_exists("data/panels/$entry_per_entry_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
+ echo "</td></tr></table>";
- if (!file_exists("data/panels/$entry_per_entry_panel_list/entry.txt")) {
- continue;
- }
+ if ($count_entry_panels > 0) {
- if ($entry_per_entry_panel_list != "." && $entry_per_entry_panel_list != ".." && fnmatch("*",$entry_per_entry_panel_list)) {
- $show_per_entry_panel_list[] = $entry_per_entry_panel_list;
- }
- }
- closedir($dh_per_entry_panel_list);
- }
+ foreach ($entry_panels as $entry_panel) {
- sort($show_per_entry_panel_list);
- reset($show_per_entry_panel_list);
- $count_per_entry_panel_list = count($show_per_entry_panel_list);
+ if (!file_exists("data/panels/$entry_panel/free.txt")) {
- if ($count_per_entry_panel_list > 0) {
- foreach ($show_per_entry_panel_list as $per_entry_panel_list_entry) {
- if (!file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
-
if (file_exists("data/round.txt")) {
- echo '<b class="rbper_entry"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
+ echo "<b class=\"rbper_entry\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
}
else {
- echo '<div id="panel_title">';
+ echo "<div id=\"panel_title\">";
}
-
- readfile("data/panels/$per_entry_panel_list_entry/title.txt");
-
+
+ readfile("data/panels/$entry_panel/title.txt");
+
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=panels.php#{$per_entry_panel_list_entry}>";
- echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+ echo "<a href=\"panels.php#$entry_panel\">";
+ echo "<img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\"></a>";
}
-
- echo '</div><div id=panel_body>';
+
+ echo "</div><div id=panel_body>";
}
-
- if (file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
- echo '<div id=panel_free>';
+
+ if (file_exists("data/panels/$entry_panel/free.txt")) {
+ echo "<div id=\"panel_free\">";
}
+
+ include("data/panels/$entry_panel/panel.php");
- include("data/panels/$per_entry_panel_list_entry/panel.php");
- echo '</div>';
-
- if (file_exists("data/round.txt") and !file_exists("data/panels/$per_entry_panel_list_entry/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
+ echo "</div>";
+
+ if (file_exists("data/round.txt") and !file_exists("data/panels/$entry_panel/free.txt")) {
+ echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
}
}
}
-}
-
-// entry panel
-
-
-
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == album) and file_exists("images/$d/album")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album) and file_exists("images/$d/album")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2750,13 +2943,10 @@ if (file_exists("data/panels")) {
echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=album>here</a> to enter it.";
}
else {
-
- /* thumbnail auto-clean-up (20060409) - This should delete thumbnails of non-existent album images. */
-
if (file_exists("images/$d/thumbnails")) {
if ($dh_album = opendir("images/$d/thumbnails")) {
while (($thumbnail_album = readdir($dh_album)) !== false) {
- if ($thumbnail_album != "." && $thumbnail_album != ".." && fnmatch("*",$thumbnail_album)) {
+ if ($thumbnail_album != "." && $thumbnail_album != "..") {
$current_thumbnail = "images/$d/thumbnails/$thumbnail_album";
$parent_image = str_replace("-thumbnail.jpg","",$thumbnail_album);
$parent_image = "images/$d/album/$parent_image";
@@ -2768,12 +2958,10 @@ if (file_exists("data/panels")) {
}
}
- /* caption auto-clean-up (20070216) This should delete captions of non-existent album images. */
-
if (file_exists("data/items/$d/album/captions")) {
if ($dh_album = opendir("data/items/$d/album/captions")) {
while (($caption_album = readdir($dh_album)) !== false) {
- if ($caption_album != "." && $caption_album != ".." && fnmatch("*",$caption_album)) {
+ if ($caption_album != "." && $caption_album != "..") {
$current_caption = "data/items/$d/album/captions/$caption_album";
$parent_image = str_replace(".txt","",$caption_album);
$parent_image = "images/$d/album/$parent_image";
@@ -2785,13 +2973,11 @@ if (file_exists("data/panels")) {
}
}
- /* auto-sort entries (20060409) - MAJ previously relied on readdir() alone,causing entries to be displayed in the order in which they are stored by the filesystem. */
-
if (file_exists("images/$d/album")) {
if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != ".." && fnmatch("*",$entry_album)) {
- $sort_album[] = $entry_album;
+ while (($change_me_album = readdir($dh_album)) !== false) {
+ if ($change_me_album != "." && $change_me_album != "..") {
+ $sort_album[] = $change_me_album;
}
}
closedir($dh_album);
@@ -2830,8 +3016,6 @@ if (file_exists("data/panels")) {
$new_width = $current_width;
$new_height = $current_height;
}
-
- /* auto-thumbnails (20060213) - In maj-0.14-20060131,album thumbnails were simply the original images displayed with smaller "width=" and "height=" values. Album index loading was painfully slow since the browser had to download the original images from the server. This should speed things up. We placed the "function" here instead of edit.php or add.php to make auto-thumbnail generation available for maj-0.14-20060131 users who may already have existing albums. */
if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
@@ -2863,8 +3047,6 @@ if (file_exists("data/panels")) {
echo "<a href=\"album.php?entry=$d&show=$album_entry\">";
- /* auto-thumbnails (20060519) - Just in case php-gd does not exist,do it the old way. */
-
if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
echo "<img src=\"images/$d/album/$album_entry\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
}
@@ -2894,7 +3076,7 @@ if (file_exists("data/panels")) {
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == filedrop) and file_exists("data/items/$d/filedrop/files")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop) and file_exists("data/items/$d/filedrop/files")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -2927,7 +3109,7 @@ if (file_exists("data/panels")) {
if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+ if ($dl_file != "." && $dl_file != "..") {
$filedrop_files[] = $dl_file;
}
}
@@ -2940,23 +3122,23 @@ if (file_exists("data/panels")) {
foreach ($filedrop_files as $filedrop_file) {
echo "<table border=0 cellspacing=0 cellpadding=4><tr><td>";
- echo "<a href=\"{$_SERVER['PHP_SELF']}?entry=$d&download=$filedrop_file&type=filedrop\">";
+ echo "<a href=\"index.php?entry=$d&download=$filedrop_file&type=filedrop\">";
echo "<img src=images/filedrop.png width=36 height=36 border=0 alt=\"download file\"></a></td>";
- echo "<td><p><b>$filedrop_file</b>";
+ echo "<td><b>$filedrop_file</b>";
if (file_exists("data/items/$d/filedrop/sha1.txt")) {
$sha1 = sha1_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br />$sha1 (<a href=http://www.faqs.org/rfcs/rfc3174 target=_maj>sha1</a>)";
+ echo "<br>$sha1 (<a href=\"http://www.faqs.org/rfcs/rfc3174\" target=\"_maj\">sha1</a>)";
}
if (file_exists("data/items/$d/filedrop/md5.txt")) {
$md5 = md5_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br />$md5 (<a href=http://www.faqs.org/rfcs/rfc1321 target=_maj>md5</a>)";
+ echo "<br>$md5 (<a href=\"http://www.faqs.org/rfcs/rfc1321\" target=\"_maj\">md5</a>)";
}
$size = filesize("data/items/$d/filedrop/files/$filedrop_file");
$size_string = ($size > 512)?( ($size/1024 > 512) ?sprintf("%.02f MB",($size/1024)/1024) :sprintf("%.02f KB",$size/1024)) :sprintf("%d B",$size);
- echo "<br />$size_string";
+ echo "<br>$size_string";
$filedrop_count_file = "data/items/$d/filedrop/count/$filedrop_file" . '.txt';
@@ -2973,7 +3155,7 @@ if (file_exists("data/panels")) {
echo " downloads";
}
}
- echo "</p></td></tr></table>";
+ echo "</td></tr></table>";
}
}
echo "</div>";
@@ -2985,7 +3167,7 @@ if (file_exists("data/panels")) {
echo '</td></tr></table>';
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == pdf) and file_exists("data/items/$d/pdf/file")) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == pdf) and file_exists("data/items/$d/pdf/file")) {
echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
@@ -3019,11 +3201,11 @@ if (file_exists("data/panels")) {
if ($dh_pdf = opendir("data/items/$d/pdf/file")) {
while (($dl_file = readdir($dh_pdf)) !== false) {
- if ($dl_file != "." && $dl_file != ".." && fnmatch("*",$dl_file)) {
+ if ($dl_file != "." && $dl_file != "..") {
echo '<table border=0 cellspacing=0 cellpadding=4><tr><td>';
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&download=' . $dl_file. '&type=pdf>';
+ echo "<a href=\"index.php?entry=$d&download=$dl_file&type=pdf\">";
echo '<img src=images/pdf.png width=36 height=36 border=0 alt="download file"></a></td>';
- echo '<td><p><b>';
+ echo '<td><b>';
echo $dl_file;
echo'</b><br>';
$size = filesize("data/items/$d/pdf/file/$dl_file");
@@ -3043,7 +3225,7 @@ if (file_exists("data/panels")) {
echo ' downloads';
}
}
- echo '</p></td></tr></table>';
+ echo '</td></tr></table>';
}
}
closedir($dh_pdf);
@@ -3058,7 +3240,7 @@ if (file_exists("data/panels")) {
echo '</td></tr></table>';
}
- if (isset($entry) and !empty($entry) and isset($show) and !empty($show) and ($show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
}
@@ -3074,9 +3256,9 @@ if (file_exists("data/panels")) {
echo '><tr><td>';
if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*",$entry_comments)) {
- $show_comments[] = $entry_comments;
+ while (($live_comment = readdir($dh_comments)) !== false) {
+ if ($live_comment != "." && $live_comment != "..") {
+ $show_comments[] = $live_comment;
}
}
closedir($dh_comments);
@@ -3121,7 +3303,7 @@ if (file_exists("data/panels")) {
echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/live/$comment/author.txt")) {
- echo "<td width=85 valign=top><p>";
+ echo "<td width=85 valign=top>";
$c_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
echo "<a href=member.php?id=$c_author>";
if ((file_get_contents("data/username.txt") == $c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
@@ -3260,14 +3442,31 @@ if (file_exists("data/panels")) {
if (file_exists("data/items/$c_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
-
- $c_post_cat_dir = file_get_contents("data/items/$c_entry_posts/category.txt");
-
- if (file_exists("data/categories/$c_post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$c_entry_posts/cat.txt")) {
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$change_me_c_entry_posts/categories")) {
+
+ if ($dh_cat2_c_entry_posts = opendir("data/items/$change_me_c_entry_posts/categories")) {
+
+ while (($change_me_cat2_c_entry_posts = readdir($dh_cat2_c_entry_posts)) !== false) {
+
+ if ($change_me_cat2_c_entry_posts != "." && $change_me_cat2_c_entry_posts != "..") {
+
+ if (file_exists("data/categories/$change_me_cat2_c_entry_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_cat2_c_entry_posts);
+ }
+ }
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$c_entry_posts/cat.txt")) {
continue;
}
- if ($c_entry_posts != "." && $c_entry_posts != ".." && fnmatch("*",$c_entry_posts)) {
+ if ($c_entry_posts != "." && $c_entry_posts != "..") {
if (file_exists("data/members/active/$c_author") and file_exists("data/bb.txt")) {
if (file_exists("data/items/$c_entry_posts/author.txt") and (file_get_contents("data/items/$c_entry_posts/author.txt") == $c_author)) {
$c_items_posts[] = $c_entry_posts;
@@ -3291,13 +3490,13 @@ if (file_exists("data/panels")) {
}
unset($c_items_posts);
- echo "</p></td><td width=513 valign=top>";
+ echo "</td><td width=513 valign=top>";
}
else {
echo "<td width=598 valign=top>";
}
- echo '<p><font style="font-size: 10px; color: #999999;">';
+ echo '<font style="font-size: 10px; color: #999999;">';
if ((file_exists("data/items/$d/comments/live/$comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/comments/live/$comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
$cxavatar_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
echo "<a href=member.php?id=$cxavatar_author>$cxavatar_author</a> - ";
@@ -3311,7 +3510,7 @@ if (file_exists("data/panels")) {
}
}
echo '</font><font style="font-size: 5px;"><br><br></font>';
- $entry_comment = file_get_contents("data/items/$d/comments/live/$comment/comment.txt");
+ $change_me_comment = file_get_contents("data/items/$d/comments/live/$comment/comment.txt");
if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
$badwords = file_get_contents("data/pf-badwords.txt");
if (file_exists("data/pf-censor.txt")) {
@@ -3320,9 +3519,9 @@ if (file_exists("data/panels")) {
else {
$censor = "[expletive]";
}
- $entry_comment = preg_replace("/\b($badwords)\b/i",$censor,$entry_comment);
+ $change_me_comment = preg_replace("/\b($badwords)\b/i",$censor,$change_me_comment);
}
- echo $entry_comment;
+ echo $change_me_comment;
echo '</p></tr></table></div>';
if (file_exists("data/round.txt")) {
@@ -3335,7 +3534,7 @@ if (file_exists("data/panels")) {
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=';
+ echo '<table border=0 cellspacing=0 cellpadding=0 width=';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
echo "610";
@@ -3348,21 +3547,21 @@ if (file_exists("data/panels")) {
if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}")))) {
- if (isset($show) and !empty($show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
+ if (isset($req_show) and !empty($req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0><tr><td><p><font style="font-size: 12px;"><b>Thanks!</b></font></p><p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</p></td></tr></table></p>';
+ echo '<table border=0 cellspacing=0 cellpadding=0><tr><td><font style="font-size: 12px;"><b>Thanks!</b></font></p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</td></tr></table></p>';
}
}
- echo '<p><font style="font-size: 12px;"><b>Add Comment</b></font></p>';
+ echo '<font style="font-size: 12px;"><b>Add Comment</b></font></p>';
if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "<p>This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=comments>here</a> to enter it.</p>";
+ echo "This entry is password protected. If you know the magic word,click <a href=passwd.php?entry=$d&show=comments>here</a> to enter it.</p>";
}
else {
$captcha_rand = str_rand(7);
- echo "<p>Fill out the form below";
+ echo "Fill out the form below";
if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
echo " and enter <b>$captcha_rand</b> in the anti-spam field";
@@ -3391,56 +3590,56 @@ if (file_exists("data/panels")) {
?>
<table border=0 cellspacing=2 cellpadding=0 width=500>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>?entry=<?php echo $d; ?>&show=comments" method="post">
+ <form enctype="multipart/form-data" action="index.php?entry=<?php echo $d; ?>&show=comments" method="post">
<input type=hidden name=captcha_get value="<?php echo $captcha_rand; ?>">
<tr>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php $logged_in_author = explode(" ",file_get_contents("data/author.txt")); echo trim(str_replace(",","",$logged_in_author[0])); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php $logged_in_author = explode(" ",file_get_contents("data/author.txt")); echo trim(str_replace(",","",$logged_in_author[0])); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt"); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt"); ?>"></td>
<?php
}
else {
?>
- <td width=75><p>First Name*</p></td><td width=300><input class=input type=text autocomplete=off name=firstname maxlength=30></td>
+ <td width=75>First Name*</td><td width=300><input class=input type=text autocomplete=off name=firstname maxlength=30></td>
<?php
}
?>
<td rowspan=7 valign=top width=75 align=right>
<table border=0 cellspacing=1 cellpadding=2>
- <tr><td><img src=images/smileys/crying.png border=0></td><td><p>:((</p></td><td ><p>crying</p></td></tr>
- <tr><td><img src=images/smileys/frown.png border=0></td><td><p>:(</p></td><td><p>frown</p></td></tr>
- <tr><td><img src=images/smileys/indifferent.png border=0></td><td><p>:|</p></td><td><p>indifferent</p></td></tr>
- <tr><td><img src=images/smileys/laughing.png border=0></td><td><p>:D</p></td><td><p>laughing</p></td></tr>
- <tr><td><img src=images/smileys/lick.png border=0></td><td><p>:P</p></td><td><p>lick</p></td></tr>
- <tr><td><img src=images/smileys/ohno.png border=0></td><td><p>:O</p></td><td><p>oh no!</p></td></tr>
- <tr><td><img src=images/smileys/smile.png border=0></td><td><p>:)</p></td><td><p>smile</p></td></tr>
- <tr><td><img src=images/smileys/surprised.png border=0></td><td><p>=)</p></td><td><p>surprised</p></td></tr>
- <tr><td><img src=images/smileys/undecided.png border=0></td><td><p>:\</p></td><td><p>undecided</p></td></tr>
- <tr><td><img src=images/smileys/wink.png border=0></td><td><p>;)</p></td><td><p>wink</p></td></tr>
+ <tr><td><img src="images/smileys/crying.png" border="0"></td><td>:((</td><td >crying</td></tr>
+ <tr><td><img src="images/smileys/frown.png" border="0"></td><td>:(</td><td>frown</td></tr>
+ <tr><td><img src="images/smileys/indifferent.png" border="0"></td><td>:|</td><td>indifferent</td></tr>
+ <tr><td><img src="images/smileys/laughing.png" border="0"></td><td>:D</td><td>laughing</td></tr>
+ <tr><td><img src="images/smileys/lick.png" border="0"></td><td>:P</td><td>lick</td></tr>
+ <tr><td><img src="images/smileys/ohno.png" border="0"></td><td>:O</td><td>oh no!</td></tr>
+ <tr><td><img src="images/smileys/smile.png" border="0"></td><td>:)</td><td>smile</td></tr>
+ <tr><td><img src="images/smileys/surprised.png" border="0"></td><td>=)</td><td>surprised</td></tr>
+ <tr><td><img src="images/smileys/undecided.png" border="0"></td><td>:\</td><td>undecided</td></tr>
+ <tr><td><img src="images/smileys/wink.png" border="0"></td><td>;)</td><td>wink</td></tr>
</td></tr>
</table>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td><input type=hidden name=lastname value="<?php echo trim(str_replace(",","",$logged_in_author[1])); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo trim(str_replace(",","",$logged_in_author[1])); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt"); ?>"></p></td>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt"); ?>"></td>
<?php
}
else {
?>
- <tr><td><p>Last Name*</p></td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
+ <tr><td>Last Name*</td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
<?php
}
@@ -3448,52 +3647,52 @@ if (file_exists("data/panels")) {
if (file_exists("data/email.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/email.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/email.txt"); ?>"></td>
<?php
}
else {
- echo "<tr><td><p>E-mail*</p></td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>";
+ echo "<tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>";
}
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>"></td>
<?php
}
else {
?>
- <tr><td><p>E-mail*</p></td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
+ <tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
<?php
}
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("data/url.txt"); ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("data/url.txt"); ?>"></td>
<?php
}
elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
?>
- <td width=75><p></p></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>"></p></td>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>"></td>
<?php
}
else {
?>
- <tr><td><p>Website</p></td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
+ <tr><td>Website</td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
<?php
}
?>
- <tr><td><p>Comment*</p></td><td><textarea class=input name=new_comment rows=15></textarea></td></tr>
+ <tr><td>Comment*</td><td><textarea class=input name=new_comment rows=15></textarea></td></tr>
<?php
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
echo "<input type=hidden name=captcha_put value=\"$captcha_rand\">";
}
else {
- echo "<tr><td><p>Anti-Spam*</p></td><td><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
+ echo "<tr><td>Anti-Spam*</td><td><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
}
?>
- <tr><td><p></p></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
+ <tr><td></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
</form>
</table>
<?php
@@ -3503,378 +3702,417 @@ if (file_exists("data/panels")) {
<?php
}
}
-}
-
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($entry) and !empty($entry)) {
- if ($dh_pending_comments = opendir("data/items/$d/comments/pending")) {
-
- while (($entry_pending_comments = readdir($dh_pending_comments)) !== false) {
-
- if ($entry_pending_comments != "." && $entry_pending_comments != ".." && fnmatch("*",$entry_pending_comments)) {
- $show_pending_comments[] = $entry_pending_comments;
+ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($req_entry) and !empty($req_entry)) {
+
+ if ($dh_pending_comments = opendir("data/items/$d/comments/pending")) {
+
+ while (($change_me_pending_comments = readdir($dh_pending_comments)) !== false) {
+
+ if ($change_me_pending_comments != "." && $change_me_pending_comments != "..") {
+ $show_pending_comments[] = $change_me_pending_comments;
+ }
}
+ closedir($dh_pending_comments);
}
- closedir($dh_pending_comments);
- }
-
- asort($show_pending_comments);
- reset($show_pending_comments);
-
- $count_pending_comments = count($show_pending_comments);
-
- if ($count_pending_comments > 0) {
-
- if ($count_pending_comments == 1) {
- echo '<p><b>Pending Comment</b></p>';
- }
- else {
- echo '<p><b>Pending Comments</b></p>';
- }
- foreach ($show_pending_comments as $pending_comment) {
-
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=';
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
- echo "610";
- }
- else {
- echo "525";
- }
-
- echo '><tr><td>';
+ asort($show_pending_comments);
+ reset($show_pending_comments);
+
+ $count_pending_comments = count($show_pending_comments);
- 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">';
+ if ($count_pending_comments > 0) {
+
+ if ($count_pending_comments == 1) {
+ echo '<b>Pending Comment</b></p>';
}
else {
- echo '<div id="panel_title">';
+ echo '<b>Pending Comments</b></p>';
}
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("data/items/$d/comments/pending/$pending_comment/url.txt");
- echo '>';
- }
+ foreach ($show_pending_comments as $pending_comment) {
- readfile("data/items/$d/comments/pending/$pending_comment/firstname.txt");
- echo ' ';
- readfile("data/items/$d/comments/pending/$pending_comment/lastname.txt");
+ echo '<table border=0 cellspacing=0 cellpadding=0 width=';
+
+ if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ echo "610";
+ }
+ else {
+ echo "525";
+ }
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '</a>';
- }
+ echo '><tr><td>';
- echo ' <';
- readfile("data/items/$d/comments/pending/$pending_comment/email.txt");
- echo '>';
-
- echo '<a href=del.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
-
- $pending_comment_key_file = "data/items/$d/comments/pending/$pending_comment/key.txt";
- $open_pending_comment_key_file = fopen($pending_comment_key_file,"r");
- $pending_comment_login_key = fread($open_pending_comment_key_file,filesize($pending_comment_key_file));
- fclose($open_pending_comment_key_file);
-
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&comment=' . $pending_comment . '&key=' . $pending_comment_login_key . '&action=approve><img src=images/widget.cat.png width=11 height=11 border=0 align=right alt="post comment"></a>';
-
- echo '<a href=move.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.move.png width=11 height=11 border=0 align=right alt="move comment"></a>';
-
- echo '<a href=edit.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
-
- echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
-
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/pending/$pending_comment/author.txt")) {
-
- echo "<td width=85 valign=top><p>";
-
- $pc_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
-
- echo "<a href=member.php?id=$pc_author>";
-
- if ((file_get_contents("data/username.txt") == $pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
-
- $pc_max_avatar_gif_image_width = 80;
-
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
- }
+ 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 id="panel_title">';
+ }
+
+ if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
+ echo '<a target=_maj href=';
+ readfile("data/items/$d/comments/pending/$pending_comment/url.txt");
+ echo '>';
+ }
- echo "<img src=images/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
-
- $pc_max_avatar_jpg_image_width = 80;
-
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
- }
+ readfile("data/items/$d/comments/pending/$pending_comment/firstname.txt");
+ echo ' ';
+ readfile("data/items/$d/comments/pending/$pending_comment/lastname.txt");
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
-
- $pc_max_avatar_png_image_width = 80;
-
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
- }
- echo "><br>";
+ if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
+ echo '</a>';
}
- elseif (file_exists("images/members/$pc_author/avatar.jpg") or file_exists("images/members/$pc_author/avatar.gif") or file_exists("images/members/$pc_author/avatar.png")) {
-
- if (file_exists("images/members/$pc_author/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/members/$pc_author/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
- $pc_max_avatar_gif_image_width = 80;
-
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ echo ' <';
+ readfile("data/items/$d/comments/pending/$pending_comment/email.txt");
+ echo '>';
+
+ echo '<a href=del.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
+
+ $pending_comment_key_file = "data/items/$d/comments/pending/$pending_comment/key.txt";
+ $open_pending_comment_key_file = fopen($pending_comment_key_file,"r");
+ $pending_comment_login_key = fread($open_pending_comment_key_file,filesize($pending_comment_key_file));
+ fclose($open_pending_comment_key_file);
+
+ echo "<a href=\"index.php?entry=$d&comment=$pending_comment&key=$pending_comment_login_key&action=approve\"><img src=\"images/widget.cat.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"post comment\"></a>";
+
+ echo "<a href=\"move.php?entry=$d&comment=$pending_comment&type=pending\"><img src=\"images/widget.move.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"move comment\"></a>";
+
+ echo '<a href=edit.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
+
+ echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
+
+ if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/pending/$pending_comment/author.txt")) {
+
+ echo "<td width=85 valign=top>";
+
+ $pc_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
+
+ echo "<a href=member.php?id=$pc_author>";
+
+ if ((file_get_contents("data/username.txt") == $pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
+ if (file_exists("images/avatar.gif")) {
+ $pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
+ $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
+ $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
+
+ $pc_max_avatar_gif_image_width = 80;
+
+ if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
+ $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
+ $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.gif border=0 width=";
+ echo $pc_avatar_gif_image_width;
+ echo " height=";
+ echo $pc_avatar_gif_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/members/$pc_author/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
-
- $pc_max_avatar_jpg_image_width = 80;
-
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("images/avatar.jpg")) {
+ $pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
+ $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
+ $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
+
+ $pc_max_avatar_jpg_image_width = 80;
+
+ if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
+ $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
+ $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.jpg border=0 width=";
+ echo $pc_avatar_jpg_image_width;
+ echo " height=";
+ echo $pc_avatar_jpg_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/members/$pc_author/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
-
- $pc_max_avatar_png_image_width = 80;
+
+ if (file_exists("images/avatar.png")) {
+ $pc_avatar_png_image_size = getimagesize("images/avatar.png");
+ $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
+ $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ $pc_max_avatar_png_image_width = 80;
+
+ if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
+ $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
+ $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/avatar.png border=0 width=";
+ echo $pc_avatar_png_image_width;
+ echo " height=";
+ echo $pc_avatar_png_image_height;
}
-
- echo "<img src=images/members/$pc_author/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
+ echo "><br>";
}
- echo "><br>";
- }
- echo "$pc_author</a><br>";
-
- if ((file_get_contents("data/username.txt") == $pc_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- $pc_rank = file_get_contents("data/members/active/$pc_author/rank.txt");
- echo "$pc_rank<br>";
- }
- elseif (!file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
- if ($pc_dh_posts = opendir("data/items")) {
-
- while (($pc_entry_posts = readdir($pc_dh_posts)) !== false) {
-
- if (file_exists("data/items/$pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
+ elseif (file_exists("images/members/$pc_author/avatar.jpg") or file_exists("images/members/$pc_author/avatar.gif") or file_exists("images/members/$pc_author/avatar.png")) {
+
+ if (file_exists("images/members/$pc_author/avatar.gif")) {
+ $pc_avatar_gif_image_size = getimagesize("images/members/$pc_author/avatar.gif");
+ $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
+ $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
+
+ $pc_max_avatar_gif_image_width = 80;
+
+ if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
+ $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
+ $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.gif border=0 width=";
+ echo $pc_avatar_gif_image_width;
+ echo " height=";
+ echo $pc_avatar_gif_image_height;
}
- if (file_exists("data/items/$pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
+ if (file_exists("images/members/$pc_author/avatar.jpg")) {
+ $pc_avatar_jpg_image_size = getimagesize("images/members/$pc_author/avatar.jpg");
+ $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
+ $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
+
+ $pc_max_avatar_jpg_image_width = 80;
+
+ if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
+ $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
+ $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.jpg border=0 width=";
+ echo $pc_avatar_jpg_image_width;
+ echo " height=";
+ echo $pc_avatar_jpg_image_height;
}
- $pc_post_cat_dir = file_get_contents("data/items/$pc_entry_posts/category.txt");
-
- if (file_exists("data/categories/$pc_post_cat_dir/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$pc_entry_posts/cat.txt")) {
- continue;
+ if (file_exists("images/members/$pc_author/avatar.png")) {
+ $pc_avatar_png_image_size = getimagesize("images/members/$pc_author/avatar.png");
+ $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
+ $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
+
+ $pc_max_avatar_png_image_width = 80;
+
+ if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
+ $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
+ $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
+ $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
+ }
+
+ echo "<img src=images/members/$pc_author/avatar.png border=0 width=";
+ echo $pc_avatar_png_image_width;
+ echo " height=";
+ echo $pc_avatar_png_image_height;
}
+ echo "><br>";
+ }
+ echo "$pc_author</a><br>";
+
+ if ((file_get_contents("data/username.txt") == $pc_author) and file_exists("data/rank.txt")) {
+ echo "administrator<br>";
+ }
+ elseif (file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
+ $pc_rank = file_get_contents("data/members/active/$pc_author/rank.txt");
+ echo "$pc_rank<br>";
+ }
+ elseif (!file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
+ echo "member<br>";
+ }
- if ($pc_entry_posts != "." && $pc_entry_posts != ".." && fnmatch("*",$pc_entry_posts)) {
- if (file_exists("data/members/active/$pc_author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
+ if ($pc_dh_posts = opendir("data/items")) {
+
+ while (($pc_entry_posts = readdir($pc_dh_posts)) !== false) {
+
+ if (file_exists("data/items/$pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ continue;
+ }
+
+ if (file_exists("data/items/$pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ continue;
+ }
+
+ $private_categories = "0";
+
+ if (file_exists("data/items/$change_me_pc_entry_posts/categories")) {
+
+ if ($dh_cat2_pc_entry_posts = opendir("data/items/$change_me_pc_entry_posts/categories")) {
+
+ while (($change_me_cat2_pc_entry_posts = readdir($dh_cat2_pc_entry_posts)) !== false) {
+
+ if ($change_me_cat2_pc_entry_posts != "." && $change_me_cat2_pc_entry_posts != "..") {
+
+ if (file_exists("data/categories/$change_me_cat2_pc_entry_posts/private.txt")) {
+ $private_categories = $private_categories + 1;
+ }
+ }
+ }
+ closedir($dh_cat2_pc_entry_posts);
}
}
- elseif (!file_exists("data/members/active/$pc_author") and (file_get_contents("data/username.txt") == $pc_author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
+
+ if (($private_categories > 0) and (!isset($_SESSION['logged_in']