This commit has been accessed 536 times via Git panel.
commit 02d9fa3e67d76f699e079818dd80254d421589a5
tree 8f7abf637ebf845a30ea63b8f14edc0d16c9fdbd
parent 61f61580030e08df02c7c776baba6c3efe96d8c6
author Magie Antonio <magie@majcms.org> 1309138516 +0800
committer Magie Antonio <magie@majcms.org> 1309138516 +0800
Clean up session variables and fopen read-only modes
diff --git a/css.php b/css.php
index 8f4c936..2d00bdc 100644
--- a/css.php
+++ b/css.php
@@ -58,6 +58,10 @@ else {
font-size: <?php echo $maj_font_Dpx; ?>;
}
+td {
+ font-size: <?php echo $maj_font_Dpx; ?>;
+}
+
body {
padding: 0px;
margin: 0px;
diff --git a/index.php b/index.php
index 715dacc..b9311f7 100644
--- a/index.php
+++ b/index.php
@@ -10,7 +10,7 @@ error_reporting(E_ERROR);
require("core.php");
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
+if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
header("Location: login.php");
}
@@ -125,9 +125,13 @@ if (!file_exists("data/author.txt")) {
}
$maj_default_title = file_get_contents("data/title.txt");
-$maj_login_username = file_get_contents("data/username.txt");
+$maj_admin_username = file_get_contents("data/username.txt");
-if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) {
+if (isset($_SESSION['logged_in'])) {
+ $maj_logged_in_username = $_SESSION['logged_in'];
+}
+
+if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
if (file_exists("data/hits.txt")) {
$maj_global_hits_count = file_get_contents("data/hits.txt");
@@ -221,10 +225,8 @@ function go_download($maj_dl_file) {
mkdir($maj_count_path);
}
- $maj_unique_downloads = "$maj_count_path/$maj_count_file";
-
- if (file_exists($maj_unique_downloads)) {
- $maj_count_unique_downloads = file_get_contents($maj_unique_downloads);
+ if (file_exists("$maj_count_path/$maj_count_file")) {
+ $maj_count_unique_downloads = file_get_contents("$maj_count_path/$maj_count_file");
}
else {
$maj_count_unique_downloads = "0";
@@ -232,7 +234,7 @@ function go_download($maj_dl_file) {
$maj_count_unique_downloads = $maj_count_unique_downloads + 1;
- $maj_fp_unique_downloads = fopen($maj_unique_downloads,"w");
+ $maj_fp_unique_downloads = fopen("$maj_count_path/$maj_count_file","w");
fwrite($maj_fp_unique_downloads,$maj_count_unique_downloads);
fclose($maj_fp_unique_downloads);
}
@@ -452,23 +454,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
rmdirr($maj_comment_dir);
}
- $maj_pending_comment_flag_dir = $maj_req_entry;
-
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_pending_comment_flag_dir/count.txt"));
- fclose($maj_fp_comment_count_txt);
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
if ($maj_comment_count_value <= 1) {
- rmdirr("data/comments/pending/$maj_pending_comment_flag_dir");
+ rmdirr("data/comments/pending/$maj_req_entry");
}
else {
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_pending_comment_flag_dir/count.txt"));
- fclose($maj_fp_comment_count_txt);
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
$maj_comment_count_value = $maj_comment_count_value - 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_req_entry/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -485,7 +481,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
echo "<title>$maj_title</title>\r\n";
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
if (file_exists("data/items/$maj_req_entry/views.txt")) {
$maj_count_views = file_get_contents("data/items/$maj_req_entry/views.txt");
@@ -548,7 +544,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_firstname = htmlentities($_POST['firstname'],ENT_NOQUOTES);
$maj_firstname = trim($maj_firstname);
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
+ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
$maj_firstname = strtolower($maj_firstname);
}
@@ -560,7 +556,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_lastname = htmlentities($_POST['lastname'],ENT_NOQUOTES);
$maj_lastname = trim($maj_lastname);
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
+ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
$maj_lastname = strtolower($maj_lastname);
}
@@ -575,7 +571,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_email_txt,$maj_email);
fclose($maj_fp_email_txt);
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/email.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/email.txt")) {
$maj_fp_email_root = fopen("data/email.txt","w");
$maj_email_root = strtolower($_POST['email']);
$maj_email_root = trim($maj_email_root);
@@ -608,10 +604,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_comment_quote = ucfirst($_POST['new_comment']);
- $maj_sig_author_file = "data/author.txt";
- $maj_fp_sig_author = fopen($maj_sig_author_file,"r");
- $maj_sig_author = fread($maj_fp_sig_author,filesize($maj_sig_author_file));
- fclose($maj_fp_sig_author);
+ $maj_sig_author = file_get_contents("data/author.txt");
$maj_sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$maj_sig_url = str_replace('//','/',$maj_sig_url);
@@ -627,11 +620,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
$maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
-
- $maj_commented_entry_title_file = "data/items/$maj_req_entry/title.txt";
- $maj_fp_commented_entry_title = fopen($maj_commented_entry_title_file,"r");
- $maj_commented_entry_title = fread($maj_fp_commented_entry_title,filesize($maj_commented_entry_title_file));
- fclose($maj_fp_commented_entry_title);
+
+ $maj_commented_entry_title = file_get_contents("data/items/$maj_req_entry/title.txt");
if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
@@ -688,7 +678,7 @@ else {
echo "<title>$maj_default_title</title>\r\n";
}
-if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")))) {
+if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")))) {
if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
@@ -714,9 +704,9 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- if (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")) {
+ if (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")) {
- if ($_SESSION['logged_in'] == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+ if ($maj_logged_in_username == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
$maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
@@ -780,7 +770,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
$maj_description = substr($maj_description,0,210);
$maj_description = htmlentities($maj_description,ENT_NOQUOTES);
- 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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
@@ -818,7 +808,7 @@ if (file_exists("data/header.txt")) {
$maj_header_panel = file_get_contents("data/header.txt");
- if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($_SESSION['logged_in']))) {
+ if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
include("data/panels/$maj_header_panel/panel.php");
}
@@ -830,7 +820,7 @@ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_
echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-if (!file_exists("data/xprofile.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Profile</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t";
@@ -911,7 +901,7 @@ if (!file_exists("data/xprofile.txt") or ($_SESSION['logged_in'] == file_get_con
echo "\r\n\t</div>\r\n</div>\r\n\r\n";
}
-if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Navigation</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t<a class=\"navlink\" href=\".\">Home</a><br>\r\n";
@@ -919,7 +909,7 @@ if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_
echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "\t\t<a class=\"navlink\" href=\"add.php\">Add Entry</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"settings.php\">Settings</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"panels.php\">Panels</a><br>\r\n";
@@ -928,16 +918,16 @@ if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_
echo "\t\t<a class=\"navlink\" href=\"fonts.php\">Fonts</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"login.php\">Logout</a>\r\n";
}
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $maj_login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category")) {
+ if (file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
if (!file_exists("data/categories/$maj_req_category")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category");
+ rmdirr("data/members/active/$maj_logged_in_username/categories/$maj_req_category");
}
}
- if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") or file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category"))) {
+ if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -961,11 +951,11 @@ if (file_exists("data/sticky")) {
while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
- if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -988,7 +978,7 @@ if (file_exists("data/sticky")) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
continue;
}
@@ -1027,11 +1017,11 @@ if (file_exists("data/panels")) {
if ($maj_panel != "." && $maj_panel != "..") {
- if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($_SESSION['logged_in'])) {
+ if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
continue;
}
@@ -1181,7 +1171,7 @@ if (file_exists("data/panels")) {
readfile("data/panels/$maj_left_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_left_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -1313,7 +1303,7 @@ if ($maj_count_top_panels > 0) {
readfile("data/panels/$maj_top_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_top_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -1494,7 +1484,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_grand[] = $maj_item;
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
@@ -1510,7 +1500,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or (file_get_contents("data/username.txt") == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
@@ -1582,11 +1572,11 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
- if ((file_exists("data/items/$maj_item/members") and !isset($_SESSION['logged_in'])) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/{$_SESSION['logged_in']}"))) {
+ if ((file_exists("data/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
- if (file_exists("data/items/$maj_item/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -1619,7 +1609,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or (file_get_contents("data/username.txt") == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
}
@@ -1641,11 +1631,11 @@ $maj_count_grand = count($maj_grand);
if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
- if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
unset($maj_items);
}
- if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($_SESSION['logged_in'])) {
+ if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
unset($maj_items);
}
}
@@ -1849,7 +1839,7 @@ if ($maj_count_center_panels > 0) {
readfile("data/panels/$maj_center_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_center_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -2057,7 +2047,7 @@ foreach ($maj_disp as $maj_d) {
echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t\t";
- if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_title"';
@@ -2085,7 +2075,7 @@ foreach ($maj_disp as $maj_d) {
readfile("data/items/$maj_d/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $maj_login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\">";
@@ -2098,7 +2088,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"del.php?entry=$maj_d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
@@ -2208,7 +2198,7 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=\"member.php?id=$maj_author\">";
- if ((file_get_contents("data/username.txt") == $maj_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_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")) {
@@ -2446,7 +2436,7 @@ foreach ($maj_disp as $maj_d) {
echo "<b>$maj_author</b></a><br>";
- if ((file_get_contents("data/username.txt") == $maj_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -2463,7 +2453,7 @@ foreach ($maj_disp as $maj_d) {
if ($maj_author_post != "." && $maj_author_post != "..") {
- if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -2486,7 +2476,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_author_post/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_author_post/cat.txt")) {
continue;
}
@@ -2496,7 +2486,7 @@ foreach ($maj_disp as $maj_d) {
$maj_items_posts[] = $maj_author_post;
}
}
- elseif (!file_exists("data/members/active/$maj_author") and (file_get_contents("data/username.txt") == $maj_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_author") and ($maj_admin_username == $maj_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_author_post/author.txt") and (file_get_contents("data/items/$maj_author_post/author.txt") == $maj_author)) {
$maj_items_posts[] = $maj_author_post;
@@ -2540,22 +2530,22 @@ foreach ($maj_disp as $maj_d) {
}
- if (!file_exists("data/items/$maj_d/xdate.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xdate.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_xavatar_author = file_get_contents("data/items/$maj_d/author.txt");
- if (!file_exists("data/items/$maj_d/xauthor.txt") or (file_exists("data/items/$maj_d/xauthor.txt") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xauthor.txt") or (file_exists("data/items/$maj_d/xauthor.txt") and ($maj_logged_in_username == $maj_admin_username))) {
echo "$maj_xavatar_author - ";
}
}
entry2date($maj_d);
- if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) or file_exists("data/items/$maj_d/lastmod.txt")) {
+ if ((isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or file_exists("data/items/$maj_d/lastmod.txt")) {
if (file_exists("data/items/$maj_d/revisions.txt")) {
echo " (Revision ";
@@ -2566,7 +2556,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- echo "</font><font style=\"font-size: 5px;\"><br><br></font>";
+ echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
}
@@ -2574,13 +2564,13 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"color: $maj_d_text_b;\">";
}
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=\"passwd.php?entry=$maj_d\">here</a> to enter it.";
}
else {
$maj_entry_body = file_get_contents("data/items/$maj_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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
@@ -2608,7 +2598,7 @@ foreach ($maj_disp as $maj_d) {
echo "$maj_entry_body";
}
- if ((file_get_contents("data/username.txt") == $maj_author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
+ if (($maj_admin_username == $maj_author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
$maj_sig = file_get_contents("data/sig.txt");
echo "<br><br>--<br>$maj_sig";
}
@@ -2639,7 +2629,7 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t</div>";
- if (file_exists("data/items/$maj_d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (file_exists("data/items/$maj_d/categories") and ($maj_logged_in_username == $maj_admin_username)) {
if ($maj_dh_entry_categories = opendir("data/items/$maj_d/categories")) {
@@ -2719,7 +2709,7 @@ foreach ($maj_disp as $maj_d) {
echo ">\r\n\t\t\t\t";
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
if (!file_exists("data/items/$maj_d/comments/live")) {
echo "<a href=\"index.php?entry=$maj_d&show=comments\" class=\"status\">add comment</a>";
@@ -2813,7 +2803,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/album");
}
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_album_views_value = file_get_contents("data/items/$maj_d/album/views.txt");
@@ -2849,7 +2839,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/media/videos");
}
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
if (!file_exists("data/items/$maj_d/media/videos/views.txt")) {
$maj_videos_views_value = 0;
@@ -2964,7 +2954,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/filedrop");
}
- if (file_exists("data/items/$maj_d/filedrop/files") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_d/filedrop/files") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_filedrop_views_value = file_get_contents("data/items/$maj_d/filedrop/views.txt");
@@ -2993,7 +2983,7 @@ foreach ($maj_disp as $maj_d) {
echo "| <a href=\"index.php?entry=$maj_d&show=pdf\" class=\"status\">pdf</a> ";
- if (($maj_req_show == pdf) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (($maj_req_show == pdf) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_pdf_views_value = file_get_contents("data/items/$maj_d/pdf/count/views.txt");
@@ -3017,7 +3007,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "| <a href=\"index.php?entry=$maj_d\" class=\"status\">permalink</a>";
}
@@ -3102,7 +3092,7 @@ foreach ($maj_disp as $maj_d) {
readfile("data/panels/$maj_entry_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_entry_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -3158,14 +3148,14 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">Album';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=';
echo $maj_d;
echo '&target=album><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete album"></a>';
}
echo '</div><div class=panel_body>';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=album>here</a> to enter it.";
}
else {
@@ -3308,7 +3298,7 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">Videos</div>';
echo '<div class="panel_body">';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=videos>here</a> to enter it.";
}
else {
@@ -3346,12 +3336,12 @@ foreach ($maj_disp as $maj_d) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Filedrop";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=del.php?entry=$maj_d&target=filedrop><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=\"delete filedrop\"></a>";
}
echo "</div><div class=panel_body>";
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=filedrop>here</a> to enter it.";
}
else {
@@ -3405,12 +3395,10 @@ foreach ($maj_disp as $maj_d) {
echo "<br>$maj_size_string";
- $maj_filedrop_count_file = "data/items/$maj_d/filedrop/count/$maj_filedrop_file" . '.txt';
+ if (file_exists("data/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt")) {
+
+ $maj_filedrop_count = file_get_contents("data/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt");
- if (file_exists($maj_filedrop_count_file)) {
- $maj_fp_filedrop_count = fopen($maj_filedrop_count_file,"r");
- $maj_filedrop_count = fread($maj_fp_filedrop_count,filesize($maj_filedrop_count_file));
- fclose($maj_fp_filedrop_count);
echo "<br>$maj_filedrop_count";
if ($maj_filedrop_count == 1) {
@@ -3434,14 +3422,14 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">PDF';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=';
echo $maj_d;
echo '&target=pdf><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete pdf"></a>';
}
echo '</div><div class=panel_body>';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=pdf>here</a> to enter it.";
}
else {
@@ -3458,11 +3446,11 @@ foreach ($maj_disp as $maj_d) {
$maj_size = filesize("data/items/$maj_d/pdf/file/$maj_dl_file");
$maj_size_string = ($maj_size > 512)?( ($maj_size/1024 > 512) ?sprintf("%.02f MB",($maj_size/1024)/1024) :sprintf("%.02f KB",$maj_size/1024)) :sprintf("%d B",$maj_size);
echo $maj_size_string;
- $maj_pdf_count_file = "data/items/$maj_d/pdf/count/dl.txt";
- if (file_exists($maj_pdf_count_file)) {
- $maj_fp_pdf_count = fopen($maj_pdf_count_file,"r");
- $maj_pdf_count = fread($maj_fp_pdf_count,filesize($maj_pdf_count_file));
- fclose($maj_fp_pdf_count);
+
+ if (file_exists("data/items/$maj_d/pdf/count/dl.txt")) {
+
+ $maj_pdf_count = file_get_contents("data/items/$maj_d/pdf/count/dl.txt");
+
echo '<br>';
echo $maj_pdf_count;
if ($maj_pdf_count == 1) {
@@ -3483,9 +3471,9 @@ foreach ($maj_disp as $maj_d) {
echo '</td></tr></table>';
}
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)))) {
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
}
else {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
@@ -3522,13 +3510,13 @@ foreach ($maj_disp as $maj_d) {
echo '</a>';
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo ' <';
readfile("data/items/$maj_d/comments/live/$maj_comment/email.txt");
echo '>';
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
echo '<a href=move.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.move.png width=11 height=11 border=0 align=right alt="move comment"></a>';
echo '<a href=edit.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
@@ -3539,7 +3527,7 @@ foreach ($maj_disp as $maj_d) {
echo "<td width=75 valign=top>";
$maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
echo "<a href=member.php?id=$maj_c_author>";
- if ((file_get_contents("data/username.txt") == $maj_c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_c_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")) {
$maj_c_avatar_gif_image_size = getimagesize("images/avatar.gif");
$maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
@@ -3785,7 +3773,7 @@ foreach ($maj_disp as $maj_d) {
echo "><br>";
}
echo "$maj_c_author</a><br>";
- if ((file_get_contents("data/username.txt") == $maj_c_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_c_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -3799,11 +3787,11 @@ foreach ($maj_disp as $maj_d) {
if ($maj_c_dh_posts = opendir("data/items")) {
while (($maj_c_entry_posts = readdir($maj_c_dh_posts)) !== false) {
- if (file_exists("data/items/$maj_c_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_c_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_c_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_c_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -3826,7 +3814,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_c_entry_posts/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_c_entry_posts/cat.txt")) {
continue;
}
@@ -3836,7 +3824,7 @@ foreach ($maj_disp as $maj_d) {
$maj_c_items_posts[] = $maj_c_entry_posts;
}
}
- elseif (!file_exists("data/members/active/$maj_c_author") and (file_get_contents("data/username.txt") == $maj_c_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_c_author") and ($maj_admin_username == $maj_c_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_c_entry_posts/author.txt") and (file_get_contents("data/items/$maj_c_entry_posts/author.txt") == $maj_c_author)) {
$maj_c_items_posts[] = $maj_c_entry_posts;
}
@@ -3861,14 +3849,14 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_cxavatar_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
echo "<a href=member.php?id=$maj_cxavatar_author>$maj_cxavatar_author</a> - ";
}
entry2date($maj_comment);
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/items/$maj_d/comments/live/$maj_comment/revisions.txt")) {
echo ' (Revision ';
@@ -3881,7 +3869,7 @@ foreach ($maj_disp as $maj_d) {
$maj_entry_comment = file_get_contents("data/items/$maj_d/comments/live/$maj_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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
if (file_exists("data/pf-censor.txt")) {
$maj_censor = file_get_contents("data/pf-censor.txt");
@@ -3897,9 +3885,9 @@ foreach ($maj_disp as $maj_d) {
unset($maj_show_comments);
echo '</td></tr></table>';
- if (isset($_SESSION['logged_in'])) {
+ if (isset($maj_logged_in_username)) {
- if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread/$maj_d")) {
+ if (($maj_logged_in_username == $maj_admin_username) and file_exists("data/comments/unread/$maj_d")) {
rmdirr("data/comments/unread/$maj_d");
if (count(glob("data/comments/unread/*")) < 1) {
@@ -3907,11 +3895,11 @@ foreach ($maj_disp as $maj_d) {
}
}
else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_d")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_d");
+ if (file_exists("data/members/active/$maj_logged_in_username/comments/unread/$maj_d")) {
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread/$maj_d");
- if (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) < 1) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
+ if (count(glob("data/members/active/$maj_logged_in_username/comments/unread/*")) < 1) {
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread");
}
}
}
@@ -3920,11 +3908,11 @@ foreach ($maj_disp as $maj_d) {
echo "<a name=\"end\"></a>";
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
- 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($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username and file_exists("data/members/active/$maj_logged_in_username")))) {
if (isset($maj_req_show) and !empty($maj_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 "<font style=\"font-size: $maj_font_Lpx;\"><b>Thanks!</b></font><p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</p>";
@@ -3933,7 +3921,7 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Lpx;\"><b>Add Comment</b></font>";
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "<p>This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=comments>here</a> to enter it.</p>";
}
else {
@@ -3943,16 +3931,16 @@ foreach ($maj_disp as $maj_d) {
echo "<p>Fill out the form below";
- if (!isset($_SESSION['logged_in'])) {
+ if (!isset($maj_logged_in_username)) {
echo " and enter <b>$maj_captcha_rand</b> in the CAPTCHA field";
}
echo " to add your comment.";
- if ((!isset($_SESSION['logged_in']) and !file_exists("data/xscreen.txt")) or (!file_exists("data/xscreen.txt") and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if ((!isset($maj_logged_in_username) and !file_exists("data/xscreen.txt")) or (!file_exists("data/xscreen.txt") and isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username))) {
echo " Please wait for your comment to be approved and posted.";
- if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and !file_exists("data/members/active/{$_SESSION['logged_in']}"))) {
+ if (!isset($maj_logged_in_username) or (isset($maj_logged_in_username) and !file_exists("data/members/active/$maj_logged_in_username"))) {
echo " Comments with bogus contact information or spam will be discarded.";
}
}
@@ -3967,7 +3955,7 @@ foreach ($maj_disp as $maj_d) {
<?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
$maj_logged_in_author = explode(" ",file_get_contents("data/author.txt"));
$maj_logged_in_author_words = count($maj_logged_in_author);
@@ -3994,15 +3982,15 @@ foreach ($maj_disp as $maj_d) {
}
?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>">
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>">
<input type="hidden" name="firstname" value="<?php echo $maj_logged_in_author_fname; ?>"></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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/firstname.txt"); ?>"></td>
<?php
}
else {
@@ -4027,14 +4015,14 @@ foreach ($maj_disp as $maj_d) {
</table>
<?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
?>
<td width=75></td><td><input type=hidden name=lastname value="<?php echo $maj_logged_in_author_lname; ?>"></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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/lastname.txt"); ?>"></td>
<?php
}
else {
@@ -4043,7 +4031,7 @@ foreach ($maj_disp as $maj_d) {
<?php
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/email.txt")) {
?>
@@ -4054,9 +4042,9 @@ foreach ($maj_disp as $maj_d) {
echo "<tr><td><nobr>E-mail*</nobr></td><td colspan=2><input class=input type=email 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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/email.txt"); ?>"></td>
<?php
}
else {
@@ -4065,14 +4053,14 @@ foreach ($maj_disp as $maj_d) {
<?php
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
?>
<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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/$maj_logged_in_username/url.txt")) { echo file_get_contents("data/members/active/$maj_logged_in_username/url.txt"); } ?>"></td>
<?php
}
else {
@@ -4084,7 +4072,7 @@ foreach ($maj_disp as $maj_d) {
<tr><td><nobr>Comment*</nobr></td><td><textarea required class=input name=new_comment rows=15></textarea></td></tr>
<?php
- if (isset($_SESSION['logged_in'])) {
+ if (isset($maj_logged_in_username)) {
echo "<input type=hidden name=captcha_put value=\"$maj_captcha_rand\">";
}
else {
@@ -4103,7 +4091,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and isset($maj_req_entry) and !empty($maj_req_entry)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and isset($maj_req_entry) and !empty($maj_req_entry)) {
if ($maj_dh_pending_comments = opendir("data/items/$maj_d/comments/pending")) {
@@ -4158,10 +4146,7 @@ foreach ($maj_disp as $maj_d) {
echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
- $maj_pending_comment_key_file = "data/items/$maj_d/comments/pending/$maj_pending_comment/key.txt";
- $maj_open_pending_comment_key_file = fopen($maj_pending_comment_key_file,"r");
- $maj_pending_comment_login_key = fread($maj_open_pending_comment_key_file,filesize($maj_pending_comment_key_file));
- fclose($maj_open_pending_comment_key_file);
+ $maj_pending_comment_login_key = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/key.txt");
echo "<a href=\"index.php?entry=$maj_d&comment=$maj_pending_comment&key=$maj_pending_comment_login_key&action=approve\"><img src=\"images/widget.cat.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"post comment\"></a>";
@@ -4179,7 +4164,7 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=member.php?id=$maj_pc_author>";
- if ((file_get_contents("data/username.txt") == $maj_pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_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")) {
$maj_pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
@@ -4301,7 +4286,7 @@ foreach ($maj_disp as $maj_d) {
}
echo "$maj_pc_author</a><br>";
- if ((file_get_contents("data/username.txt") == $maj_pc_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_pc_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -4316,11 +4301,11 @@ foreach ($maj_disp as $maj_d) {
while (($maj_pc_entry_posts = readdir($maj_pc_dh_posts)) !== false) {
- if (file_exists("data/items/$maj_pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_pc_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_pc_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -4343,7 +4328,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_pc_entry_posts/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_pc_entry_posts/cat.txt")) {
continue;
}
@@ -4353,7 +4338,7 @@ foreach ($maj_disp as $maj_d) {
$maj_pc_items_posts[] = $maj_pc_entry_posts;
}
}
- elseif (!file_exists("data/members/active/$maj_pc_author") and (file_get_contents("data/username.txt") == $maj_pc_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_pc_author") and ($maj_admin_username == $maj_pc_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_pc_entry_posts/author.txt") and (file_get_contents("data/items/$maj_pc_entry_posts/author.txt") == $maj_pc_author)) {
$maj_pc_items_posts[] = $maj_pc_entry_posts;
}
@@ -4378,7 +4363,7 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_pxavatar_author = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
echo "<a href=member.php?id=$maj_pxavatar_author>$maj_pxavatar_author</a> - ";
}
@@ -4478,7 +4463,7 @@ if ($maj_count_bottom_panels > 0) {
readfile("data/panels/$maj_bottom_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_bottom_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -4550,7 +4535,7 @@ if (($maj_start >= $maj_increase) and ($maj_start != 0)) {
echo "author=$maj_req_author";
}
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and (file_get_contents("data/username.txt") == $maj_req_author) and file_exists("data/bb.txt")) {
+ if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
@@ -4598,7 +4583,7 @@ if ($maj_end < sizeof($maj_items)) {
if (isset($maj_req_author) and !empty($maj_req_author) and file_exists("data/members/active/$maj_req_author") and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and (file_get_contents("data/username.txt") == $maj_req_author) and file_exists("data/bb.txt")) {
+ if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "private")) {
@@ -4631,7 +4616,7 @@ echo "</tr></table></td>";
echo "<td width=\"$maj_wside\" valign=\"top\">";
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if ($maj_dh_pending_comment_flags = opendir("data/comments/pending")) {
while (($maj_entry_pending_comment_flags = readdir($maj_dh_pending_comment_flags)) !== false) {
if ($maj_entry_pending_comment_flags != "." && $maj_entry_pending_comment_flags != "..") {
@@ -4660,9 +4645,8 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
echo "<a href=\"index.php?entry=$maj_entry_list_pending_comment_flags&show=comments#pending\">";
readfile("data/items/$maj_entry_list_pending_comment_flags/title.txt");
echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt"));
- fclose($maj_fp_comment_count_txt);
+
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt");
if ($maj_comment_count_value == 1) {
echo " ($maj_comment_count_value comment) ";
@@ -4682,9 +4666,9 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
}
}
-if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
+if (!file_exists("data/xucomment.txt") and isset($maj_logged_in_username)) {
- if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+ if ($maj_logged_in_username == $maj_admin_username) {
if (file_exists("data/comments/unread") and (count(glob("data/comments/unread/*")) > 0)) {
@@ -4707,18 +4691,18 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+ if (file_exists("data/members/active/$maj_logged_in_username")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread") and (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) > 0)) {
+ if (file_exists("data/members/active/$maj_logged_in_username/comments/unread") and (count(glob("data/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
- if ($maj_dh_unread_comments = opendir("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
+ if ($maj_dh_unread_comments = opendir("data/members/active/$maj_logged_in_username/comments/unread")) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
if (!file_exists("data/items/$maj_unread_comment")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_unread_comment");
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread/$maj_unread_comment");
}
else {
$maj_unread_comments[] = $maj_unread_comment;
@@ -4750,7 +4734,7 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and file_exists("data/members/confirmed") and !file_exists("data/xapp.txt") and file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("data/members/confirmed") and !file_exists("data/xapp.txt") and file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
if ($maj_dh_pending_list = opendir("data/members/confirmed")) {
while (($maj_entry_pending_list = readdir($maj_dh_pending_list)) !== false) {
@@ -4850,7 +4834,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
if ($maj_dh_mempost_list = opendir("data/items")) {
while (($maj_entry_mempost_list = readdir($maj_dh_mempost_list)) !== false) {
- if (file_exists("data/items/$maj_entry_mempost_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_entry_mempost_list/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -4873,7 +4857,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_entry_mempost_list/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_entry_mempost_list/cat.txt")) {
continue;
}
@@ -4901,7 +4885,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
echo "</div></div>";
}
-if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_wrapper"><div class="panel_title">';
@@ -4918,7 +4902,7 @@ if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<div class="panel_wrapper"><div class="panel_title">Find Entries</div>';
@@ -4939,11 +4923,11 @@ if (file_exists("data/categories")) {
if ($maj_dh_categories = opendir("data/categories")) {
while (($maj_entry_categories = readdir($maj_dh_categories)) !== false) {
- if (file_exists("data/xcat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/categories/$maj_entry_categories/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/categories/$maj_entry_categories/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -4983,7 +4967,7 @@ if (file_exists("data/categories")) {
}
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<div class="panel_wrapper"><div class="panel_title">Statistics</div>';
@@ -5017,7 +5001,7 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
echo '</div></div>';
}
-if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("data/xrecent.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("data/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_wrapper"><div class="panel_title">Recent Entries</div>';
@@ -5044,7 +5028,7 @@ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_e
echo '</div></div>';
}
-if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
@@ -5058,7 +5042,7 @@ if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['
echo '</div></div>';
}
-if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
shuffle($maj_random);
reset($maj_random);
@@ -5103,7 +5087,7 @@ if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_conten
<?php
-if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("data/xarc.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("data/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
$maj_archive_entries = implode(" ",$maj_archives);
@@ -5202,7 +5186,7 @@ if ($maj_count_right_panels > 0) {
readfile("data/panels/$maj_right_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_right_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -5274,7 +5258,7 @@ if (file_exists("data/footer.txt")) {
$maj_footer_panel = file_get_contents("data/footer.txt");
- if (file_exists("data/panels/$maj_footer_panel") and (!file_exists("data/panels/$maj_footer_panel/private.txt") or isset($_SESSION['logged_in']))) {
+ if (file_exists("data/panels/$maj_footer_panel") and (!file_exists("data/panels/$maj_footer_panel/private.txt") or isset($maj_logged_in_username))) {
include("data/panels/$maj_footer_panel/panel.php");
}
tree 8f7abf637ebf845a30ea63b8f14edc0d16c9fdbd
parent 61f61580030e08df02c7c776baba6c3efe96d8c6
author Magie Antonio <magie@majcms.org> 1309138516 +0800
committer Magie Antonio <magie@majcms.org> 1309138516 +0800
Clean up session variables and fopen read-only modes
diff --git a/css.php b/css.php
index 8f4c936..2d00bdc 100644
--- a/css.php
+++ b/css.php
@@ -58,6 +58,10 @@ else {
font-size: <?php echo $maj_font_Dpx; ?>;
}
+td {
+ font-size: <?php echo $maj_font_Dpx; ?>;
+}
+
body {
padding: 0px;
margin: 0px;
diff --git a/index.php b/index.php
index 715dacc..b9311f7 100644
--- a/index.php
+++ b/index.php
@@ -10,7 +10,7 @@ error_reporting(E_ERROR);
require("core.php");
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
+if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
header("Location: login.php");
}
@@ -125,9 +125,13 @@ if (!file_exists("data/author.txt")) {
}
$maj_default_title = file_get_contents("data/title.txt");
-$maj_login_username = file_get_contents("data/username.txt");
+$maj_admin_username = file_get_contents("data/username.txt");
-if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) {
+if (isset($_SESSION['logged_in'])) {
+ $maj_logged_in_username = $_SESSION['logged_in'];
+}
+
+if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
if (file_exists("data/hits.txt")) {
$maj_global_hits_count = file_get_contents("data/hits.txt");
@@ -221,10 +225,8 @@ function go_download($maj_dl_file) {
mkdir($maj_count_path);
}
- $maj_unique_downloads = "$maj_count_path/$maj_count_file";
-
- if (file_exists($maj_unique_downloads)) {
- $maj_count_unique_downloads = file_get_contents($maj_unique_downloads);
+ if (file_exists("$maj_count_path/$maj_count_file")) {
+ $maj_count_unique_downloads = file_get_contents("$maj_count_path/$maj_count_file");
}
else {
$maj_count_unique_downloads = "0";
@@ -232,7 +234,7 @@ function go_download($maj_dl_file) {
$maj_count_unique_downloads = $maj_count_unique_downloads + 1;
- $maj_fp_unique_downloads = fopen($maj_unique_downloads,"w");
+ $maj_fp_unique_downloads = fopen("$maj_count_path/$maj_count_file","w");
fwrite($maj_fp_unique_downloads,$maj_count_unique_downloads);
fclose($maj_fp_unique_downloads);
}
@@ -452,23 +454,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
rmdirr($maj_comment_dir);
}
- $maj_pending_comment_flag_dir = $maj_req_entry;
-
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_pending_comment_flag_dir/count.txt"));
- fclose($maj_fp_comment_count_txt);
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
if ($maj_comment_count_value <= 1) {
- rmdirr("data/comments/pending/$maj_pending_comment_flag_dir");
+ rmdirr("data/comments/pending/$maj_req_entry");
}
else {
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_pending_comment_flag_dir/count.txt"));
- fclose($maj_fp_comment_count_txt);
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
$maj_comment_count_value = $maj_comment_count_value - 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag_dir/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_req_entry/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -485,7 +481,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
echo "<title>$maj_title</title>\r\n";
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
if (file_exists("data/items/$maj_req_entry/views.txt")) {
$maj_count_views = file_get_contents("data/items/$maj_req_entry/views.txt");
@@ -548,7 +544,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_firstname = htmlentities($_POST['firstname'],ENT_NOQUOTES);
$maj_firstname = trim($maj_firstname);
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
+ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
$maj_firstname = strtolower($maj_firstname);
}
@@ -560,7 +556,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_lastname = htmlentities($_POST['lastname'],ENT_NOQUOTES);
$maj_lastname = trim($maj_lastname);
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
+ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
$maj_lastname = strtolower($maj_lastname);
}
@@ -575,7 +571,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_email_txt,$maj_email);
fclose($maj_fp_email_txt);
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/email.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/email.txt")) {
$maj_fp_email_root = fopen("data/email.txt","w");
$maj_email_root = strtolower($_POST['email']);
$maj_email_root = trim($maj_email_root);
@@ -608,10 +604,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_comment_quote = ucfirst($_POST['new_comment']);
- $maj_sig_author_file = "data/author.txt";
- $maj_fp_sig_author = fopen($maj_sig_author_file,"r");
- $maj_sig_author = fread($maj_fp_sig_author,filesize($maj_sig_author_file));
- fclose($maj_fp_sig_author);
+ $maj_sig_author = file_get_contents("data/author.txt");
$maj_sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$maj_sig_url = str_replace('//','/',$maj_sig_url);
@@ -627,11 +620,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
$maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
-
- $maj_commented_entry_title_file = "data/items/$maj_req_entry/title.txt";
- $maj_fp_commented_entry_title = fopen($maj_commented_entry_title_file,"r");
- $maj_commented_entry_title = fread($maj_fp_commented_entry_title,filesize($maj_commented_entry_title_file));
- fclose($maj_fp_commented_entry_title);
+
+ $maj_commented_entry_title = file_get_contents("data/items/$maj_req_entry/title.txt");
if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
@@ -688,7 +678,7 @@ else {
echo "<title>$maj_default_title</title>\r\n";
}
-if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")))) {
+if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")))) {
if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
@@ -714,9 +704,9 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- if (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")) {
+ if (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")) {
- if ($_SESSION['logged_in'] == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+ if ($maj_logged_in_username == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
$maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
@@ -780,7 +770,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
$maj_description = substr($maj_description,0,210);
$maj_description = htmlentities($maj_description,ENT_NOQUOTES);
- 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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
@@ -818,7 +808,7 @@ if (file_exists("data/header.txt")) {
$maj_header_panel = file_get_contents("data/header.txt");
- if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($_SESSION['logged_in']))) {
+ if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
include("data/panels/$maj_header_panel/panel.php");
}
@@ -830,7 +820,7 @@ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_
echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-if (!file_exists("data/xprofile.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Profile</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t";
@@ -911,7 +901,7 @@ if (!file_exists("data/xprofile.txt") or ($_SESSION['logged_in'] == file_get_con
echo "\r\n\t</div>\r\n</div>\r\n\r\n";
}
-if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Navigation</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t<a class=\"navlink\" href=\".\">Home</a><br>\r\n";
@@ -919,7 +909,7 @@ if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_
echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "\t\t<a class=\"navlink\" href=\"add.php\">Add Entry</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"settings.php\">Settings</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"panels.php\">Panels</a><br>\r\n";
@@ -928,16 +918,16 @@ if (!file_exists("data/xnavigation.txt") or ($_SESSION['logged_in'] == file_get_
echo "\t\t<a class=\"navlink\" href=\"fonts.php\">Fonts</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"login.php\">Logout</a>\r\n";
}
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $maj_login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category")) {
+ if (file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
if (!file_exists("data/categories/$maj_req_category")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category");
+ rmdirr("data/members/active/$maj_logged_in_username/categories/$maj_req_category");
}
}
- if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") or file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$maj_req_category"))) {
+ if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -961,11 +951,11 @@ if (file_exists("data/sticky")) {
while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
- if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -988,7 +978,7 @@ if (file_exists("data/sticky")) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
continue;
}
@@ -1027,11 +1017,11 @@ if (file_exists("data/panels")) {
if ($maj_panel != "." && $maj_panel != "..") {
- if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($_SESSION['logged_in'])) {
+ if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
continue;
}
@@ -1181,7 +1171,7 @@ if (file_exists("data/panels")) {
readfile("data/panels/$maj_left_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_left_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -1313,7 +1303,7 @@ if ($maj_count_top_panels > 0) {
readfile("data/panels/$maj_top_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_top_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -1494,7 +1484,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_grand[] = $maj_item;
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
@@ -1510,7 +1500,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or (file_get_contents("data/username.txt") == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
@@ -1582,11 +1572,11 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
- if ((file_exists("data/items/$maj_item/members") and !isset($_SESSION['logged_in'])) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/{$_SESSION['logged_in']}"))) {
+ if ((file_exists("data/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
- if (file_exists("data/items/$maj_item/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -1619,7 +1609,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or (file_get_contents("data/username.txt") == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
}
@@ -1641,11 +1631,11 @@ $maj_count_grand = count($maj_grand);
if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
- if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
unset($maj_items);
}
- if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($_SESSION['logged_in'])) {
+ if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
unset($maj_items);
}
}
@@ -1849,7 +1839,7 @@ if ($maj_count_center_panels > 0) {
readfile("data/panels/$maj_center_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_center_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -2057,7 +2047,7 @@ foreach ($maj_disp as $maj_d) {
echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t\t";
- if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_title"';
@@ -2085,7 +2075,7 @@ foreach ($maj_disp as $maj_d) {
readfile("data/items/$maj_d/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $maj_login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\">";
@@ -2098,7 +2088,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"del.php?entry=$maj_d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
@@ -2208,7 +2198,7 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=\"member.php?id=$maj_author\">";
- if ((file_get_contents("data/username.txt") == $maj_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_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")) {
@@ -2446,7 +2436,7 @@ foreach ($maj_disp as $maj_d) {
echo "<b>$maj_author</b></a><br>";
- if ((file_get_contents("data/username.txt") == $maj_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -2463,7 +2453,7 @@ foreach ($maj_disp as $maj_d) {
if ($maj_author_post != "." && $maj_author_post != "..") {
- if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -2486,7 +2476,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_author_post/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_author_post/cat.txt")) {
continue;
}
@@ -2496,7 +2486,7 @@ foreach ($maj_disp as $maj_d) {
$maj_items_posts[] = $maj_author_post;
}
}
- elseif (!file_exists("data/members/active/$maj_author") and (file_get_contents("data/username.txt") == $maj_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_author") and ($maj_admin_username == $maj_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_author_post/author.txt") and (file_get_contents("data/items/$maj_author_post/author.txt") == $maj_author)) {
$maj_items_posts[] = $maj_author_post;
@@ -2540,22 +2530,22 @@ foreach ($maj_disp as $maj_d) {
}
- if (!file_exists("data/items/$maj_d/xdate.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xdate.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_xavatar_author = file_get_contents("data/items/$maj_d/author.txt");
- if (!file_exists("data/items/$maj_d/xauthor.txt") or (file_exists("data/items/$maj_d/xauthor.txt") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+ if (!file_exists("data/items/$maj_d/xauthor.txt") or (file_exists("data/items/$maj_d/xauthor.txt") and ($maj_logged_in_username == $maj_admin_username))) {
echo "$maj_xavatar_author - ";
}
}
entry2date($maj_d);
- if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) or file_exists("data/items/$maj_d/lastmod.txt")) {
+ if ((isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or file_exists("data/items/$maj_d/lastmod.txt")) {
if (file_exists("data/items/$maj_d/revisions.txt")) {
echo " (Revision ";
@@ -2566,7 +2556,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- echo "</font><font style=\"font-size: 5px;\"><br><br></font>";
+ echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
}
@@ -2574,13 +2564,13 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"color: $maj_d_text_b;\">";
}
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=\"passwd.php?entry=$maj_d\">here</a> to enter it.";
}
else {
$maj_entry_body = file_get_contents("data/items/$maj_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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
@@ -2608,7 +2598,7 @@ foreach ($maj_disp as $maj_d) {
echo "$maj_entry_body";
}
- if ((file_get_contents("data/username.txt") == $maj_author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
+ if (($maj_admin_username == $maj_author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
$maj_sig = file_get_contents("data/sig.txt");
echo "<br><br>--<br>$maj_sig";
}
@@ -2639,7 +2629,7 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t</div>";
- if (file_exists("data/items/$maj_d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (file_exists("data/items/$maj_d/categories") and ($maj_logged_in_username == $maj_admin_username)) {
if ($maj_dh_entry_categories = opendir("data/items/$maj_d/categories")) {
@@ -2719,7 +2709,7 @@ foreach ($maj_disp as $maj_d) {
echo ">\r\n\t\t\t\t";
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
if (!file_exists("data/items/$maj_d/comments/live")) {
echo "<a href=\"index.php?entry=$maj_d&show=comments\" class=\"status\">add comment</a>";
@@ -2813,7 +2803,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/album");
}
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_album_views_value = file_get_contents("data/items/$maj_d/album/views.txt");
@@ -2849,7 +2839,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/media/videos");
}
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
if (!file_exists("data/items/$maj_d/media/videos/views.txt")) {
$maj_videos_views_value = 0;
@@ -2964,7 +2954,7 @@ foreach ($maj_disp as $maj_d) {
mkdir("data/items/$maj_d/filedrop");
}
- if (file_exists("data/items/$maj_d/filedrop/files") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_d/filedrop/files") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_filedrop_views_value = file_get_contents("data/items/$maj_d/filedrop/views.txt");
@@ -2993,7 +2983,7 @@ foreach ($maj_disp as $maj_d) {
echo "| <a href=\"index.php?entry=$maj_d&show=pdf\" class=\"status\">pdf</a> ";
- if (($maj_req_show == pdf) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (($maj_req_show == pdf) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
$maj_pdf_views_value = file_get_contents("data/items/$maj_d/pdf/count/views.txt");
@@ -3017,7 +3007,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "| <a href=\"index.php?entry=$maj_d\" class=\"status\">permalink</a>";
}
@@ -3102,7 +3092,7 @@ foreach ($maj_disp as $maj_d) {
readfile("data/panels/$maj_entry_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_entry_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -3158,14 +3148,14 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">Album';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=';
echo $maj_d;
echo '&target=album><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete album"></a>';
}
echo '</div><div class=panel_body>';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=album>here</a> to enter it.";
}
else {
@@ -3308,7 +3298,7 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">Videos</div>';
echo '<div class="panel_body">';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=videos>here</a> to enter it.";
}
else {
@@ -3346,12 +3336,12 @@ foreach ($maj_disp as $maj_d) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Filedrop";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=del.php?entry=$maj_d&target=filedrop><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=\"delete filedrop\"></a>";
}
echo "</div><div class=panel_body>";
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=filedrop>here</a> to enter it.";
}
else {
@@ -3405,12 +3395,10 @@ foreach ($maj_disp as $maj_d) {
echo "<br>$maj_size_string";
- $maj_filedrop_count_file = "data/items/$maj_d/filedrop/count/$maj_filedrop_file" . '.txt';
+ if (file_exists("data/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt")) {
+
+ $maj_filedrop_count = file_get_contents("data/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt");
- if (file_exists($maj_filedrop_count_file)) {
- $maj_fp_filedrop_count = fopen($maj_filedrop_count_file,"r");
- $maj_filedrop_count = fread($maj_fp_filedrop_count,filesize($maj_filedrop_count_file));
- fclose($maj_fp_filedrop_count);
echo "<br>$maj_filedrop_count";
if ($maj_filedrop_count == 1) {
@@ -3434,14 +3422,14 @@ foreach ($maj_disp as $maj_d) {
echo '<div class="panel_wrapper"><div class="panel_title">PDF';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=';
echo $maj_d;
echo '&target=pdf><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete pdf"></a>';
}
echo '</div><div class=panel_body>';
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=pdf>here</a> to enter it.";
}
else {
@@ -3458,11 +3446,11 @@ foreach ($maj_disp as $maj_d) {
$maj_size = filesize("data/items/$maj_d/pdf/file/$maj_dl_file");
$maj_size_string = ($maj_size > 512)?( ($maj_size/1024 > 512) ?sprintf("%.02f MB",($maj_size/1024)/1024) :sprintf("%.02f KB",$maj_size/1024)) :sprintf("%d B",$maj_size);
echo $maj_size_string;
- $maj_pdf_count_file = "data/items/$maj_d/pdf/count/dl.txt";
- if (file_exists($maj_pdf_count_file)) {
- $maj_fp_pdf_count = fopen($maj_pdf_count_file,"r");
- $maj_pdf_count = fread($maj_fp_pdf_count,filesize($maj_pdf_count_file));
- fclose($maj_fp_pdf_count);
+
+ if (file_exists("data/items/$maj_d/pdf/count/dl.txt")) {
+
+ $maj_pdf_count = file_get_contents("data/items/$maj_d/pdf/count/dl.txt");
+
echo '<br>';
echo $maj_pdf_count;
if ($maj_pdf_count == 1) {
@@ -3483,9 +3471,9 @@ foreach ($maj_disp as $maj_d) {
echo '</td></tr></table>';
}
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)))) {
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
}
else {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
@@ -3522,13 +3510,13 @@ foreach ($maj_disp as $maj_d) {
echo '</a>';
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo ' <';
readfile("data/items/$maj_d/comments/live/$maj_comment/email.txt");
echo '>';
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
echo '<a href=move.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.move.png width=11 height=11 border=0 align=right alt="move comment"></a>';
echo '<a href=edit.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
@@ -3539,7 +3527,7 @@ foreach ($maj_disp as $maj_d) {
echo "<td width=75 valign=top>";
$maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
echo "<a href=member.php?id=$maj_c_author>";
- if ((file_get_contents("data/username.txt") == $maj_c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_c_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")) {
$maj_c_avatar_gif_image_size = getimagesize("images/avatar.gif");
$maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
@@ -3785,7 +3773,7 @@ foreach ($maj_disp as $maj_d) {
echo "><br>";
}
echo "$maj_c_author</a><br>";
- if ((file_get_contents("data/username.txt") == $maj_c_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_c_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -3799,11 +3787,11 @@ foreach ($maj_disp as $maj_d) {
if ($maj_c_dh_posts = opendir("data/items")) {
while (($maj_c_entry_posts = readdir($maj_c_dh_posts)) !== false) {
- if (file_exists("data/items/$maj_c_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_c_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_c_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_c_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -3826,7 +3814,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_c_entry_posts/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_c_entry_posts/cat.txt")) {
continue;
}
@@ -3836,7 +3824,7 @@ foreach ($maj_disp as $maj_d) {
$maj_c_items_posts[] = $maj_c_entry_posts;
}
}
- elseif (!file_exists("data/members/active/$maj_c_author") and (file_get_contents("data/username.txt") == $maj_c_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_c_author") and ($maj_admin_username == $maj_c_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_c_entry_posts/author.txt") and (file_get_contents("data/items/$maj_c_entry_posts/author.txt") == $maj_c_author)) {
$maj_c_items_posts[] = $maj_c_entry_posts;
}
@@ -3861,14 +3849,14 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_cxavatar_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
echo "<a href=member.php?id=$maj_cxavatar_author>$maj_cxavatar_author</a> - ";
}
entry2date($maj_comment);
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/items/$maj_d/comments/live/$maj_comment/revisions.txt")) {
echo ' (Revision ';
@@ -3881,7 +3869,7 @@ foreach ($maj_disp as $maj_d) {
$maj_entry_comment = file_get_contents("data/items/$maj_d/comments/live/$maj_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"))))) {
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
$maj_badwords = file_get_contents("data/pf-badwords.txt");
if (file_exists("data/pf-censor.txt")) {
$maj_censor = file_get_contents("data/pf-censor.txt");
@@ -3897,9 +3885,9 @@ foreach ($maj_disp as $maj_d) {
unset($maj_show_comments);
echo '</td></tr></table>';
- if (isset($_SESSION['logged_in'])) {
+ if (isset($maj_logged_in_username)) {
- if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread/$maj_d")) {
+ if (($maj_logged_in_username == $maj_admin_username) and file_exists("data/comments/unread/$maj_d")) {
rmdirr("data/comments/unread/$maj_d");
if (count(glob("data/comments/unread/*")) < 1) {
@@ -3907,11 +3895,11 @@ foreach ($maj_disp as $maj_d) {
}
}
else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_d")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_d");
+ if (file_exists("data/members/active/$maj_logged_in_username/comments/unread/$maj_d")) {
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread/$maj_d");
- if (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) < 1) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
+ if (count(glob("data/members/active/$maj_logged_in_username/comments/unread/*")) < 1) {
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread");
}
}
}
@@ -3920,11 +3908,11 @@ foreach ($maj_disp as $maj_d) {
echo "<a name=\"end\"></a>";
- if (!file_exists("data/nocomment.txt") or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
+ if (!file_exists("data/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("data/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
- 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($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username and file_exists("data/members/active/$maj_logged_in_username")))) {
if (isset($maj_req_show) and !empty($maj_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 "<font style=\"font-size: $maj_font_Lpx;\"><b>Thanks!</b></font><p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</p>";
@@ -3933,7 +3921,7 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Lpx;\"><b>Add Comment</b></font>";
- if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
+ if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
echo "<p>This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=comments>here</a> to enter it.</p>";
}
else {
@@ -3943,16 +3931,16 @@ foreach ($maj_disp as $maj_d) {
echo "<p>Fill out the form below";
- if (!isset($_SESSION['logged_in'])) {
+ if (!isset($maj_logged_in_username)) {
echo " and enter <b>$maj_captcha_rand</b> in the CAPTCHA field";
}
echo " to add your comment.";
- if ((!isset($_SESSION['logged_in']) and !file_exists("data/xscreen.txt")) or (!file_exists("data/xscreen.txt") and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if ((!isset($maj_logged_in_username) and !file_exists("data/xscreen.txt")) or (!file_exists("data/xscreen.txt") and isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username))) {
echo " Please wait for your comment to be approved and posted.";
- if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and !file_exists("data/members/active/{$_SESSION['logged_in']}"))) {
+ if (!isset($maj_logged_in_username) or (isset($maj_logged_in_username) and !file_exists("data/members/active/$maj_logged_in_username"))) {
echo " Comments with bogus contact information or spam will be discarded.";
}
}
@@ -3967,7 +3955,7 @@ foreach ($maj_disp as $maj_d) {
<?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
$maj_logged_in_author = explode(" ",file_get_contents("data/author.txt"));
$maj_logged_in_author_words = count($maj_logged_in_author);
@@ -3994,15 +3982,15 @@ foreach ($maj_disp as $maj_d) {
}
?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>">
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>">
<input type="hidden" name="firstname" value="<?php echo $maj_logged_in_author_fname; ?>"></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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/firstname.txt"); ?>"></td>
<?php
}
else {
@@ -4027,14 +4015,14 @@ foreach ($maj_disp as $maj_d) {
</table>
<?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
?>
<td width=75></td><td><input type=hidden name=lastname value="<?php echo $maj_logged_in_author_lname; ?>"></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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/lastname.txt"); ?>"></td>
<?php
}
else {
@@ -4043,7 +4031,7 @@ foreach ($maj_disp as $maj_d) {
<?php
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/email.txt")) {
?>
@@ -4054,9 +4042,9 @@ foreach ($maj_disp as $maj_d) {
echo "<tr><td><nobr>E-mail*</nobr></td><td colspan=2><input class=input type=email 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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/$maj_logged_in_username/email.txt"); ?>"></td>
<?php
}
else {
@@ -4065,14 +4053,14 @@ foreach ($maj_disp as $maj_d) {
<?php
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
?>
<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")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
?>
- <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>
+ <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/$maj_logged_in_username/url.txt")) { echo file_get_contents("data/members/active/$maj_logged_in_username/url.txt"); } ?>"></td>
<?php
}
else {
@@ -4084,7 +4072,7 @@ foreach ($maj_disp as $maj_d) {
<tr><td><nobr>Comment*</nobr></td><td><textarea required class=input name=new_comment rows=15></textarea></td></tr>
<?php
- if (isset($_SESSION['logged_in'])) {
+ if (isset($maj_logged_in_username)) {
echo "<input type=hidden name=captcha_put value=\"$maj_captcha_rand\">";
}
else {
@@ -4103,7 +4091,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and isset($maj_req_entry) and !empty($maj_req_entry)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and isset($maj_req_entry) and !empty($maj_req_entry)) {
if ($maj_dh_pending_comments = opendir("data/items/$maj_d/comments/pending")) {
@@ -4158,10 +4146,7 @@ foreach ($maj_disp as $maj_d) {
echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
- $maj_pending_comment_key_file = "data/items/$maj_d/comments/pending/$maj_pending_comment/key.txt";
- $maj_open_pending_comment_key_file = fopen($maj_pending_comment_key_file,"r");
- $maj_pending_comment_login_key = fread($maj_open_pending_comment_key_file,filesize($maj_pending_comment_key_file));
- fclose($maj_open_pending_comment_key_file);
+ $maj_pending_comment_login_key = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/key.txt");
echo "<a href=\"index.php?entry=$maj_d&comment=$maj_pending_comment&key=$maj_pending_comment_login_key&action=approve\"><img src=\"images/widget.cat.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"post comment\"></a>";
@@ -4179,7 +4164,7 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=member.php?id=$maj_pc_author>";
- if ((file_get_contents("data/username.txt") == $maj_pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+ if (($maj_admin_username == $maj_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")) {
$maj_pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
@@ -4301,7 +4286,7 @@ foreach ($maj_disp as $maj_d) {
}
echo "$maj_pc_author</a><br>";
- if ((file_get_contents("data/username.txt") == $maj_pc_author) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $maj_pc_author) and file_exists("data/rank.txt")) {
echo "administrator<br>";
}
elseif (file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
@@ -4316,11 +4301,11 @@ foreach ($maj_disp as $maj_d) {
while (($maj_pc_entry_posts = readdir($maj_pc_dh_posts)) !== false) {
- if (file_exists("data/items/$maj_pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_pc_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
+ if (file_exists("data/items/$maj_pc_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
@@ -4343,7 +4328,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_pc_entry_posts/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_pc_entry_posts/cat.txt")) {
continue;
}
@@ -4353,7 +4338,7 @@ foreach ($maj_disp as $maj_d) {
$maj_pc_items_posts[] = $maj_pc_entry_posts;
}
}
- elseif (!file_exists("data/members/active/$maj_pc_author") and (file_get_contents("data/username.txt") == $maj_pc_author) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$maj_pc_author") and ($maj_admin_username == $maj_pc_author) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$maj_pc_entry_posts/author.txt") and (file_get_contents("data/items/$maj_pc_entry_posts/author.txt") == $maj_pc_author)) {
$maj_pc_items_posts[] = $maj_pc_entry_posts;
}
@@ -4378,7 +4363,7 @@ foreach ($maj_disp as $maj_d) {
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and !file_exists("data/avatar.txt"))))) {
+ if ((file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/avatar.txt"))))) {
$maj_pxavatar_author = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
echo "<a href=member.php?id=$maj_pxavatar_author>$maj_pxavatar_author</a> - ";
}
@@ -4478,7 +4463,7 @@ if ($maj_count_bottom_panels > 0) {
readfile("data/panels/$maj_bottom_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_bottom_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -4550,7 +4535,7 @@ if (($maj_start >= $maj_increase) and ($maj_start != 0)) {
echo "author=$maj_req_author";
}
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and (file_get_contents("data/username.txt") == $maj_req_author) and file_exists("data/bb.txt")) {
+ if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
@@ -4598,7 +4583,7 @@ if ($maj_end < sizeof($maj_items)) {
if (isset($maj_req_author) and !empty($maj_req_author) and file_exists("data/members/active/$maj_req_author") and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and (file_get_contents("data/username.txt") == $maj_req_author) and file_exists("data/bb.txt")) {
+ if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("data/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("data/bb.txt")) {
echo "author=$maj_req_author";
}
if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "private")) {
@@ -4631,7 +4616,7 @@ echo "</tr></table></td>";
echo "<td width=\"$maj_wside\" valign=\"top\">";
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if ($maj_dh_pending_comment_flags = opendir("data/comments/pending")) {
while (($maj_entry_pending_comment_flags = readdir($maj_dh_pending_comment_flags)) !== false) {
if ($maj_entry_pending_comment_flags != "." && $maj_entry_pending_comment_flags != "..") {
@@ -4660,9 +4645,8 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
echo "<a href=\"index.php?entry=$maj_entry_list_pending_comment_flags&show=comments#pending\">";
readfile("data/items/$maj_entry_list_pending_comment_flags/title.txt");
echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt","r");
- $maj_comment_count_value = fread($maj_fp_comment_count_txt,filesize("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt"));
- fclose($maj_fp_comment_count_txt);
+
+ $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_entry_list_pending_comment_flags/count.txt");
if ($maj_comment_count_value == 1) {
echo " ($maj_comment_count_value comment) ";
@@ -4682,9 +4666,9 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
}
}
-if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
+if (!file_exists("data/xucomment.txt") and isset($maj_logged_in_username)) {
- if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+ if ($maj_logged_in_username == $maj_admin_username) {
if (file_exists("data/comments/unread") and (count(glob("data/comments/unread/*")) > 0)) {
@@ -4707,18 +4691,18 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+ if (file_exists("data/members/active/$maj_logged_in_username")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread") and (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) > 0)) {
+ if (file_exists("data/members/active/$maj_logged_in_username/comments/unread") and (count(glob("data/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
- if ($maj_dh_unread_comments = opendir("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
+ if ($maj_dh_unread_comments = opendir("data/members/active/$maj_logged_in_username/comments/unread")) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
if (!file_exists("data/items/$maj_unread_comment")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_unread_comment");
+ rmdirr("data/members/active/$maj_logged_in_username/comments/unread/$maj_unread_comment");
}
else {
$maj_unread_comments[] = $maj_unread_comment;
@@ -4750,7 +4734,7 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username) and file_exists("data/members/confirmed") and !file_exists("data/xapp.txt") and file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("data/members/confirmed") and !file_exists("data/xapp.txt") and file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
if ($maj_dh_pending_list = opendir("data/members/confirmed")) {
while (($maj_entry_pending_list = readdir($maj_dh_pending_list)) !== false) {
@@ -4850,7 +4834,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
if ($maj_dh_mempost_list = opendir("data/items")) {
while (($maj_entry_mempost_list = readdir($maj_dh_mempost_list)) !== false) {
- if (file_exists("data/items/$maj_entry_mempost_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/items/$maj_entry_mempost_list/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -4873,7 +4857,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
}
}
- if (($maj_private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and !file_exists("data/items/$maj_entry_mempost_list/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_entry_mempost_list/cat.txt")) {
continue;
}
@@ -4901,7 +4885,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
echo "</div></div>";
}
-if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_wrapper"><div class="panel_title">';
@@ -4918,7 +4902,7 @@ if (($maj_count_grand > 0) and (!file_exists("data/xsearch.txt") or ($_SESSION['
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<div class="panel_wrapper"><div class="panel_title">Find Entries</div>';
@@ -4939,11 +4923,11 @@ if (file_exists("data/categories")) {
if ($maj_dh_categories = opendir("data/categories")) {
while (($maj_entry_categories = readdir($maj_dh_categories)) !== false) {
- if (file_exists("data/xcat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/categories/$maj_entry_categories/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
+ if (file_exists("data/categories/$maj_entry_categories/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -4983,7 +4967,7 @@ if (file_exists("data/categories")) {
}
}
-if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<div class="panel_wrapper"><div class="panel_title">Statistics</div>';
@@ -5017,7 +5001,7 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_user
echo '</div></div>';
}
-if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("data/xrecent.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("data/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_wrapper"><div class="panel_title">Recent Entries</div>';
@@ -5044,7 +5028,7 @@ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_e
echo '</div></div>';
}
-if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
@@ -5058,7 +5042,7 @@ if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['
echo '</div></div>';
}
-if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (!file_exists("data/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
shuffle($maj_random);
reset($maj_random);
@@ -5103,7 +5087,7 @@ if (!file_exists("data/xrand.txt") or ($_SESSION['logged_in'] == file_get_conten
<?php
-if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("data/xarc.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
+if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("data/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
$maj_archive_entries = implode(" ",$maj_archives);
@@ -5202,7 +5186,7 @@ if ($maj_count_right_panels > 0) {
readfile("data/panels/$maj_right_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $maj_login_username)) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_right_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
@@ -5274,7 +5258,7 @@ if (file_exists("data/footer.txt")) {
$maj_footer_panel = file_get_contents("data/footer.txt");
- if (file_exists("data/panels/$maj_footer_panel") and (!file_exists("data/panels/$maj_footer_panel/private.txt") or isset($_SESSION['logged_in']))) {
+ if (file_exists("data/panels/$maj_footer_panel") and (!file_exists("data/panels/$maj_footer_panel/private.txt") or isset($maj_logged_in_username))) {
include("data/panels/$maj_footer_panel/panel.php");
}