This commit has been accessed 625 times via Git panel.
commit 56488ab9d41b2f0d54ffa69a12d92faf55641b4c
tree 322736b89722219f2879bcfe04c90c9d28d0138a
parent c3d9b4ee2de3b7aea7a63b8dc6f503219f037c92
author Engels Antonio <engels@majcms.org> 1322465982 +0800
committer Engels Antonio <engels@majcms.org> 1322465982 +0800
Enable left and right positioning of panels
diff --git a/add.php b/add.php
index 88dd8f8..a3ab0aa 100644
--- a/add.php
+++ b/add.php
@@ -284,7 +284,7 @@ echo "\n<style>body { margin: {$maj_wspace}px; } .input, .click { width: 520px;
}
sort($show_cat);
- reset($show_cat);
+
$count_cat = count($show_cat);
if ($count_cat > 0) {
diff --git a/album.php b/album.php
index bb622d5..4934f45 100644
--- a/album.php
+++ b/album.php
@@ -134,7 +134,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
sort($sort_album);
- reset($sort_album);
}
$key_view = array_search($maj_req_show,$sort_album);
diff --git a/cat.php b/cat.php
index 73ed1c4..5caa04d 100644
--- a/cat.php
+++ b/cat.php
@@ -188,7 +188,7 @@ echo "\n<style>body { margin: {$maj_wspace}px; }</style>\n";
}
sort($show_cat);
- reset($show_cat);
+
$count_cat = count($show_cat);
if ($count_cat > 0) {
diff --git a/colors.php b/colors.php
index 11314c3..498af06 100644
--- a/colors.php
+++ b/colors.php
@@ -995,7 +995,6 @@ if ($dh_color_scheme = opendir("data/schemes/colors")) {
}
sort($color_schemes);
-reset($color_schemes);
if (count($color_schemes) > 0) {
echo "<form action=colors.php method=post>";
diff --git a/core.php b/core.php
index 235ef43..2719738 100644
--- a/core.php
+++ b/core.php
@@ -107,7 +107,15 @@ else {
$maj_wspace = "10";
-$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+if (file_exists("$maj_data_directory/panels-l.txt") or file_exists("$maj_data_directory/panels-r.txt")) {
+
+ $maj_wmain = $maj_wmain + $maj_space + $maj_wside;
+
+ $maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace;
+}
+else {
+ $maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+}
$maj_default_blog_title = "My Activity Journal";
$maj_default_username = "maj";
@@ -666,6 +674,180 @@ function maj_download_file($file_name,$file_dir,$count_dir) {
}
}
+function maj_profile() {
+
+ global $maj_data_directory;
+ global $maj_image_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (!file_exists("$maj_data_directory/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";
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
+ $max = 150;
+ }
+ else {
+ $max = 190;
+ }
+
+ if (file_exists("$maj_image_directory/profile.gif")) {
+ $img = "$maj_image_directory/profile.gif";
+ }
+
+ if (file_exists("$maj_image_directory/profile.jpg")) {
+ $img = "$maj_image_directory/profile.jpg";
+ }
+
+ if (file_exists("$maj_image_directory/profile.png")) {
+ $img = "$maj_image_directory/profile.png";
+ }
+
+ $size = getimagesize($img);
+ $width = $size[0];
+ $height = $size[1];
+
+ if ($width > $max) {
+
+ $factor = (double) ($max / $width) ;
+ $width = (int) ($width * $factor);
+ $height = (int) ($height * $factor);
+
+ echo "<a href=\".\"><img src=\"$img\" border=\"0\" width=\"$width\" height=\"$height\"></a><br>";
+ }
+ else {
+ echo "<a href=\".\"><img src=\"$img\" border=\"0\" width=\"$width\" height=\"$height\" align=\"left\"></a>";
+ }
+
+ include("$maj_data_directory/profile.php");
+
+ echo "\r\n\t</div>\r\n</div>\r\n\r\n";
+ }
+}
+
+function maj_navigation() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_req_category;
+
+ if (!file_exists("$maj_data_directory/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";
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
+ echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
+ }
+
+ 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";
+ echo "\t\t<a class=\"navlink\" href=\"cat.php\">Categories</a><br>\r\n";
+ echo "\t\t<a class=\"navlink\" href=\"colors.php\">Colors</a><br>\r\n";
+ 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($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
+
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
+
+ if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
+ }
+ }
+
+ if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
+ echo '<a class="navlink" href="add.php">Add Entry</a><br>';
+ }
+
+ echo '<a class="navlink" href="options.php">Options</a><br>';
+ echo '<a class="navlink" href="login.php">Logout</a>';
+ }
+ else {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
+ echo '<a class="navlink" href="reg.php">Register</a><br>';
+ }
+
+ echo '<a class="navlink" href="login.php">Login</a>';
+ }
+
+ echo "\t</div>\r\n</div>\r\n";
+ }
+}
+
+function maj_quick_links() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/sticky")) {
+
+ if ($dh_sticky_data = opendir("$maj_data_directory/sticky")) {
+
+ while (($entry = readdir($dh_sticky_data)) !== false) {
+
+ if (file_exists("$maj_data_directory/items/$entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/items/$entry/member.txt") and (!isset($maj_logged_in_username))) {
+ continue;
+ }
+
+ $private = "0";
+
+ if (file_exists("$maj_data_directory/items/$entry/categories")) {
+
+ if ($dh_sticky_entry = opendir("$maj_data_directory/items/$entry/categories")) {
+
+ while (($category = readdir($dh_sticky_entry)) !== false) {
+
+ if ($category != "." && $category != "..") {
+
+ if (file_exists("$maj_data_directory/categories/$category/private.txt")) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_sticky_entry);
+ }
+ }
+
+ if (($private > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$entry/cat.txt")) {
+ continue;
+ }
+
+ if ($entry != "." && $entry != "..") {
+ $entries[] = $entry;
+ }
+ }
+ closedir($dh_sticky_data);
+ }
+
+ sort($entries);
+
+ if (count($entries) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Quick Links</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($entries as $entry) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$entry\">";
+ readfile("$maj_data_directory/items/$entry/title.txt");
+ echo "</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
function maj_panels($panel_array) {
global $maj_data_directory;
@@ -726,7 +908,6 @@ function maj_panels($panel_array) {
if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
-
}
}
@@ -854,4 +1035,648 @@ function maj_panels($panel_array) {
}
}
+function maj_pending_comments() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+ global $maj_count_latest;
+ global $maj_font_Spx;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ if ($dh_pending_comments = opendir("$maj_data_directory/comments/pending")) {
+
+ while (($entry = readdir($dh_pending_comments)) !== false) {
+
+ if ($entry != "." && $entry != "..") {
+ $entries[] = $entry;
+ }
+ }
+
+ closedir($dh_pending_comments);
+ }
+
+ rsort($entries);
+
+ if (($maj_count_latest > 0) and (count($entries) > 0)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Pending Comments</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($entries as $entry) {
+
+ echo "<a href=\"index.php?entry=$entry&show=comments#pending\">";
+ readfile("$maj_data_directory/items/$entry/title.txt");
+ echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
+
+ $count = file_get_contents("$maj_data_directory/comments/pending/$entry/count.txt");
+
+ if ($count == 1) {
+ echo " ($count comment) ";
+ }
+ elseif ($count > 1) {
+ echo " ($count comments) ";
+ }
+ else {
+ echo "";
+ }
+ echo "</font><br>";
+ }
+ }
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_unread_comments() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (!file_exists("$maj_data_directory/xucomment.txt") and isset($maj_logged_in_username)) {
+
+ if ($maj_logged_in_username == $maj_admin_username) {
+
+ if (file_exists("$maj_data_directory/comments/unread") and (count(glob("$maj_data_directory/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("$maj_data_directory/comments/unread")) {
+
+ while (($comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($comment != "." && $comment != "..") {
+
+ if (!file_exists("$maj_data_directory/items/$comment")) {
+ rmdirr("$maj_data_directory/comments/unread/$comment");
+ }
+ else {
+ $comments[] = $comment;
+ }
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ else {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username")) {
+
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread") and (count(glob("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread")) {
+
+ while (($comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($comment != "." && $comment != "..") {
+
+ if (!file_exists("$maj_data_directory/items/$comment")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$comment");
+ }
+ else {
+ $comments[] = $comment;
+ }
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ }
+
+ sort($comments);
+
+ if (count($comments) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "<a href=\"del.php?target=unread\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\"></a>";
+ echo "Unread Comments";
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
+
+ foreach ($comments as $comment) {
+
+ $title = file_get_contents("$maj_data_directory/items/$comment/title.txt");
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$comment&show=comments\">$title</a></td></tr>";
+ }
+
+ echo "</table>";
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
+function maj_pending_members() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("$maj_data_directory/members/confirmed") and !file_exists("$maj_data_directory/xapp.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
+
+ if ($dh_members = opendir("$maj_data_directory/members/confirmed")) {
+
+ while (($member = readdir($dh_members)) !== false) {
+
+ if ($member != "." && $member != "..") {
+ $members[] = $member;
+ }
+ }
+ closedir($dh_members);
+ }
+
+ sort($members);
+
+ $count = count($members);
+
+ if ($count > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "Pending Member";
+
+ if ($count > 1) {
+ echo "s";
+ }
+
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+ echo "Please approve or deny $count pending membership request";
+
+ if ($count > 1) {
+ echo "s";
+ }
+
+ echo " below.";
+ echo "</div>";
+ echo "</div>";
+
+ foreach ($members as $member) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "$member";
+
+ echo "<a href=\"reg.php?username=$member&key=";
+ readfile("$maj_data_directory/members/confirmed/$member/key.txt");
+ echo "&action=deny\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"deny\"></a>";
+
+ echo "<a href=\"reg.php?username=$member&key=";
+ readfile("$maj_data_directory/members/confirmed/$member/key.txt");
+ echo "&action=approve\"><img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"approve\"></a>";
+
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/url.txt")) {
+ echo "<a href=\"";
+ readfile("$maj_data_directory/members/confirmed/$member/url.txt");
+ echo "\" target=\"_pending\">";
+ }
+
+ readfile("$maj_data_directory/members/confirmed/$member/firstname.txt");
+ echo " ";
+ readfile("$maj_data_directory/members/confirmed/$member/lastname.txt");
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/url.txt")) {
+ echo "</a>";
+ }
+
+ echo "<br>";
+
+ $email = file_get_contents("$maj_data_directory/members/confirmed/$member/email.txt");
+
+ echo $email;
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/timestamp.txt")) {
+ $confirmed = file_get_contents("$maj_data_directory/members/confirmed/$member/timestamp.txt");
+ $confirmed_year = mb_substr($confirmed,0,4);
+ $confirmed_month = mb_substr($confirmed,4,2);
+ $confirmed_day = mb_substr($confirmed,6,2);
+ $confirmed_hh = mb_substr($confirmed,8,2);
+ $confirmed_mm = mb_substr($confirmed,10,2);
+ $email_confirmed = date("d M Y H:i",mktime($confirmed_hh,$confirmed_mm,0,$confirmed_month,$confirmed_day,$confirmed_year));
+ echo "<br>$email_confirmed";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+ }
+}
+
+function maj_bb_stats() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-stats.txt")) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Bulletin Board</div>";
+ echo "<div class=\"panel_body\">";
+
+ if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/bb.txt")) {
+
+ if ($dh_active_members = opendir("$maj_data_directory/members/active")) {
+
+ while (($active_member = readdir($dh_active_members)) !== false) {
+
+ if ($active_member != "." && $active_member != "..") {
+ $active_members[] = $active_member;
+ }
+ }
+ closedir($dh_active_members);
+ }
+
+ sort($active_members);
+
+ $count_members = count($active_members);
+
+ if ($count_members > 0) {
+ echo "Registered Members: $count_members";
+ }
+ }
+
+ if (file_exists("$maj_data_directory/items")) {
+
+ if ($dh_entries = opendir("$maj_data_directory/items")) {
+
+ while (($entry = readdir($dh_entries)) !== false) {
+
+ if (file_exists("$maj_data_directory/items/$entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ $private = "0";
+
+ if (file_exists("$maj_data_directory/items/$entry/categories")) {
+
+ if ($dh_categories = opendir("$maj_data_directory/items/$entry/categories")) {
+
+ while (($category = readdir($dh_categories)) !== false) {
+
+ if ($category != "." && $category != "..") {
+
+ if (file_exists("$maj_data_directory/categories/$category/private.txt")) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_categories);
+ }
+ }
+
+ if (($private > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$entry/cat.txt")) {
+ continue;
+ }
+
+ if ($entry != "." && $entry != "..") {
+ $entry = mb_substr("$entry",0,6);
+ $entries[] = $entry;
+ }
+ }
+ closedir($dh_entries);
+ }
+
+ rsort($entries);
+
+ $count_entries = count($entries);
+
+ echo "<br>Total Posts: $count_entries";
+
+ unset($entries);
+ }
+
+ if (file_exists("$maj_data_directory/bb-new.txt")) {
+ $bb_new = file_get_contents("$maj_data_directory/bb-new.txt");
+ echo "<br>Newest User: <a href=member.php?id=$bb_new>$bb_new</a>";
+ }
+ if (file_exists("$maj_data_directory/bb-last.txt")) {
+ $bb_last = file_get_contents("$maj_data_directory/bb-last.txt");
+ echo "<br>Latest Login: <a href=member.php?id=$bb_last>$bb_last</a>";
+ }
+ echo "</div></div>";
+ }
+}
+
+function maj_search() {
+
+ global $maj_count_grand;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (($maj_count_grand > 0) and (!file_exists("$maj_data_directory/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Search</div>";
+ echo "<form enctype=\"multipart/form-data\" action=\"dig.php\" method=\"post\">";
+ echo "<div class=\"panel_body\">";
+ echo "<input type=\"search\" class=\"search\" name=\"search\" autocomplete=\"off\" maxlength=\"55\" required>";
+ echo "</form>";
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_find() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Find Entries</div>";
+ echo "<div class=panel_body>";
+ echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
+
+ if (file_exists("$maj_data_directory/bb.txt")) {
+ echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
+ }
+
+ echo "<br><a class=\"navlink\" href=\"index.php?find=unfiled\">Unfiled</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=passwd\">Password Protected</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=comments\">With Comments</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_categories() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/categories")) {
+
+ if ($dh_categories = opendir("$maj_data_directory/categories")) {
+
+ while (($cat = readdir($dh_categories)) !== false) {
+
+ if (file_exists("$maj_data_directory/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/categories/$cat/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if ($cat != "." && $cat != "..") {
+ $categories[] = $cat;
+ }
+ }
+ closedir($dh_categories);
+ }
+
+ sort($categories);
+
+ if (count($categories) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Categories</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($categories as $category) {
+
+ echo "<a class=\"navlink\" href=\"index.php?category=$category\">";
+
+ if (file_exists("$maj_data_directory/categories/$category/title.txt")) {
+ $title = file_get_contents("$maj_data_directory/categories/$category/title.txt");
+ }
+ else {
+ $title = ucfirst(str_replace("_"," ",$category));
+ }
+
+ echo "$title</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
+function maj_statistics() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_count_latest;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Statistics</div>";
+ echo "<div class=\"panel_body\">";
+ echo "Total Entries: $maj_count_latest";
+
+ if (file_exists("$maj_data_directory/hits.txt")) {
+ echo "<br>Site Hits: ";
+ readfile("$maj_data_directory/hits.txt");
+ }
+
+ if (file_exists("$maj_data_directory/google.txt")) {
+ echo "<br>Google Visits: ";
+ readfile("$maj_data_directory/google.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-0.91.txt")) {
+ echo "<br>RSS 0.91 Hits: ";
+ readfile("$maj_data_directory/rss-0.91.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-1.0.txt")) {
+ echo "<br>RSS 1.0 Hits: ";
+ readfile("$maj_data_directory/rss-1.0.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-2.0.txt")) {
+ echo "<br>RSS 2.0 Hits: ";
+ readfile("$maj_data_directory/rss-2.0.txt");
+ }
+
+ if (file_exists("$maj_data_directory/sitemap.txt")) {
+ echo "<br>Sitemap Requests: ";
+ readfile("$maj_data_directory/sitemap.txt");
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_recent() {
+
+ global $maj_latest;
+ global $maj_count_latest;
+ global $maj_increase;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("$maj_data_directory/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Recent Entries</div>";
+ echo "<div class=\"panel_body\">";
+
+ $increment = "0";
+
+ if ($maj_count_latest < 10) {
+ $maximum = $maj_count_latest;
+ }
+ else {
+ $maximum = "10";
+ }
+
+ while ($increment < $maximum) {
+
+ echo "<a class=\"navlink\" href=\"index.php?entry=$maj_latest[$increment]\">";
+ readfile("$maj_data_directory/items/$maj_latest[$increment]/title.txt");
+ echo "</a><br>";
+
+ $increment = $increment + 1;
+ }
+
+ echo '</div></div>';
+ }
+}
+
+function maj_albums() {
+
+ global $maj_albums;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if ((count($maj_albums) > 0) and (!file_exists("$maj_data_directory/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Albums</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($maj_albums as $maj_album) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$maj_album&show=album\">";
+ readfile("$maj_data_directory/items/$maj_album/title.txt");
+ echo "</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_random() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_random;
+ global $maj_count_random;
+
+ if (!file_exists("$maj_data_directory/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+
+ shuffle($maj_random);
+
+ if (file_exists("$maj_data_directory/increase.txt")) {
+ $maximum = file_get_contents("$maj_data_directory/increase.txt");
+ }
+ else {
+ $maximum = 5;
+ }
+
+ if ($maj_count_random > $maximum) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Random Entries</div>";
+ echo "<div class=\"panel_body\">";
+
+ $increment = 0;
+
+ if ($maj_count_random <= $maximum * 2) {
+ $show = $maj_count_random - 1;
+ }
+ else {
+ $show = $maximum * 2 - 1;
+ }
+
+ while ($increment <= $show) {
+ echo "<a class=\"navlink\" href=\"index.php?entry={$maj_random[$increment]}\">";
+ readfile("$maj_data_directory/items/$maj_random[$increment]/title.txt");
+ echo "</a><br>";
+
+ $increment = $increment + 1;
+ }
+
+ if ($maj_count_random > $maximum) {
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+ }
+}
+
+function maj_archives() {
+
+ global $maj_archives;
+ global $maj_count_latest;
+ global $maj_increase;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ $count = count($maj_archives);
+
+ if (($count > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("$maj_data_directory/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ $entries = implode(" ",$maj_archives);
+
+ $unique = array_unique($maj_archives);
+
+ echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Archives ($count)</div>";
+ echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
+
+ foreach ($unique as $entry) {
+
+ $value = mb_substr($entry,0,6);
+ $year = mb_substr($entry,0,4);
+ $month = mb_substr($entry,4,2);
+ $month = date("F",mktime(0,0,0,$month));
+ $num = mb_substr_count($entries,$entry);
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$value\"><nobr>$month $year</nobr></a></td><td align=right>$num</td></tr>";
+ }
+ echo "</table></div></div>";
+ }
+}
+
+function maj_badges() {
+
+ global $maj_count_latest;
+
+ if ($maj_count_latest > 0) {
+
+ $php_version = phpversion();
+
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$php_version</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
+ }
+}
+
?>
diff --git a/dig.php b/dig.php
index cb6d56d..e434485 100644
--- a/dig.php
+++ b/dig.php
@@ -85,12 +85,11 @@ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directo
$show_search_members = array_unique($show_search_members);
$show_search_members = array_values($show_search_members);
+
sort($show_search_members);
- reset($show_search_members);
$count_search_members = count($show_search_members);
- reset($total_members);
$count_total_members = count($total_members);
if ($count_search_members > 0) {
@@ -213,15 +212,13 @@ $generation_time_item = str_replace("-","",$generation_time_item);
$show_search_items = array_unique($show_search_items);
$show_search_items = array_values($show_search_items);
+
rsort($show_search_items);
-reset($show_search_items);
$count_search_items = count($show_search_items);
-reset($count_total_comments);
$count_total_comments = count($total_comments);
-reset($total_entries);
$count_total_items = count($total_entries);
if (($count_search_items > 0) and ($count_total_items > 0)) {
diff --git a/edit.php b/edit.php
index 01e3a69..bda82ad 100644
--- a/edit.php
+++ b/edit.php
@@ -616,9 +616,6 @@ if (file_exists("images/$maj_req_entry/album")) {
sort($filed_cat);
sort($unfiled_cat);
- reset($filed_cat);
- reset($unfiled_cat);
-
$count_filed_cat = count($filed_cat);
$count_unfiled_cat = count($unfiled_cat);
}
@@ -683,7 +680,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
closedir($dh_ack_members);
sort($ack_members);
- reset($ack_members);
$count_ack_members = count($ack_members);
}
@@ -701,7 +697,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
closedir($dh_nak_members);
sort($nak_members);
- reset($nak_members);
$count_nak_members = count($nak_members);
}
diff --git a/index.php b/index.php
index 09586d0..0b5ea08 100644
--- a/index.php
+++ b/index.php
@@ -507,7 +507,6 @@ if (file_exists("$maj_data_directory/comments/pending") and (file_exists("$maj_d
}
rsort($maj_xscreen_comments);
- reset($maj_xscreen_comments);
if (count($maj_xscreen_comments) > 0) {
@@ -605,317 +604,6 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("$maj_data_
}
}
-include("css.php");
-
-?>
-
-<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
-<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss.php?ver=1.0">
-<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.php?ver=2.0">
-
-<?php
-
-if (file_exists("$maj_data_directory/center.txt")) {
- echo "<center>";
-}
-
-if (file_exists("$maj_data_directory/header.txt")) {
-
- $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
-
- if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
- include("$maj_data_directory/panels/$maj_header_panel/panel.php");
- }
-
-}
-
-echo "\r\n\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wtable\">\r\n\r\n";
-
-echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
-
-echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-
-if (!file_exists("$maj_data_directory/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";
-
- if (file_exists("images/profile.gif")) {
- $maj_profile_gif_image_size = getimagesize("images/profile.gif");
- $maj_profile_gif_image_width = $maj_profile_gif_image_size[0];
- $maj_profile_gif_image_height = $maj_profile_gif_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_gif_image_width = 150;
- }
- else {
- $maj_max_profile_gif_image_width = 190;
- }
-
- if ($maj_profile_gif_image_width > $maj_max_profile_gif_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_gif_image_width / $maj_profile_gif_image_width) ;
- $maj_profile_gif_image_width = (int) ($maj_profile_gif_image_width * $maj_sizefactor);
- $maj_profile_gif_image_height = (int) ($maj_profile_gif_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.gif\" border=\"0\" width=\"$maj_profile_gif_image_width\" height=\"$maj_profile_gif_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.gif\" border=\"0\" width=\"$maj_profile_gif_image_width\" height=\"$maj_profile_gif_image_height\" align=\"left\"></a>";
- }
- }
-
- if (file_exists("images/profile.jpg")) {
- $maj_profile_jpg_image_size = getimagesize("images/profile.jpg");
- $maj_profile_jpg_image_width = $maj_profile_jpg_image_size[0];
- $maj_profile_jpg_image_height = $maj_profile_jpg_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_jpg_image_width = 150;
- }
- else {
- $maj_max_profile_jpg_image_width = 190;
- }
-
- if ($maj_profile_jpg_image_width > $maj_max_profile_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_jpg_image_width / $maj_profile_jpg_image_width) ;
- $maj_profile_jpg_image_width = (int) ($maj_profile_jpg_image_width * $maj_sizefactor);
- $maj_profile_jpg_image_height = (int) ($maj_profile_jpg_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.jpg\" border=\"0\" width=\"$maj_profile_jpg_image_width\" height=\"$maj_profile_jpg_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.jpg\" border=\"0\" width=\"$maj_profile_jpg_image_width\" height=\"$maj_profile_jpg_image_height\" align=\"left\"></a>";
- }
- }
-
- if (file_exists("images/profile.png")) {
- $maj_profile_png_image_size = getimagesize("images/profile.png");
- $maj_profile_png_image_width = $maj_profile_png_image_size[0];
- $maj_profile_png_image_height = $maj_profile_png_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_png_image_width = 150;
- }
- else {
- $maj_max_profile_png_image_width = 190;
- }
-
- if ($maj_profile_png_image_width > $maj_max_profile_png_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_png_image_width / $maj_profile_png_image_width) ;
- $maj_profile_png_image_width = (int) ($maj_profile_png_image_width * $maj_sizefactor);
- $maj_profile_png_image_height = (int) ($maj_profile_png_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.png\" border=\"0\" width=\"$maj_profile_png_image_width\" height=\"$maj_profile_png_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.png\" border=\"0\" width=\"$maj_profile_png_image_width\" height=\"$maj_profile_png_image_height\" align=\"left\"></a>";
- }
- }
-
- include("$maj_data_directory/profile.php");
-
- echo "\r\n\t</div>\r\n</div>\r\n\r\n";
-}
-
-if (!file_exists("$maj_data_directory/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";
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
- echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
- }
-
- 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";
- echo "\t\t<a class=\"navlink\" href=\"cat.php\">Categories</a><br>\r\n";
- echo "\t\t<a class=\"navlink\" href=\"colors.php\">Colors</a><br>\r\n";
- 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($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
-
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
-
- if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
- }
- }
-
- if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
- echo '<a class="navlink" href="add.php">Add Entry</a><br>';
- }
-
- echo '<a class="navlink" href="options.php">Options</a><br>';
- echo '<a class="navlink" href="login.php">Logout</a>';
- }
- else {
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
- echo '<a class="navlink" href="reg.php">Register</a><br>';
- }
-
- echo '<a class="navlink" href="login.php">Login</a>';
- }
-
- echo "\t</div>\r\n</div>\r\n";
-}
-
-if (file_exists("$maj_data_directory/sticky")) {
-
- if ($maj_dh_sticky = opendir("$maj_data_directory/sticky")) {
-
- while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
- continue;
- }
-
- $maj_private_categories = "0";
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/categories")) {
-
- if ($maj_dh_sticky_categories = opendir("$maj_data_directory/items/$maj_sticky_entry/categories")) {
-
- while (($maj_sticky_category = readdir($maj_dh_sticky_categories)) !== false) {
-
- if ($maj_sticky_category != "." && $maj_sticky_category != "..") {
-
- if (file_exists("$maj_data_directory/categories/$maj_sticky_category/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_sticky_categories);
- }
- }
-
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_sticky_entry/cat.txt")) {
- continue;
- }
-
- if ($maj_sticky_entry != "." && $maj_sticky_entry != "..") {
- $maj_sticky_entries[] = $maj_sticky_entry;
- }
- }
- closedir($maj_dh_sticky);
- }
-
- sort($maj_sticky_entries);
- reset($maj_sticky_entries);
-
- $maj_count_sticky_list = count($maj_sticky_entries);
-
- if ($maj_count_sticky_list > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Quick Links</div>';
- echo '<div class="panel_body">';
-
- foreach ($maj_sticky_entries as $maj_sticky_list_entry) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_sticky_list_entry\">";
- readfile("$maj_data_directory/items/$maj_sticky_list_entry/title.txt");
- echo "</a><br>";
- }
-
- echo '</div></div>';
- }
-}
-
-if (file_exists("$maj_data_directory/panels")) {
-
- if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
-
- while (($maj_panel = readdir($maj_dh_panels)) !== false) {
-
- if ($maj_panel != "." && $maj_panel != "..") {
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
- $maj_right_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
- $maj_top_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
- $maj_bottom_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
- $maj_center_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
- $maj_entry_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
- continue;
- }
-
- $maj_left_panels[] = $maj_panel;
- }
- }
- closedir($maj_dh_panels);
- }
-
- sort($maj_left_panels);
- reset($maj_left_panels);
-
- sort($maj_right_panels);
- reset($maj_right_panels);
-
- sort($maj_top_panels);
- reset($maj_top_panels);
-
- sort($maj_bottom_panels);
- reset($maj_bottom_panels);
-
- sort($maj_center_panels);
- reset($maj_center_panels);
-
- sort($maj_entry_panels);
- reset($maj_entry_panels);
-
- maj_panels($maj_left_panels);
-}
-
-// main
-
-echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-
-maj_panels($maj_top_panels);
-
-// clean-up (start)
-
-if (file_exists("$maj_data_directory/albums")) {
- rmdirr("$maj_data_directory/albums");
-}
-
-// clean-up (end)
-
-// global entry items (start)
-
if ($maj_dh_items = opendir("$maj_data_directory/items")) {
while (($maj_item = readdir($maj_dh_items)) !== false) {
@@ -1123,8 +811,6 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
continue;
}
- $maj_latest[] = $maj_item;
-
if ((file_exists("$maj_data_directory/items/$maj_item/members") and !isset($maj_logged_in_username)) or (isset($maj_logged_in_username) and !file_exists("$maj_data_directory/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
@@ -1133,6 +819,8 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
continue;
}
+ $maj_latest[] = $maj_item;
+
if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
@@ -1178,7 +866,6 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
}
sort($maj_grand);
-reset($maj_grand);
$maj_count_grand = count($maj_grand);
@@ -1188,44 +875,177 @@ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_en
unset($maj_items);
}
- if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
- unset($maj_items);
- }
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
+ unset($maj_items);
+ }
+}
+
+$maj_items = array_unique($maj_items);
+$maj_items = array_values($maj_items);
+
+if (file_exists("$maj_data_directory/old.txt")) {
+ sort($maj_items);
+}
+else {
+ rsort($maj_items);
+}
+
+$maj_count_items = count($maj_items);
+
+rsort($maj_latest);
+$maj_count_latest = count($maj_latest);
+
+rsort($maj_albums);
+
+rsort($maj_random);
+$maj_count_random = count($maj_random);
+
+rsort($maj_archives);
+
+include("css.php");
+
+?>
+
+<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
+<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss.php?ver=1.0">
+<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.php?ver=2.0">
+
+<?php
+
+if (file_exists("$maj_data_directory/center.txt")) {
+ echo "<center>";
+}
+
+if (file_exists("$maj_data_directory/header.txt")) {
+
+ $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
+
+ if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
+ include("$maj_data_directory/panels/$maj_header_panel/panel.php");
+ }
+
+}
+
+echo "\r\n\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wtable\">\r\n\r\n";
+
+if (file_exists("$maj_data_directory/panels-l.txt") and file_exists("$maj_data_directory/panels-r.txt")) {
+ unlink("$maj_data_directory/panels-l.txt");
+ unlink("$maj_data_directory/panels-r.txt");
+}
+
+if (file_exists("$maj_data_directory/panels-l.txt") ) {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+elseif (file_exists("$maj_data_directory/panels-r.txt")) {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+else {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+
+if (!file_exists("$maj_data_directory/panels-r.txt")) {
+
+ echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
+
+ maj_profile();
+ maj_navigation();
+ maj_quick_links();
+}
+
+if (file_exists("$maj_data_directory/panels")) {
+
+ if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
+
+ while (($maj_panel = readdir($maj_dh_panels)) !== false) {
+
+ if ($maj_panel != "." && $maj_panel != "..") {
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
+ $maj_right_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
+ $maj_top_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
+ $maj_bottom_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
+ $maj_center_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
+ $maj_entry_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
+ continue;
+ }
+
+ $maj_left_panels[] = $maj_panel;
+ }
+ }
+ closedir($maj_dh_panels);
+ }
+
+ sort($maj_left_panels);
+ sort($maj_right_panels);
+ sort($maj_top_panels);
+ sort($maj_bottom_panels);
+ sort($maj_center_panels);
+ sort($maj_entry_panels);
}
-$maj_items = array_unique($maj_items);
-$maj_items = array_values($maj_items);
+if (file_exists("$maj_data_directory/panels-l.txt")) {
+
+ maj_pending_comments();
+ maj_unread_comments();
+ maj_pending_members();
+ maj_bb_stats();
+ maj_search();
+ maj_find();
+ maj_categories();
+ maj_statistics();
+ maj_recent();
+ maj_albums();
+ maj_random();
+ maj_archives();
+}
-if (file_exists("$maj_data_directory/old.txt")) {
- sort($maj_items);
+if (!file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_panels($maj_left_panels);
}
-else {
- rsort($maj_items);
+
+if (file_exists("$maj_data_directory/panels-l.txt")) {
+ maj_panels($maj_right_panels);
+ maj_badges();
}
-reset($maj_items);
-
-$maj_count_items = count($maj_items);
-
-rsort($maj_latest);
-reset($maj_latest);
-
-$maj_count_latest = count($maj_latest);
-
-rsort($maj_albums);
-reset($maj_albums);
-
-$maj_count_albums = count($maj_albums);
-
-rsort($maj_random);
-reset($maj_random);
-$maj_count_random = count($maj_random);
+// main
-rsort($maj_archives);
-reset($maj_archives);
+echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-$maj_count_archives = count($maj_archives);
+maj_panels($maj_top_panels);
if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-summary.txt") and !file_exists("$maj_data_directory/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
@@ -1327,8 +1147,6 @@ if (isset($maj_req_category) and !empty($maj_req_category)) {
else {
rsort($maj_items);
}
-
- reset($maj_items);
}
}
@@ -1826,7 +1644,6 @@ foreach ($maj_disp as $maj_d) {
}
sort($maj_entry_categories);
- reset($maj_entry_categories);
if (count($maj_entry_categories) > 0) {
@@ -2230,7 +2047,7 @@ foreach ($maj_disp as $maj_d) {
}
sort($maj_sort_album);
- reset($maj_sort_album);
+
$maj_count_album_entry = count($maj_sort_album);
if ($maj_count_album_entry < 1) {
@@ -2334,7 +2151,7 @@ foreach ($maj_disp as $maj_d) {
else {
foreach ($maj_videos as $maj_video) {
- $maj_video_show = str_replace("media/$maj_d/videos/","",$maj_video);
+ $maj_video_show = basename($maj_video);
echo "<a href=\"video.php?entry=$maj_d&show=$maj_video_show\">";
echo "<video width=\"95\" height=\"71\" preload=\"meta\" style=\"margin: 2px;\">";
@@ -2401,7 +2218,6 @@ foreach ($maj_disp as $maj_d) {
closedir($maj_dh_filedrop);
}
- reset($maj_filedrop_files);
sort($maj_filedrop_files);
foreach ($maj_filedrop_files as $maj_filedrop_file) {
@@ -2463,7 +2279,6 @@ foreach ($maj_disp as $maj_d) {
}
asort($maj_show_comments);
- reset($maj_show_comments);
foreach ($maj_show_comments as $maj_comment) {
@@ -2827,7 +2642,6 @@ foreach ($maj_disp as $maj_d) {
}
asort($maj_show_pending_comments);
- reset($maj_show_pending_comments);
$maj_count_pending_comments = count($maj_show_pending_comments);
@@ -3078,519 +2892,51 @@ echo "</tr></table></td>";
// right side
-echo "<td width=\"$maj_wside\" valign=\"top\">";
-
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if ($maj_dh_pending_comment_flags = opendir("$maj_data_directory/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 != "..") {
- $maj_show_pending_comment_flags[] = $maj_entry_pending_comment_flags;
- }
- }
- closedir($maj_dh_pending_comment_flags);
- }
-
- rsort($maj_show_pending_comment_flags);
- reset($maj_show_pending_comment_flags);
- $maj_count_pending_comment_flags = count($maj_show_pending_comment_flags);
-
- if (($maj_count_latest > 0) and ($maj_count_pending_comment_flags > 0)) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Pending Comments</div>';
-
- echo '<div class="panel_body">';
-
- if ($maj_dh_list_pending_comment_flags = opendir("$maj_data_directory/comments/pending")) {
-
- while (($maj_entry_list_pending_comment_flags = readdir($maj_dh_list_pending_comment_flags)) !== false) {
-
- if ($maj_entry_list_pending_comment_flags != "." && $maj_entry_list_pending_comment_flags != "..") {
-
- echo "<a href=\"index.php?entry=$maj_entry_list_pending_comment_flags&show=comments#pending\">";
- readfile("$maj_data_directory/items/$maj_entry_list_pending_comment_flags/title.txt");
- echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
-
- $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_entry_list_pending_comment_flags/count.txt");
-
- if ($maj_comment_count_value == 1) {
- echo " ($maj_comment_count_value comment) ";
- }
- elseif ($maj_comment_count_value > 1) {
- echo " ($maj_comment_count_value comments) ";
- }
- else {
- echo '';
- }
- echo '</font><br>';
- }
- }
- closedir($maj_dh_list_pending_comment_flags);
- }
- echo '</div></div>';
- }
-}
-
-if (!file_exists("$maj_data_directory/xucomment.txt") and isset($maj_logged_in_username)) {
-
- if ($maj_logged_in_username == $maj_admin_username) {
-
- if (file_exists("$maj_data_directory/comments/unread") and (count(glob("$maj_data_directory/comments/unread/*")) > 0)) {
-
- if ($maj_dh_unread_comments = opendir("$maj_data_directory/comments/unread")) {
-
- while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
-
- if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
-
- if (!file_exists("$maj_data_directory/items/$maj_unread_comment")) {
- rmdirr("$maj_data_directory/comments/unread/$maj_unread_comment");
- }
- else {
- $maj_unread_comments[] = $maj_unread_comment;
- }
- }
- }
- closedir($maj_dh_unread_comments);
- }
- }
- }
- else {
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username")) {
-
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread") and (count(glob("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
-
- if ($maj_dh_unread_comments = opendir("$maj_data_directory/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("$maj_data_directory/items/$maj_unread_comment")) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$maj_unread_comment");
- }
- else {
- $maj_unread_comments[] = $maj_unread_comment;
- }
- }
- }
- closedir($maj_dh_unread_comments);
- }
- }
- }
- }
-
- sort($maj_unread_comments);
- reset($maj_unread_comments);
-
- if (count($maj_unread_comments) > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title"><a href="del.php?target=unread"><img src="images/widget.del.png" border="0" width="11" height="11" align="right"></a>Unread Comments</div>';
- echo '<div class="panel_body"><table border="0" cellspacing="0" cellpadding="0" width="100%">';
-
- foreach ($maj_unread_comments as $maj_unread_comment) {
-
- $maj_unread_comment_title = file_get_contents("$maj_data_directory/items/$maj_unread_comment/title.txt");
-
- echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$maj_unread_comment&show=comments\">$maj_unread_comment_title</a></td></tr>";
- }
-
- echo '</table></div></div>';
- }
-}
-
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("$maj_data_directory/members/confirmed") and !file_exists("$maj_data_directory/xapp.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
- if ($maj_dh_pending_list = opendir("$maj_data_directory/members/confirmed")) {
- while (($maj_entry_pending_list = readdir($maj_dh_pending_list)) !== false) {
-
- if ($maj_entry_pending_list != "." && $maj_entry_pending_list != "..") {
- $maj_show_pending_list[] = $maj_entry_pending_list;
- }
- }
- closedir($maj_dh_pending_list);
- }
-
- sort($maj_show_pending_list);
- reset($maj_show_pending_list);
- $maj_count_pending_list = count($maj_show_pending_list);
-
- if ($maj_count_pending_list > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Pending Member';
-
- if ($maj_count_pending_list > 1) {
- echo "s";
- }
- echo "</div><div class=panel_body>Please approve or deny $maj_count_pending_list pending membership request";
- if ($maj_count_pending_list > 1) {
- echo "s";
- }
- echo " below.</div></div>";
-
- foreach ($maj_show_pending_list as $maj_pending_list_entry) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">';
- echo "$maj_pending_list_entry";
- echo '<a href=reg.php?username=';
- echo $maj_pending_list_entry;
- echo '&key=';
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/key.txt");
- echo '&action=deny><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=deny></a><a href=reg.php?username=';
- echo $maj_pending_list_entry;
- echo '&key=';
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/key.txt");
- echo '&action=approve><img src=images/widget.cat.png border=0 width=11 height=11 align=right alt=approve></a></div>';
- echo "<div class=panel_body>";
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt")) {
- echo "<a href=\"";
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt");
- echo "\" target=_pending>";
- }
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/firstname.txt");
- echo " ";
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/lastname.txt");
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt")) {
- echo "</a>";
- }
- echo "<br>";
- $maj_pending_email = file_get_contents("$maj_data_directory/members/confirmed/$maj_pending_list_entry/email.txt");
- //$maj_pending_email = wordwrap($maj_pending_email,30);
- echo $maj_pending_email;
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/timestamp.txt")) {
- $maj_confirmed = file_get_contents("$maj_data_directory/members/confirmed/$maj_pending_list_entry/timestamp.txt");
- $maj_confirmed_year = mb_substr($maj_confirmed,0,4);
- $maj_confirmed_month = mb_substr($maj_confirmed,4,2);
- $maj_confirmed_day = mb_substr($maj_confirmed,6,2);
- $maj_confirmed_hh = mb_substr($maj_confirmed,8,2);
- $maj_confirmed_mm = mb_substr($maj_confirmed,10,2);
- $maj_email_confirmed = date("d M Y H:i",mktime($maj_confirmed_hh,$maj_confirmed_mm,0,$maj_confirmed_month,$maj_confirmed_day,$maj_confirmed_year));
- echo "<br>$maj_email_confirmed";
- }
- echo "</div></div>";
- }
- }
-}
-
-if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-stats.txt")) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Bulletin Board</div>';
-
- echo "<div class=panel_body>";
-
- if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/bb.txt")) {
- if ($maj_dh_active_list = opendir("$maj_data_directory/members/active")) {
- while (($maj_entry_active_list = readdir($maj_dh_active_list)) !== false) {
- if ($maj_entry_active_list != "." && $maj_entry_active_list != "..") {
- $maj_show_active_list[] = $maj_entry_active_list;
- }
- }
- closedir($maj_dh_active_list);
- }
-
- sort($maj_show_active_list);
- reset($maj_show_active_list);
- $maj_count_active_list = count($maj_show_active_list);
- if ($maj_count_active_list > 0) {
- echo "Registered Members: $maj_count_active_list";
- }
- }
-
- if (file_exists("$maj_data_directory/items")) {
- if ($maj_dh_mempost_list = opendir("$maj_data_directory/items")) {
- while (($maj_entry_mempost_list = readdir($maj_dh_mempost_list)) !== false) {
-
- if (file_exists("$maj_data_directory/items/$maj_entry_mempost_list/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- $maj_private_categories = "0";
-
- if (file_exists("$maj_data_directory/items/$maj_entry_mempost_list/categories")) {
-
- if ($maj_dh_entry_categories_mempost_list = opendir("$maj_data_directory/items/$maj_entry_mempost_list/categories")) {
-
- while (($maj_entry_category_mempost_list = readdir($maj_dh_entry_categories_mempost_list)) !== false) {
-
- if ($maj_entry_category_mempost_list != "." && $maj_entry_category_mempost_list != "..") {
-
- if (file_exists("$maj_data_directory/categories/$maj_entry_category_mempost_list/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories_mempost_list);
- }
- }
-
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_entry_mempost_list/cat.txt")) {
- continue;
- }
-
- if ($maj_entry_mempost_list != "." && $maj_entry_mempost_list != "..") {
- $maj_entry_mempost_list = mb_substr("$maj_entry_mempost_list",0,6);
- $maj_show_mempost_list[] = $maj_entry_mempost_list;
- }
- }
- closedir($maj_dh_mempost_list);
- }
- rsort($maj_show_mempost_list);
- $maj_count_mempost_list = count($maj_show_mempost_list);
- echo "<br>Total Posts: $maj_count_mempost_list";
- unset($maj_show_mempost_list);
- }
-
- if (file_exists("$maj_data_directory/bb-new.txt")) {
- $maj_bb_new = file_get_contents("$maj_data_directory/bb-new.txt");
- echo "<br>Newest User: <a href=member.php?id=$maj_bb_new>$maj_bb_new</a>";
- }
- if (file_exists("$maj_data_directory/bb-last.txt")) {
- $maj_bb_last = file_get_contents("$maj_data_directory/bb-last.txt");
- echo "<br>Latest Login: <a href=member.php?id=$maj_bb_last>$maj_bb_last</a>";
- }
- echo "</div></div>";
-}
-
-if (($maj_count_grand > 0) and (!file_exists("$maj_data_directory/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">';
-
- ?>
-
- Search</div>
- <form enctype="multipart/form-data" action="dig.php" method="post">
- <div class="panel_body">
- <input type="search" class="search" name="search" autocomplete="off" maxlength="55" required>
- </form>
- </div></div>
-
- <?php
-}
-
-
-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>';
-
- echo "<div class=panel_body>";
- echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
- if (file_exists("$maj_data_directory/bb.txt")) {
- echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
- }
- echo "<br><a class=\"navlink\" href=\"index.php?find=unfiled\">Unfiled</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=passwd\">Password Protected</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=comments\">With Comments</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
- echo "</div></div>";
-}
-
-if (file_exists("$maj_data_directory/categories")) {
- if ($maj_dh_categories = opendir("$maj_data_directory/categories")) {
- while (($maj_entry_categories = readdir($maj_dh_categories)) !== false) {
-
- if (file_exists("$maj_data_directory/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/categories/$maj_entry_categories/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if ($maj_entry_categories != "." && $maj_entry_categories != "..") {
- $maj_show_categories[] = $maj_entry_categories;
- }
- }
- closedir($maj_dh_categories);
- }
-
- sort($maj_show_categories);
- reset($maj_show_categories);
- $maj_count_categories = count($maj_show_categories);
-
- if ($maj_count_categories > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Categories</div>';
-
- echo '<div class=panel_body>';
-
- foreach ($maj_show_categories as $maj_category) {
-
- echo "<a class=\"navlink\" href=\"index.php?category=$maj_category\">";
-
- if (file_exists("$maj_data_directory/categories/$maj_category/title.txt")) {
- $maj_category_title = file_get_contents("$maj_data_directory/categories/$maj_category/title.txt");
- }
- else {
- $maj_category_title = ucfirst(str_replace("_"," ",$maj_category));
- }
-
- echo $maj_category_title;
- echo "</a><br>";
- }
-
- echo '</div></div>';
- }
-}
+if (!file_exists("$maj_data_directory/panels-l.txt")) {
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+ echo "<td width=\"$maj_wside\" valign=\"top\">";
- echo '<div class="panel_wrapper"><div class="panel_title">Statistics</div>';
-
- echo '<div class=panel_body>';
- echo "Total Entries: $maj_count_latest";
- if (file_exists("$maj_data_directory/hits.txt")) {
- echo '<br>Site Hits: ';
- readfile("$maj_data_directory/hits.txt");
- }
- if (file_exists("$maj_data_directory/google.txt")) {
- echo '<br>Google Visits: ';
- readfile("$maj_data_directory/google.txt");
- }
- if (file_exists("$maj_data_directory/rss-0.91.txt")) {
- echo '<br>RSS 0.91 Hits: ';
- readfile("$maj_data_directory/rss-0.91.txt");
- }
- if (file_exists("$maj_data_directory/rss-1.0.txt")) {
- echo '<br>RSS 1.0 Hits: ';
- readfile("$maj_data_directory/rss-1.0.txt");
- }
- if (file_exists("$maj_data_directory/rss-2.0.txt")) {
- echo '<br>RSS 2.0 Hits: ';
- readfile("$maj_data_directory/rss-2.0.txt");
- }
- if (file_exists("$maj_data_directory/sitemap.txt")) {
- echo '<br>Sitemap Requests: ';
- readfile("$maj_data_directory/sitemap.txt");
+ if (file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_profile();
+ maj_navigation();
+ maj_quick_links();
}
- echo '</div></div>';
+ maj_pending_comments();
+ maj_unread_comments();
+ maj_pending_members();
+ maj_bb_stats();
+ maj_search();
+ maj_find();
+ maj_categories();
+ maj_statistics();
+ maj_recent();
+ maj_albums();
+ maj_random();
+ maj_archives();
}
-if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("$maj_data_directory/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Recent Entries</div>';
-
- echo '<div class=panel_body>';
-
- $maj_increment_recent_entries = "0";
-
- if ($maj_count_latest < 10) {
- $maj_max_recent_entries = $maj_count_latest;
- }
- else {
- $maj_max_recent_entries = "10";
- }
-
- while ($maj_increment_recent_entries < $maj_max_recent_entries) {
-
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_latest[$maj_increment_recent_entries]\">";
- readfile("$maj_data_directory/items/$maj_latest[$maj_increment_recent_entries]/title.txt");
- echo "</a><br>";
-
- $maj_increment_recent_entries = $maj_increment_recent_entries + 1;
- }
-
- echo '</div></div>';
+if (file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_panels($maj_left_panels);
}
-if (($maj_count_albums > 0) and (!file_exists("$maj_data_directory/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
-
- echo "<div class=\"panel_body\">";
-
- foreach ($maj_albums as $maj_album) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_album&show=album\">";
- readfile("$maj_data_directory/items/$maj_album/title.txt");
- echo "</a><br>";
- }
- echo '</div></div>';
-}
+if (!file_exists("$maj_data_directory/panels-l.txt")) {
-if (!file_exists("$maj_data_directory/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
-
- shuffle($maj_random);
- reset($maj_random);
+ maj_panels($maj_right_panels);
+ maj_badges();
- if (file_exists("$maj_data_directory/increase.txt")) {
- $maj_limit_random = file_get_contents("$maj_data_directory/increase.txt");
- }
- else {
- $maj_limit_random = 5;
- }
-
- if ($maj_count_random > $maj_limit_random) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Random Entries</div>';
-
- echo "<div class=\"panel_body\">";
-
- $maj_increment_random = 0;
-
- if ($maj_count_random <= $maj_limit_random * 2) {
- $maj_show_random = $maj_count_random - 1;
- }
- else {
- $maj_show_random = $maj_limit_random * 2 - 1;
- }
-
- while ($maj_increment_random <= $maj_show_random) {
- echo "<a class=\"navlink\" href=\"index.php?entry={$maj_random[$maj_increment_random]}\">";
- readfile("$maj_data_directory/items/$maj_random[$maj_increment_random]/title.txt");
- echo "</a><br>";
-
- $maj_increment_random = $maj_increment_random + 1;
- }
- }
-
- if ($maj_count_random > $maj_limit_random) {
- echo "</div></div>";
- }
+ echo "</td>";
}
-?>
+echo "</tr>";
-<?php
-
-if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("$maj_data_directory/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- $maj_archive_entries = implode(" ",$maj_archives);
-
- $maj_unique_archive_list = array_unique($maj_archives);
-
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Archives ($maj_count_archives)</div>";
- echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
-
- foreach ($maj_unique_archive_list as $maj_archive_list_entry) {
-
- $maj_archive_list_value = mb_substr($maj_archive_list_entry,0,6);
- $maj_archive_list_year = mb_substr($maj_archive_list_entry,0,4);
- $maj_archive_list_month = mb_substr($maj_archive_list_entry,4,2);
- $maj_archive_list_month = date("F",mktime(0,0,0,$maj_archive_list_month));
- $maj_archive_list_num = mb_substr_count($maj_archive_entries,$maj_archive_list_entry);
-
- echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$maj_archive_list_value\"><nobr>$maj_archive_list_month $maj_archive_list_year</nobr></a></td><td align=right>$maj_archive_list_num</td></tr>";
- }
- echo "</table></div></div>";
+if (file_exists("$maj_data_directory/panels-l.txt") or file_exists("$maj_data_directory/panels-r.txt")) {
+ echo "<tr><td colspan=\"5\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
}
-
-maj_panels($maj_right_panels);
-
-if ($maj_count_latest > 0) {
-
- $mphp_version = phpversion();
-
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$mphp_version</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
+else {
+ echo "<tr><td colspan=\"7\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
}
-echo "</td></tr>";
-
-echo "<tr><td colspan=\"7\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
-
echo "</table>";
if (file_exists("$maj_data_directory/footer.txt")) {
diff --git a/member.php b/member.php
index 7c72ab2..594cdd6 100644
--- a/member.php
+++ b/member.php
@@ -289,7 +289,7 @@ if (file_exists("data/members/active")) {
}
sort($show_member_list);
- reset($show_member_list);
+
$count_member_list = count($show_member_list);
if ($count_member_list > 0) {
@@ -530,7 +530,6 @@ if (file_exists("data/members/active")) {
}
sort($show_cat);
- reset($show_cat);
foreach ($show_cat as $category) {
echo "<option";
diff --git a/move.php b/move.php
index 3658fb9..21f125f 100644
--- a/move.php
+++ b/move.php
@@ -37,7 +37,6 @@ if ($dh_items = opendir("data/items")) {
}
rsort($target_items);
-reset($target_items);
if (isset($_POST['target']) and !empty($_POST['target'])) {
diff --git a/panels.php b/panels.php
index b82f432..ffe913d 100644
--- a/panels.php
+++ b/panels.php
@@ -1,11 +1,5 @@
<?php
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
require("core.php");
if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
@@ -449,7 +443,7 @@ a:active {
}
sort($show_panel);
- reset($show_panel);
+
$count_panel = count($show_panel);
if ($count_panel > 0) {
@@ -549,7 +543,6 @@ a:active {
$links = glob("$maj_data_directory/items/*");
rsort($links);
- reset($links);
if ((count($links) > 0) and ($panel != file_get_contents("$maj_data_directory/header.txt")) and ($panel != file_get_contents("$maj_data_directory/footer.txt"))) {
@@ -558,7 +551,7 @@ a:active {
foreach ($links as $link) {
$link_title = file_get_contents("$link/title.txt");
- $link_entry = str_replace("$maj_data_directory/items/","",$link);
+ $link_entry = basename($link);
if (file_exists("$maj_data_directory/panels/$panel/link.txt") and (file_get_contents("$maj_data_directory/panels/$panel/link.txt") == $link_entry)) {
diff --git a/rss.php b/rss.php
index ff445c6..f048c16 100644
--- a/rss.php
+++ b/rss.php
@@ -95,7 +95,6 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
}
rsort($show_rss_items);
- reset($show_rss_items);
$count_rss_items = count($show_rss_items);
diff --git a/settings.php b/settings.php
index 9ad99bd..f3c53e1 100644
--- a/settings.php
+++ b/settings.php
@@ -1159,6 +1159,42 @@ if (isset($_FILES['background']) and !empty($_FILES['background'])) {
}
}
+if (isset($_POST['panel_position']) and !empty($_POST['panel_position'])) {
+
+ if ($_POST['panel_position'] == "default") {
+
+ if (file_exists("data/panels-l.txt")) {
+ unlink("data/panels-l.txt");
+ }
+
+ if (file_exists("data/panels-r.txt")) {
+ unlink("data/panels-r.txt");
+ }
+ }
+
+ if ($_POST['panel_position'] == "left") {
+
+ if (!file_exists("data/panels-l.txt")) {
+ touch("data/panels-l.txt");
+ }
+
+ if (file_exists("data/panels-r.txt")) {
+ unlink("data/panels-r.txt");
+ }
+ }
+
+ if ($_POST['panel_position'] == "right") {
+
+ if (!file_exists("data/panels-r.txt")) {
+ touch("data/panels-r.txt");
+ }
+
+ if (file_exists("data/panels-l.txt")) {
+ unlink("data/panels-l.txt");
+ }
+ }
+}
+
if (file_exists("data/css.txt") and (mb_strlen("data/css.txt") < 1)) {
unlink("data/css.txt");
}
@@ -1445,6 +1481,13 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
<tr><td>upload <a href="http://tools.dynamicdrive.com/favicon/" target="_maj">favicon.ico</a></td><td><input autocomplete="off" type="file" name="favicon"></td></tr>
<tr><td>upload profile picture</td><td><input autocomplete="off" type="file" name="picture"></td></tr>
<tr><td>upload background image</td><td><input autocomplete="off" type="file" name="background"></td></tr>
+
+<tr><td rowspan="4">panels</td></tr>
+
+<tr><td><input type="radio" name="panel_position" value="default"<?php if (!file_exists("data/panels-l.txt") and !file_exists("data/panels-r.txt")) { echo " checked"; } ?>> Display panels in their default positions.</td></tr>
+<tr><td><input type="radio" name="panel_position" value="left"<?php if (file_exists("data/panels-l.txt")) { echo " checked"; } ?>> Display all panels on the left side of the page.</td></tr>
+<tr><td><input type="radio" name="panel_position" value="right"<?php if (file_exists("data/panels-r.txt")) { echo " checked"; } ?>> Display all panels on the right side of the page.</td></tr>
+
<tr><td>user-defined css</td><td><textarea class="input" name="css" rows="10"><?php readfile("data/css.txt"); ?></textarea></td></tr>
<tr><td>profile*</td><td><textarea class="input" name="profile" rows="10"><?php readfile("data/profile.php"); ?></textarea></td></tr>
<tr><td>current password</td><td><input autocomplete="off" class="input" type="password" name="passwd_cur"></td></tr>
diff --git a/sitemap.php b/sitemap.php
index 52b9c48..e9e1120 100644
--- a/sitemap.php
+++ b/sitemap.php
@@ -59,7 +59,7 @@ if ($dh_sitemap_items = opendir($dir)) {
}
rsort($show_sitemap_items);
-reset($show_sitemap_items);
+
$count_sitemap_items = count($show_sitemap_items);
if ($count_sitemap_items > 0) {
diff --git a/video.php b/video.php
index c28bcab..0e06c17 100644
--- a/video.php
+++ b/video.php
@@ -198,7 +198,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST
foreach ($maj_videos as $maj_video) {
- $maj_play = str_replace("media/$maj_d/videos/","",$maj_video);
+ $maj_play = basename($maj_video);
echo "<div class=\"menu\">";
diff --git a/wiki.php b/wiki.php
index 8eff463..753f92b 100644
--- a/wiki.php
+++ b/wiki.php
@@ -217,7 +217,7 @@ del {
closedir($dh_delta);
}
rsort($show_delta);
- reset($show_delta);
+
$count_delta = count($show_delta);
if ($count_delta > 0)
{
tree 322736b89722219f2879bcfe04c90c9d28d0138a
parent c3d9b4ee2de3b7aea7a63b8dc6f503219f037c92
author Engels Antonio <engels@majcms.org> 1322465982 +0800
committer Engels Antonio <engels@majcms.org> 1322465982 +0800
Enable left and right positioning of panels
diff --git a/add.php b/add.php
index 88dd8f8..a3ab0aa 100644
--- a/add.php
+++ b/add.php
@@ -284,7 +284,7 @@ echo "\n<style>body { margin: {$maj_wspace}px; } .input, .click { width: 520px;
}
sort($show_cat);
- reset($show_cat);
+
$count_cat = count($show_cat);
if ($count_cat > 0) {
diff --git a/album.php b/album.php
index bb622d5..4934f45 100644
--- a/album.php
+++ b/album.php
@@ -134,7 +134,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
sort($sort_album);
- reset($sort_album);
}
$key_view = array_search($maj_req_show,$sort_album);
diff --git a/cat.php b/cat.php
index 73ed1c4..5caa04d 100644
--- a/cat.php
+++ b/cat.php
@@ -188,7 +188,7 @@ echo "\n<style>body { margin: {$maj_wspace}px; }</style>\n";
}
sort($show_cat);
- reset($show_cat);
+
$count_cat = count($show_cat);
if ($count_cat > 0) {
diff --git a/colors.php b/colors.php
index 11314c3..498af06 100644
--- a/colors.php
+++ b/colors.php
@@ -995,7 +995,6 @@ if ($dh_color_scheme = opendir("data/schemes/colors")) {
}
sort($color_schemes);
-reset($color_schemes);
if (count($color_schemes) > 0) {
echo "<form action=colors.php method=post>";
diff --git a/core.php b/core.php
index 235ef43..2719738 100644
--- a/core.php
+++ b/core.php
@@ -107,7 +107,15 @@ else {
$maj_wspace = "10";
-$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+if (file_exists("$maj_data_directory/panels-l.txt") or file_exists("$maj_data_directory/panels-r.txt")) {
+
+ $maj_wmain = $maj_wmain + $maj_space + $maj_wside;
+
+ $maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace;
+}
+else {
+ $maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+}
$maj_default_blog_title = "My Activity Journal";
$maj_default_username = "maj";
@@ -666,6 +674,180 @@ function maj_download_file($file_name,$file_dir,$count_dir) {
}
}
+function maj_profile() {
+
+ global $maj_data_directory;
+ global $maj_image_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (!file_exists("$maj_data_directory/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";
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
+ $max = 150;
+ }
+ else {
+ $max = 190;
+ }
+
+ if (file_exists("$maj_image_directory/profile.gif")) {
+ $img = "$maj_image_directory/profile.gif";
+ }
+
+ if (file_exists("$maj_image_directory/profile.jpg")) {
+ $img = "$maj_image_directory/profile.jpg";
+ }
+
+ if (file_exists("$maj_image_directory/profile.png")) {
+ $img = "$maj_image_directory/profile.png";
+ }
+
+ $size = getimagesize($img);
+ $width = $size[0];
+ $height = $size[1];
+
+ if ($width > $max) {
+
+ $factor = (double) ($max / $width) ;
+ $width = (int) ($width * $factor);
+ $height = (int) ($height * $factor);
+
+ echo "<a href=\".\"><img src=\"$img\" border=\"0\" width=\"$width\" height=\"$height\"></a><br>";
+ }
+ else {
+ echo "<a href=\".\"><img src=\"$img\" border=\"0\" width=\"$width\" height=\"$height\" align=\"left\"></a>";
+ }
+
+ include("$maj_data_directory/profile.php");
+
+ echo "\r\n\t</div>\r\n</div>\r\n\r\n";
+ }
+}
+
+function maj_navigation() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_req_category;
+
+ if (!file_exists("$maj_data_directory/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";
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
+ echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
+ }
+
+ 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";
+ echo "\t\t<a class=\"navlink\" href=\"cat.php\">Categories</a><br>\r\n";
+ echo "\t\t<a class=\"navlink\" href=\"colors.php\">Colors</a><br>\r\n";
+ 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($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
+
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
+
+ if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
+ }
+ }
+
+ if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
+ echo '<a class="navlink" href="add.php">Add Entry</a><br>';
+ }
+
+ echo '<a class="navlink" href="options.php">Options</a><br>';
+ echo '<a class="navlink" href="login.php">Logout</a>';
+ }
+ else {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
+ echo '<a class="navlink" href="reg.php">Register</a><br>';
+ }
+
+ echo '<a class="navlink" href="login.php">Login</a>';
+ }
+
+ echo "\t</div>\r\n</div>\r\n";
+ }
+}
+
+function maj_quick_links() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/sticky")) {
+
+ if ($dh_sticky_data = opendir("$maj_data_directory/sticky")) {
+
+ while (($entry = readdir($dh_sticky_data)) !== false) {
+
+ if (file_exists("$maj_data_directory/items/$entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/items/$entry/member.txt") and (!isset($maj_logged_in_username))) {
+ continue;
+ }
+
+ $private = "0";
+
+ if (file_exists("$maj_data_directory/items/$entry/categories")) {
+
+ if ($dh_sticky_entry = opendir("$maj_data_directory/items/$entry/categories")) {
+
+ while (($category = readdir($dh_sticky_entry)) !== false) {
+
+ if ($category != "." && $category != "..") {
+
+ if (file_exists("$maj_data_directory/categories/$category/private.txt")) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_sticky_entry);
+ }
+ }
+
+ if (($private > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$entry/cat.txt")) {
+ continue;
+ }
+
+ if ($entry != "." && $entry != "..") {
+ $entries[] = $entry;
+ }
+ }
+ closedir($dh_sticky_data);
+ }
+
+ sort($entries);
+
+ if (count($entries) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Quick Links</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($entries as $entry) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$entry\">";
+ readfile("$maj_data_directory/items/$entry/title.txt");
+ echo "</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
function maj_panels($panel_array) {
global $maj_data_directory;
@@ -726,7 +908,6 @@ function maj_panels($panel_array) {
if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
-
}
}
@@ -854,4 +1035,648 @@ function maj_panels($panel_array) {
}
}
+function maj_pending_comments() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+ global $maj_count_latest;
+ global $maj_font_Spx;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ if ($dh_pending_comments = opendir("$maj_data_directory/comments/pending")) {
+
+ while (($entry = readdir($dh_pending_comments)) !== false) {
+
+ if ($entry != "." && $entry != "..") {
+ $entries[] = $entry;
+ }
+ }
+
+ closedir($dh_pending_comments);
+ }
+
+ rsort($entries);
+
+ if (($maj_count_latest > 0) and (count($entries) > 0)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Pending Comments</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($entries as $entry) {
+
+ echo "<a href=\"index.php?entry=$entry&show=comments#pending\">";
+ readfile("$maj_data_directory/items/$entry/title.txt");
+ echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
+
+ $count = file_get_contents("$maj_data_directory/comments/pending/$entry/count.txt");
+
+ if ($count == 1) {
+ echo " ($count comment) ";
+ }
+ elseif ($count > 1) {
+ echo " ($count comments) ";
+ }
+ else {
+ echo "";
+ }
+ echo "</font><br>";
+ }
+ }
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_unread_comments() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (!file_exists("$maj_data_directory/xucomment.txt") and isset($maj_logged_in_username)) {
+
+ if ($maj_logged_in_username == $maj_admin_username) {
+
+ if (file_exists("$maj_data_directory/comments/unread") and (count(glob("$maj_data_directory/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("$maj_data_directory/comments/unread")) {
+
+ while (($comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($comment != "." && $comment != "..") {
+
+ if (!file_exists("$maj_data_directory/items/$comment")) {
+ rmdirr("$maj_data_directory/comments/unread/$comment");
+ }
+ else {
+ $comments[] = $comment;
+ }
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ else {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username")) {
+
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread") and (count(glob("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread")) {
+
+ while (($comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($comment != "." && $comment != "..") {
+
+ if (!file_exists("$maj_data_directory/items/$comment")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$comment");
+ }
+ else {
+ $comments[] = $comment;
+ }
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ }
+
+ sort($comments);
+
+ if (count($comments) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "<a href=\"del.php?target=unread\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\"></a>";
+ echo "Unread Comments";
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
+
+ foreach ($comments as $comment) {
+
+ $title = file_get_contents("$maj_data_directory/items/$comment/title.txt");
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$comment&show=comments\">$title</a></td></tr>";
+ }
+
+ echo "</table>";
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
+function maj_pending_members() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("$maj_data_directory/members/confirmed") and !file_exists("$maj_data_directory/xapp.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
+
+ if ($dh_members = opendir("$maj_data_directory/members/confirmed")) {
+
+ while (($member = readdir($dh_members)) !== false) {
+
+ if ($member != "." && $member != "..") {
+ $members[] = $member;
+ }
+ }
+ closedir($dh_members);
+ }
+
+ sort($members);
+
+ $count = count($members);
+
+ if ($count > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "Pending Member";
+
+ if ($count > 1) {
+ echo "s";
+ }
+
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+ echo "Please approve or deny $count pending membership request";
+
+ if ($count > 1) {
+ echo "s";
+ }
+
+ echo " below.";
+ echo "</div>";
+ echo "</div>";
+
+ foreach ($members as $member) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">";
+ echo "$member";
+
+ echo "<a href=\"reg.php?username=$member&key=";
+ readfile("$maj_data_directory/members/confirmed/$member/key.txt");
+ echo "&action=deny\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"deny\"></a>";
+
+ echo "<a href=\"reg.php?username=$member&key=";
+ readfile("$maj_data_directory/members/confirmed/$member/key.txt");
+ echo "&action=approve\"><img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"approve\"></a>";
+
+ echo "</div>";
+ echo "<div class=\"panel_body\">";
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/url.txt")) {
+ echo "<a href=\"";
+ readfile("$maj_data_directory/members/confirmed/$member/url.txt");
+ echo "\" target=\"_pending\">";
+ }
+
+ readfile("$maj_data_directory/members/confirmed/$member/firstname.txt");
+ echo " ";
+ readfile("$maj_data_directory/members/confirmed/$member/lastname.txt");
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/url.txt")) {
+ echo "</a>";
+ }
+
+ echo "<br>";
+
+ $email = file_get_contents("$maj_data_directory/members/confirmed/$member/email.txt");
+
+ echo $email;
+
+ if (file_exists("$maj_data_directory/members/confirmed/$member/timestamp.txt")) {
+ $confirmed = file_get_contents("$maj_data_directory/members/confirmed/$member/timestamp.txt");
+ $confirmed_year = mb_substr($confirmed,0,4);
+ $confirmed_month = mb_substr($confirmed,4,2);
+ $confirmed_day = mb_substr($confirmed,6,2);
+ $confirmed_hh = mb_substr($confirmed,8,2);
+ $confirmed_mm = mb_substr($confirmed,10,2);
+ $email_confirmed = date("d M Y H:i",mktime($confirmed_hh,$confirmed_mm,0,$confirmed_month,$confirmed_day,$confirmed_year));
+ echo "<br>$email_confirmed";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+ }
+}
+
+function maj_bb_stats() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-stats.txt")) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Bulletin Board</div>";
+ echo "<div class=\"panel_body\">";
+
+ if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/bb.txt")) {
+
+ if ($dh_active_members = opendir("$maj_data_directory/members/active")) {
+
+ while (($active_member = readdir($dh_active_members)) !== false) {
+
+ if ($active_member != "." && $active_member != "..") {
+ $active_members[] = $active_member;
+ }
+ }
+ closedir($dh_active_members);
+ }
+
+ sort($active_members);
+
+ $count_members = count($active_members);
+
+ if ($count_members > 0) {
+ echo "Registered Members: $count_members";
+ }
+ }
+
+ if (file_exists("$maj_data_directory/items")) {
+
+ if ($dh_entries = opendir("$maj_data_directory/items")) {
+
+ while (($entry = readdir($dh_entries)) !== false) {
+
+ if (file_exists("$maj_data_directory/items/$entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ $private = "0";
+
+ if (file_exists("$maj_data_directory/items/$entry/categories")) {
+
+ if ($dh_categories = opendir("$maj_data_directory/items/$entry/categories")) {
+
+ while (($category = readdir($dh_categories)) !== false) {
+
+ if ($category != "." && $category != "..") {
+
+ if (file_exists("$maj_data_directory/categories/$category/private.txt")) {
+ $private = $private + 1;
+ }
+ }
+ }
+ closedir($dh_categories);
+ }
+ }
+
+ if (($private > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$entry/cat.txt")) {
+ continue;
+ }
+
+ if ($entry != "." && $entry != "..") {
+ $entry = mb_substr("$entry",0,6);
+ $entries[] = $entry;
+ }
+ }
+ closedir($dh_entries);
+ }
+
+ rsort($entries);
+
+ $count_entries = count($entries);
+
+ echo "<br>Total Posts: $count_entries";
+
+ unset($entries);
+ }
+
+ if (file_exists("$maj_data_directory/bb-new.txt")) {
+ $bb_new = file_get_contents("$maj_data_directory/bb-new.txt");
+ echo "<br>Newest User: <a href=member.php?id=$bb_new>$bb_new</a>";
+ }
+ if (file_exists("$maj_data_directory/bb-last.txt")) {
+ $bb_last = file_get_contents("$maj_data_directory/bb-last.txt");
+ echo "<br>Latest Login: <a href=member.php?id=$bb_last>$bb_last</a>";
+ }
+ echo "</div></div>";
+ }
+}
+
+function maj_search() {
+
+ global $maj_count_grand;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (($maj_count_grand > 0) and (!file_exists("$maj_data_directory/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Search</div>";
+ echo "<form enctype=\"multipart/form-data\" action=\"dig.php\" method=\"post\">";
+ echo "<div class=\"panel_body\">";
+ echo "<input type=\"search\" class=\"search\" name=\"search\" autocomplete=\"off\" maxlength=\"55\" required>";
+ echo "</form>";
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_find() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Find Entries</div>";
+ echo "<div class=panel_body>";
+ echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
+
+ if (file_exists("$maj_data_directory/bb.txt")) {
+ echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
+ }
+
+ echo "<br><a class=\"navlink\" href=\"index.php?find=unfiled\">Unfiled</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=passwd\">Password Protected</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=comments\">With Comments</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
+ echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_categories() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (file_exists("$maj_data_directory/categories")) {
+
+ if ($dh_categories = opendir("$maj_data_directory/categories")) {
+
+ while (($cat = readdir($dh_categories)) !== false) {
+
+ if (file_exists("$maj_data_directory/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/categories/$cat/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if ($cat != "." && $cat != "..") {
+ $categories[] = $cat;
+ }
+ }
+ closedir($dh_categories);
+ }
+
+ sort($categories);
+
+ if (count($categories) > 0) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Categories</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($categories as $category) {
+
+ echo "<a class=\"navlink\" href=\"index.php?category=$category\">";
+
+ if (file_exists("$maj_data_directory/categories/$category/title.txt")) {
+ $title = file_get_contents("$maj_data_directory/categories/$category/title.txt");
+ }
+ else {
+ $title = ucfirst(str_replace("_"," ",$category));
+ }
+
+ echo "$title</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+}
+
+function maj_statistics() {
+
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_count_latest;
+ global $maj_data_directory;
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Statistics</div>";
+ echo "<div class=\"panel_body\">";
+ echo "Total Entries: $maj_count_latest";
+
+ if (file_exists("$maj_data_directory/hits.txt")) {
+ echo "<br>Site Hits: ";
+ readfile("$maj_data_directory/hits.txt");
+ }
+
+ if (file_exists("$maj_data_directory/google.txt")) {
+ echo "<br>Google Visits: ";
+ readfile("$maj_data_directory/google.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-0.91.txt")) {
+ echo "<br>RSS 0.91 Hits: ";
+ readfile("$maj_data_directory/rss-0.91.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-1.0.txt")) {
+ echo "<br>RSS 1.0 Hits: ";
+ readfile("$maj_data_directory/rss-1.0.txt");
+ }
+
+ if (file_exists("$maj_data_directory/rss-2.0.txt")) {
+ echo "<br>RSS 2.0 Hits: ";
+ readfile("$maj_data_directory/rss-2.0.txt");
+ }
+
+ if (file_exists("$maj_data_directory/sitemap.txt")) {
+ echo "<br>Sitemap Requests: ";
+ readfile("$maj_data_directory/sitemap.txt");
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_recent() {
+
+ global $maj_latest;
+ global $maj_count_latest;
+ global $maj_increase;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("$maj_data_directory/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Recent Entries</div>";
+ echo "<div class=\"panel_body\">";
+
+ $increment = "0";
+
+ if ($maj_count_latest < 10) {
+ $maximum = $maj_count_latest;
+ }
+ else {
+ $maximum = "10";
+ }
+
+ while ($increment < $maximum) {
+
+ echo "<a class=\"navlink\" href=\"index.php?entry=$maj_latest[$increment]\">";
+ readfile("$maj_data_directory/items/$maj_latest[$increment]/title.txt");
+ echo "</a><br>";
+
+ $increment = $increment + 1;
+ }
+
+ echo '</div></div>';
+ }
+}
+
+function maj_albums() {
+
+ global $maj_albums;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ if ((count($maj_albums) > 0) and (!file_exists("$maj_data_directory/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Albums</div>";
+ echo "<div class=\"panel_body\">";
+
+ foreach ($maj_albums as $maj_album) {
+ echo "<a class=\"navlink\" href=\"index.php?entry=$maj_album&show=album\">";
+ readfile("$maj_data_directory/items/$maj_album/title.txt");
+ echo "</a><br>";
+ }
+
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function maj_random() {
+
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+ global $maj_random;
+ global $maj_count_random;
+
+ if (!file_exists("$maj_data_directory/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+
+ shuffle($maj_random);
+
+ if (file_exists("$maj_data_directory/increase.txt")) {
+ $maximum = file_get_contents("$maj_data_directory/increase.txt");
+ }
+ else {
+ $maximum = 5;
+ }
+
+ if ($maj_count_random > $maximum) {
+
+ echo "<div class=\"panel_wrapper\">";
+ echo "<div class=\"panel_title\">Random Entries</div>";
+ echo "<div class=\"panel_body\">";
+
+ $increment = 0;
+
+ if ($maj_count_random <= $maximum * 2) {
+ $show = $maj_count_random - 1;
+ }
+ else {
+ $show = $maximum * 2 - 1;
+ }
+
+ while ($increment <= $show) {
+ echo "<a class=\"navlink\" href=\"index.php?entry={$maj_random[$increment]}\">";
+ readfile("$maj_data_directory/items/$maj_random[$increment]/title.txt");
+ echo "</a><br>";
+
+ $increment = $increment + 1;
+ }
+
+ if ($maj_count_random > $maximum) {
+ echo "</div>";
+ echo "</div>";
+ }
+ }
+ }
+}
+
+function maj_archives() {
+
+ global $maj_archives;
+ global $maj_count_latest;
+ global $maj_increase;
+ global $maj_data_directory;
+ global $maj_logged_in_username;
+ global $maj_admin_username;
+
+ $count = count($maj_archives);
+
+ if (($count > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("$maj_data_directory/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
+
+ $entries = implode(" ",$maj_archives);
+
+ $unique = array_unique($maj_archives);
+
+ echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Archives ($count)</div>";
+ echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
+
+ foreach ($unique as $entry) {
+
+ $value = mb_substr($entry,0,6);
+ $year = mb_substr($entry,0,4);
+ $month = mb_substr($entry,4,2);
+ $month = date("F",mktime(0,0,0,$month));
+ $num = mb_substr_count($entries,$entry);
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$value\"><nobr>$month $year</nobr></a></td><td align=right>$num</td></tr>";
+ }
+ echo "</table></div></div>";
+ }
+}
+
+function maj_badges() {
+
+ global $maj_count_latest;
+
+ if ($maj_count_latest > 0) {
+
+ $php_version = phpversion();
+
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$php_version</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
+ }
+}
+
?>
diff --git a/dig.php b/dig.php
index cb6d56d..e434485 100644
--- a/dig.php
+++ b/dig.php
@@ -85,12 +85,11 @@ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directo
$show_search_members = array_unique($show_search_members);
$show_search_members = array_values($show_search_members);
+
sort($show_search_members);
- reset($show_search_members);
$count_search_members = count($show_search_members);
- reset($total_members);
$count_total_members = count($total_members);
if ($count_search_members > 0) {
@@ -213,15 +212,13 @@ $generation_time_item = str_replace("-","",$generation_time_item);
$show_search_items = array_unique($show_search_items);
$show_search_items = array_values($show_search_items);
+
rsort($show_search_items);
-reset($show_search_items);
$count_search_items = count($show_search_items);
-reset($count_total_comments);
$count_total_comments = count($total_comments);
-reset($total_entries);
$count_total_items = count($total_entries);
if (($count_search_items > 0) and ($count_total_items > 0)) {
diff --git a/edit.php b/edit.php
index 01e3a69..bda82ad 100644
--- a/edit.php
+++ b/edit.php
@@ -616,9 +616,6 @@ if (file_exists("images/$maj_req_entry/album")) {
sort($filed_cat);
sort($unfiled_cat);
- reset($filed_cat);
- reset($unfiled_cat);
-
$count_filed_cat = count($filed_cat);
$count_unfiled_cat = count($unfiled_cat);
}
@@ -683,7 +680,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
closedir($dh_ack_members);
sort($ack_members);
- reset($ack_members);
$count_ack_members = count($ack_members);
}
@@ -701,7 +697,6 @@ if (file_exists("images/$maj_req_entry/album")) {
}
closedir($dh_nak_members);
sort($nak_members);
- reset($nak_members);
$count_nak_members = count($nak_members);
}
diff --git a/index.php b/index.php
index 09586d0..0b5ea08 100644
--- a/index.php
+++ b/index.php
@@ -507,7 +507,6 @@ if (file_exists("$maj_data_directory/comments/pending") and (file_exists("$maj_d
}
rsort($maj_xscreen_comments);
- reset($maj_xscreen_comments);
if (count($maj_xscreen_comments) > 0) {
@@ -605,317 +604,6 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("$maj_data_
}
}
-include("css.php");
-
-?>
-
-<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
-<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss.php?ver=1.0">
-<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.php?ver=2.0">
-
-<?php
-
-if (file_exists("$maj_data_directory/center.txt")) {
- echo "<center>";
-}
-
-if (file_exists("$maj_data_directory/header.txt")) {
-
- $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
-
- if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
- include("$maj_data_directory/panels/$maj_header_panel/panel.php");
- }
-
-}
-
-echo "\r\n\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wtable\">\r\n\r\n";
-
-echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
-
-echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-
-if (!file_exists("$maj_data_directory/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";
-
- if (file_exists("images/profile.gif")) {
- $maj_profile_gif_image_size = getimagesize("images/profile.gif");
- $maj_profile_gif_image_width = $maj_profile_gif_image_size[0];
- $maj_profile_gif_image_height = $maj_profile_gif_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_gif_image_width = 150;
- }
- else {
- $maj_max_profile_gif_image_width = 190;
- }
-
- if ($maj_profile_gif_image_width > $maj_max_profile_gif_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_gif_image_width / $maj_profile_gif_image_width) ;
- $maj_profile_gif_image_width = (int) ($maj_profile_gif_image_width * $maj_sizefactor);
- $maj_profile_gif_image_height = (int) ($maj_profile_gif_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.gif\" border=\"0\" width=\"$maj_profile_gif_image_width\" height=\"$maj_profile_gif_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.gif\" border=\"0\" width=\"$maj_profile_gif_image_width\" height=\"$maj_profile_gif_image_height\" align=\"left\"></a>";
- }
- }
-
- if (file_exists("images/profile.jpg")) {
- $maj_profile_jpg_image_size = getimagesize("images/profile.jpg");
- $maj_profile_jpg_image_width = $maj_profile_jpg_image_size[0];
- $maj_profile_jpg_image_height = $maj_profile_jpg_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_jpg_image_width = 150;
- }
- else {
- $maj_max_profile_jpg_image_width = 190;
- }
-
- if ($maj_profile_jpg_image_width > $maj_max_profile_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_jpg_image_width / $maj_profile_jpg_image_width) ;
- $maj_profile_jpg_image_width = (int) ($maj_profile_jpg_image_width * $maj_sizefactor);
- $maj_profile_jpg_image_height = (int) ($maj_profile_jpg_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.jpg\" border=\"0\" width=\"$maj_profile_jpg_image_width\" height=\"$maj_profile_jpg_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.jpg\" border=\"0\" width=\"$maj_profile_jpg_image_width\" height=\"$maj_profile_jpg_image_height\" align=\"left\"></a>";
- }
- }
-
- if (file_exists("images/profile.png")) {
- $maj_profile_png_image_size = getimagesize("images/profile.png");
- $maj_profile_png_image_width = $maj_profile_png_image_size[0];
- $maj_profile_png_image_height = $maj_profile_png_image_size[1];
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
- $maj_max_profile_png_image_width = 150;
- }
- else {
- $maj_max_profile_png_image_width = 190;
- }
-
- if ($maj_profile_png_image_width > $maj_max_profile_png_image_width) {
- $maj_sizefactor = (double) ($maj_max_profile_png_image_width / $maj_profile_png_image_width) ;
- $maj_profile_png_image_width = (int) ($maj_profile_png_image_width * $maj_sizefactor);
- $maj_profile_png_image_height = (int) ($maj_profile_png_image_height * $maj_sizefactor);
-
- echo "<a href=\".\"><img src=\"images/profile.png\" border=\"0\" width=\"$maj_profile_png_image_width\" height=\"$maj_profile_png_image_height\"></a><br>";
- }
- else {
- echo "<a href=\".\"><img src=\"images/profile.png\" border=\"0\" width=\"$maj_profile_png_image_width\" height=\"$maj_profile_png_image_height\" align=\"left\"></a>";
- }
- }
-
- include("$maj_data_directory/profile.php");
-
- echo "\r\n\t</div>\r\n</div>\r\n\r\n";
-}
-
-if (!file_exists("$maj_data_directory/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";
-
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
- echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
- }
-
- 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";
- echo "\t\t<a class=\"navlink\" href=\"cat.php\">Categories</a><br>\r\n";
- echo "\t\t<a class=\"navlink\" href=\"colors.php\">Colors</a><br>\r\n";
- 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($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
-
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
-
- if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
- }
- }
-
- if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
- echo '<a class="navlink" href="add.php">Add Entry</a><br>';
- }
-
- echo '<a class="navlink" href="options.php">Options</a><br>';
- echo '<a class="navlink" href="login.php">Logout</a>';
- }
- else {
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
- echo '<a class="navlink" href="reg.php">Register</a><br>';
- }
-
- echo '<a class="navlink" href="login.php">Login</a>';
- }
-
- echo "\t</div>\r\n</div>\r\n";
-}
-
-if (file_exists("$maj_data_directory/sticky")) {
-
- if ($maj_dh_sticky = opendir("$maj_data_directory/sticky")) {
-
- while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
- continue;
- }
-
- $maj_private_categories = "0";
-
- if (file_exists("$maj_data_directory/items/$maj_sticky_entry/categories")) {
-
- if ($maj_dh_sticky_categories = opendir("$maj_data_directory/items/$maj_sticky_entry/categories")) {
-
- while (($maj_sticky_category = readdir($maj_dh_sticky_categories)) !== false) {
-
- if ($maj_sticky_category != "." && $maj_sticky_category != "..") {
-
- if (file_exists("$maj_data_directory/categories/$maj_sticky_category/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_sticky_categories);
- }
- }
-
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_sticky_entry/cat.txt")) {
- continue;
- }
-
- if ($maj_sticky_entry != "." && $maj_sticky_entry != "..") {
- $maj_sticky_entries[] = $maj_sticky_entry;
- }
- }
- closedir($maj_dh_sticky);
- }
-
- sort($maj_sticky_entries);
- reset($maj_sticky_entries);
-
- $maj_count_sticky_list = count($maj_sticky_entries);
-
- if ($maj_count_sticky_list > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Quick Links</div>';
- echo '<div class="panel_body">';
-
- foreach ($maj_sticky_entries as $maj_sticky_list_entry) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_sticky_list_entry\">";
- readfile("$maj_data_directory/items/$maj_sticky_list_entry/title.txt");
- echo "</a><br>";
- }
-
- echo '</div></div>';
- }
-}
-
-if (file_exists("$maj_data_directory/panels")) {
-
- if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
-
- while (($maj_panel = readdir($maj_dh_panels)) !== false) {
-
- if ($maj_panel != "." && $maj_panel != "..") {
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
- $maj_right_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
- $maj_top_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
- $maj_bottom_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
- $maj_center_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
- $maj_entry_panels[] = $maj_panel;
- continue;
- }
-
- if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
- continue;
- }
-
- $maj_left_panels[] = $maj_panel;
- }
- }
- closedir($maj_dh_panels);
- }
-
- sort($maj_left_panels);
- reset($maj_left_panels);
-
- sort($maj_right_panels);
- reset($maj_right_panels);
-
- sort($maj_top_panels);
- reset($maj_top_panels);
-
- sort($maj_bottom_panels);
- reset($maj_bottom_panels);
-
- sort($maj_center_panels);
- reset($maj_center_panels);
-
- sort($maj_entry_panels);
- reset($maj_entry_panels);
-
- maj_panels($maj_left_panels);
-}
-
-// main
-
-echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-
-maj_panels($maj_top_panels);
-
-// clean-up (start)
-
-if (file_exists("$maj_data_directory/albums")) {
- rmdirr("$maj_data_directory/albums");
-}
-
-// clean-up (end)
-
-// global entry items (start)
-
if ($maj_dh_items = opendir("$maj_data_directory/items")) {
while (($maj_item = readdir($maj_dh_items)) !== false) {
@@ -1123,8 +811,6 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
continue;
}
- $maj_latest[] = $maj_item;
-
if ((file_exists("$maj_data_directory/items/$maj_item/members") and !isset($maj_logged_in_username)) or (isset($maj_logged_in_username) and !file_exists("$maj_data_directory/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
@@ -1133,6 +819,8 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
continue;
}
+ $maj_latest[] = $maj_item;
+
if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
@@ -1178,7 +866,6 @@ if ($maj_dh_items = opendir("$maj_data_directory/items")) {
}
sort($maj_grand);
-reset($maj_grand);
$maj_count_grand = count($maj_grand);
@@ -1188,44 +875,177 @@ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_en
unset($maj_items);
}
- if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
- unset($maj_items);
- }
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
+ unset($maj_items);
+ }
+}
+
+$maj_items = array_unique($maj_items);
+$maj_items = array_values($maj_items);
+
+if (file_exists("$maj_data_directory/old.txt")) {
+ sort($maj_items);
+}
+else {
+ rsort($maj_items);
+}
+
+$maj_count_items = count($maj_items);
+
+rsort($maj_latest);
+$maj_count_latest = count($maj_latest);
+
+rsort($maj_albums);
+
+rsort($maj_random);
+$maj_count_random = count($maj_random);
+
+rsort($maj_archives);
+
+include("css.php");
+
+?>
+
+<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
+<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss.php?ver=1.0">
+<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.php?ver=2.0">
+
+<?php
+
+if (file_exists("$maj_data_directory/center.txt")) {
+ echo "<center>";
+}
+
+if (file_exists("$maj_data_directory/header.txt")) {
+
+ $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
+
+ if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
+ include("$maj_data_directory/panels/$maj_header_panel/panel.php");
+ }
+
+}
+
+echo "\r\n\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wtable\">\r\n\r\n";
+
+if (file_exists("$maj_data_directory/panels-l.txt") and file_exists("$maj_data_directory/panels-r.txt")) {
+ unlink("$maj_data_directory/panels-l.txt");
+ unlink("$maj_data_directory/panels-r.txt");
+}
+
+if (file_exists("$maj_data_directory/panels-l.txt") ) {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+elseif (file_exists("$maj_data_directory/panels-r.txt")) {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+else {
+ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wmain\" height=\"$maj_wspace\"><div style=\"width: {$maj_wmain}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wside\" height=\"$maj_wspace\"><div style=\"width: {$maj_wside}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
+}
+
+if (!file_exists("$maj_data_directory/panels-r.txt")) {
+
+ echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
+
+ maj_profile();
+ maj_navigation();
+ maj_quick_links();
+}
+
+if (file_exists("$maj_data_directory/panels")) {
+
+ if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
+
+ while (($maj_panel = readdir($maj_dh_panels)) !== false) {
+
+ if ($maj_panel != "." && $maj_panel != "..") {
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
+ $maj_right_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
+ $maj_top_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
+ $maj_bottom_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
+ $maj_center_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
+ $maj_entry_panels[] = $maj_panel;
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
+ continue;
+ }
+
+ if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
+ continue;
+ }
+
+ $maj_left_panels[] = $maj_panel;
+ }
+ }
+ closedir($maj_dh_panels);
+ }
+
+ sort($maj_left_panels);
+ sort($maj_right_panels);
+ sort($maj_top_panels);
+ sort($maj_bottom_panels);
+ sort($maj_center_panels);
+ sort($maj_entry_panels);
}
-$maj_items = array_unique($maj_items);
-$maj_items = array_values($maj_items);
+if (file_exists("$maj_data_directory/panels-l.txt")) {
+
+ maj_pending_comments();
+ maj_unread_comments();
+ maj_pending_members();
+ maj_bb_stats();
+ maj_search();
+ maj_find();
+ maj_categories();
+ maj_statistics();
+ maj_recent();
+ maj_albums();
+ maj_random();
+ maj_archives();
+}
-if (file_exists("$maj_data_directory/old.txt")) {
- sort($maj_items);
+if (!file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_panels($maj_left_panels);
}
-else {
- rsort($maj_items);
+
+if (file_exists("$maj_data_directory/panels-l.txt")) {
+ maj_panels($maj_right_panels);
+ maj_badges();
}
-reset($maj_items);
-
-$maj_count_items = count($maj_items);
-
-rsort($maj_latest);
-reset($maj_latest);
-
-$maj_count_latest = count($maj_latest);
-
-rsort($maj_albums);
-reset($maj_albums);
-
-$maj_count_albums = count($maj_albums);
-
-rsort($maj_random);
-reset($maj_random);
-$maj_count_random = count($maj_random);
+// main
-rsort($maj_archives);
-reset($maj_archives);
+echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-$maj_count_archives = count($maj_archives);
+maj_panels($maj_top_panels);
if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-summary.txt") and !file_exists("$maj_data_directory/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
@@ -1327,8 +1147,6 @@ if (isset($maj_req_category) and !empty($maj_req_category)) {
else {
rsort($maj_items);
}
-
- reset($maj_items);
}
}
@@ -1826,7 +1644,6 @@ foreach ($maj_disp as $maj_d) {
}
sort($maj_entry_categories);
- reset($maj_entry_categories);
if (count($maj_entry_categories) > 0) {
@@ -2230,7 +2047,7 @@ foreach ($maj_disp as $maj_d) {
}
sort($maj_sort_album);
- reset($maj_sort_album);
+
$maj_count_album_entry = count($maj_sort_album);
if ($maj_count_album_entry < 1) {
@@ -2334,7 +2151,7 @@ foreach ($maj_disp as $maj_d) {
else {
foreach ($maj_videos as $maj_video) {
- $maj_video_show = str_replace("media/$maj_d/videos/","",$maj_video);
+ $maj_video_show = basename($maj_video);
echo "<a href=\"video.php?entry=$maj_d&show=$maj_video_show\">";
echo "<video width=\"95\" height=\"71\" preload=\"meta\" style=\"margin: 2px;\">";
@@ -2401,7 +2218,6 @@ foreach ($maj_disp as $maj_d) {
closedir($maj_dh_filedrop);
}
- reset($maj_filedrop_files);
sort($maj_filedrop_files);
foreach ($maj_filedrop_files as $maj_filedrop_file) {
@@ -2463,7 +2279,6 @@ foreach ($maj_disp as $maj_d) {
}
asort($maj_show_comments);
- reset($maj_show_comments);
foreach ($maj_show_comments as $maj_comment) {
@@ -2827,7 +2642,6 @@ foreach ($maj_disp as $maj_d) {
}
asort($maj_show_pending_comments);
- reset($maj_show_pending_comments);
$maj_count_pending_comments = count($maj_show_pending_comments);
@@ -3078,519 +2892,51 @@ echo "</tr></table></td>";
// right side
-echo "<td width=\"$maj_wside\" valign=\"top\">";
-
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if ($maj_dh_pending_comment_flags = opendir("$maj_data_directory/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 != "..") {
- $maj_show_pending_comment_flags[] = $maj_entry_pending_comment_flags;
- }
- }
- closedir($maj_dh_pending_comment_flags);
- }
-
- rsort($maj_show_pending_comment_flags);
- reset($maj_show_pending_comment_flags);
- $maj_count_pending_comment_flags = count($maj_show_pending_comment_flags);
-
- if (($maj_count_latest > 0) and ($maj_count_pending_comment_flags > 0)) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Pending Comments</div>';
-
- echo '<div class="panel_body">';
-
- if ($maj_dh_list_pending_comment_flags = opendir("$maj_data_directory/comments/pending")) {
-
- while (($maj_entry_list_pending_comment_flags = readdir($maj_dh_list_pending_comment_flags)) !== false) {
-
- if ($maj_entry_list_pending_comment_flags != "." && $maj_entry_list_pending_comment_flags != "..") {
-
- echo "<a href=\"index.php?entry=$maj_entry_list_pending_comment_flags&show=comments#pending\">";
- readfile("$maj_data_directory/items/$maj_entry_list_pending_comment_flags/title.txt");
- echo "</a><br><font style=\"font-size: $maj_font_Spx; color: #999999;\">";
-
- $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_entry_list_pending_comment_flags/count.txt");
-
- if ($maj_comment_count_value == 1) {
- echo " ($maj_comment_count_value comment) ";
- }
- elseif ($maj_comment_count_value > 1) {
- echo " ($maj_comment_count_value comments) ";
- }
- else {
- echo '';
- }
- echo '</font><br>';
- }
- }
- closedir($maj_dh_list_pending_comment_flags);
- }
- echo '</div></div>';
- }
-}
-
-if (!file_exists("$maj_data_directory/xucomment.txt") and isset($maj_logged_in_username)) {
-
- if ($maj_logged_in_username == $maj_admin_username) {
-
- if (file_exists("$maj_data_directory/comments/unread") and (count(glob("$maj_data_directory/comments/unread/*")) > 0)) {
-
- if ($maj_dh_unread_comments = opendir("$maj_data_directory/comments/unread")) {
-
- while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
-
- if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
-
- if (!file_exists("$maj_data_directory/items/$maj_unread_comment")) {
- rmdirr("$maj_data_directory/comments/unread/$maj_unread_comment");
- }
- else {
- $maj_unread_comments[] = $maj_unread_comment;
- }
- }
- }
- closedir($maj_dh_unread_comments);
- }
- }
- }
- else {
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username")) {
-
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread") and (count(glob("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/*")) > 0)) {
-
- if ($maj_dh_unread_comments = opendir("$maj_data_directory/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("$maj_data_directory/items/$maj_unread_comment")) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$maj_unread_comment");
- }
- else {
- $maj_unread_comments[] = $maj_unread_comment;
- }
- }
- }
- closedir($maj_dh_unread_comments);
- }
- }
- }
- }
-
- sort($maj_unread_comments);
- reset($maj_unread_comments);
-
- if (count($maj_unread_comments) > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title"><a href="del.php?target=unread"><img src="images/widget.del.png" border="0" width="11" height="11" align="right"></a>Unread Comments</div>';
- echo '<div class="panel_body"><table border="0" cellspacing="0" cellpadding="0" width="100%">';
-
- foreach ($maj_unread_comments as $maj_unread_comment) {
-
- $maj_unread_comment_title = file_get_contents("$maj_data_directory/items/$maj_unread_comment/title.txt");
-
- echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$maj_unread_comment&show=comments\">$maj_unread_comment_title</a></td></tr>";
- }
-
- echo '</table></div></div>';
- }
-}
-
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and file_exists("$maj_data_directory/members/confirmed") and !file_exists("$maj_data_directory/xapp.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
- if ($maj_dh_pending_list = opendir("$maj_data_directory/members/confirmed")) {
- while (($maj_entry_pending_list = readdir($maj_dh_pending_list)) !== false) {
-
- if ($maj_entry_pending_list != "." && $maj_entry_pending_list != "..") {
- $maj_show_pending_list[] = $maj_entry_pending_list;
- }
- }
- closedir($maj_dh_pending_list);
- }
-
- sort($maj_show_pending_list);
- reset($maj_show_pending_list);
- $maj_count_pending_list = count($maj_show_pending_list);
-
- if ($maj_count_pending_list > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Pending Member';
-
- if ($maj_count_pending_list > 1) {
- echo "s";
- }
- echo "</div><div class=panel_body>Please approve or deny $maj_count_pending_list pending membership request";
- if ($maj_count_pending_list > 1) {
- echo "s";
- }
- echo " below.</div></div>";
-
- foreach ($maj_show_pending_list as $maj_pending_list_entry) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">';
- echo "$maj_pending_list_entry";
- echo '<a href=reg.php?username=';
- echo $maj_pending_list_entry;
- echo '&key=';
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/key.txt");
- echo '&action=deny><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=deny></a><a href=reg.php?username=';
- echo $maj_pending_list_entry;
- echo '&key=';
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/key.txt");
- echo '&action=approve><img src=images/widget.cat.png border=0 width=11 height=11 align=right alt=approve></a></div>';
- echo "<div class=panel_body>";
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt")) {
- echo "<a href=\"";
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt");
- echo "\" target=_pending>";
- }
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/firstname.txt");
- echo " ";
- readfile("$maj_data_directory/members/confirmed/$maj_pending_list_entry/lastname.txt");
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/url.txt")) {
- echo "</a>";
- }
- echo "<br>";
- $maj_pending_email = file_get_contents("$maj_data_directory/members/confirmed/$maj_pending_list_entry/email.txt");
- //$maj_pending_email = wordwrap($maj_pending_email,30);
- echo $maj_pending_email;
- if (file_exists("$maj_data_directory/members/confirmed/$maj_pending_list_entry/timestamp.txt")) {
- $maj_confirmed = file_get_contents("$maj_data_directory/members/confirmed/$maj_pending_list_entry/timestamp.txt");
- $maj_confirmed_year = mb_substr($maj_confirmed,0,4);
- $maj_confirmed_month = mb_substr($maj_confirmed,4,2);
- $maj_confirmed_day = mb_substr($maj_confirmed,6,2);
- $maj_confirmed_hh = mb_substr($maj_confirmed,8,2);
- $maj_confirmed_mm = mb_substr($maj_confirmed,10,2);
- $maj_email_confirmed = date("d M Y H:i",mktime($maj_confirmed_hh,$maj_confirmed_mm,0,$maj_confirmed_month,$maj_confirmed_day,$maj_confirmed_year));
- echo "<br>$maj_email_confirmed";
- }
- echo "</div></div>";
- }
- }
-}
-
-if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-stats.txt")) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Bulletin Board</div>';
-
- echo "<div class=panel_body>";
-
- if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/bb.txt")) {
- if ($maj_dh_active_list = opendir("$maj_data_directory/members/active")) {
- while (($maj_entry_active_list = readdir($maj_dh_active_list)) !== false) {
- if ($maj_entry_active_list != "." && $maj_entry_active_list != "..") {
- $maj_show_active_list[] = $maj_entry_active_list;
- }
- }
- closedir($maj_dh_active_list);
- }
-
- sort($maj_show_active_list);
- reset($maj_show_active_list);
- $maj_count_active_list = count($maj_show_active_list);
- if ($maj_count_active_list > 0) {
- echo "Registered Members: $maj_count_active_list";
- }
- }
-
- if (file_exists("$maj_data_directory/items")) {
- if ($maj_dh_mempost_list = opendir("$maj_data_directory/items")) {
- while (($maj_entry_mempost_list = readdir($maj_dh_mempost_list)) !== false) {
-
- if (file_exists("$maj_data_directory/items/$maj_entry_mempost_list/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- $maj_private_categories = "0";
-
- if (file_exists("$maj_data_directory/items/$maj_entry_mempost_list/categories")) {
-
- if ($maj_dh_entry_categories_mempost_list = opendir("$maj_data_directory/items/$maj_entry_mempost_list/categories")) {
-
- while (($maj_entry_category_mempost_list = readdir($maj_dh_entry_categories_mempost_list)) !== false) {
-
- if ($maj_entry_category_mempost_list != "." && $maj_entry_category_mempost_list != "..") {
-
- if (file_exists("$maj_data_directory/categories/$maj_entry_category_mempost_list/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories_mempost_list);
- }
- }
-
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_entry_mempost_list/cat.txt")) {
- continue;
- }
-
- if ($maj_entry_mempost_list != "." && $maj_entry_mempost_list != "..") {
- $maj_entry_mempost_list = mb_substr("$maj_entry_mempost_list",0,6);
- $maj_show_mempost_list[] = $maj_entry_mempost_list;
- }
- }
- closedir($maj_dh_mempost_list);
- }
- rsort($maj_show_mempost_list);
- $maj_count_mempost_list = count($maj_show_mempost_list);
- echo "<br>Total Posts: $maj_count_mempost_list";
- unset($maj_show_mempost_list);
- }
-
- if (file_exists("$maj_data_directory/bb-new.txt")) {
- $maj_bb_new = file_get_contents("$maj_data_directory/bb-new.txt");
- echo "<br>Newest User: <a href=member.php?id=$maj_bb_new>$maj_bb_new</a>";
- }
- if (file_exists("$maj_data_directory/bb-last.txt")) {
- $maj_bb_last = file_get_contents("$maj_data_directory/bb-last.txt");
- echo "<br>Latest Login: <a href=member.php?id=$maj_bb_last>$maj_bb_last</a>";
- }
- echo "</div></div>";
-}
-
-if (($maj_count_grand > 0) and (!file_exists("$maj_data_directory/xsearch.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">';
-
- ?>
-
- Search</div>
- <form enctype="multipart/form-data" action="dig.php" method="post">
- <div class="panel_body">
- <input type="search" class="search" name="search" autocomplete="off" maxlength="55" required>
- </form>
- </div></div>
-
- <?php
-}
-
-
-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>';
-
- echo "<div class=panel_body>";
- echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
- if (file_exists("$maj_data_directory/bb.txt")) {
- echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
- }
- echo "<br><a class=\"navlink\" href=\"index.php?find=unfiled\">Unfiled</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=passwd\">Password Protected</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=comments\">With Comments</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
- echo "</div></div>";
-}
-
-if (file_exists("$maj_data_directory/categories")) {
- if ($maj_dh_categories = opendir("$maj_data_directory/categories")) {
- while (($maj_entry_categories = readdir($maj_dh_categories)) !== false) {
-
- if (file_exists("$maj_data_directory/xcat.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if (file_exists("$maj_data_directory/categories/$maj_entry_categories/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
-
- if ($maj_entry_categories != "." && $maj_entry_categories != "..") {
- $maj_show_categories[] = $maj_entry_categories;
- }
- }
- closedir($maj_dh_categories);
- }
-
- sort($maj_show_categories);
- reset($maj_show_categories);
- $maj_count_categories = count($maj_show_categories);
-
- if ($maj_count_categories > 0) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Categories</div>';
-
- echo '<div class=panel_body>';
-
- foreach ($maj_show_categories as $maj_category) {
-
- echo "<a class=\"navlink\" href=\"index.php?category=$maj_category\">";
-
- if (file_exists("$maj_data_directory/categories/$maj_category/title.txt")) {
- $maj_category_title = file_get_contents("$maj_data_directory/categories/$maj_category/title.txt");
- }
- else {
- $maj_category_title = ucfirst(str_replace("_"," ",$maj_category));
- }
-
- echo $maj_category_title;
- echo "</a><br>";
- }
-
- echo '</div></div>';
- }
-}
+if (!file_exists("$maj_data_directory/panels-l.txt")) {
-if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+ echo "<td width=\"$maj_wside\" valign=\"top\">";
- echo '<div class="panel_wrapper"><div class="panel_title">Statistics</div>';
-
- echo '<div class=panel_body>';
- echo "Total Entries: $maj_count_latest";
- if (file_exists("$maj_data_directory/hits.txt")) {
- echo '<br>Site Hits: ';
- readfile("$maj_data_directory/hits.txt");
- }
- if (file_exists("$maj_data_directory/google.txt")) {
- echo '<br>Google Visits: ';
- readfile("$maj_data_directory/google.txt");
- }
- if (file_exists("$maj_data_directory/rss-0.91.txt")) {
- echo '<br>RSS 0.91 Hits: ';
- readfile("$maj_data_directory/rss-0.91.txt");
- }
- if (file_exists("$maj_data_directory/rss-1.0.txt")) {
- echo '<br>RSS 1.0 Hits: ';
- readfile("$maj_data_directory/rss-1.0.txt");
- }
- if (file_exists("$maj_data_directory/rss-2.0.txt")) {
- echo '<br>RSS 2.0 Hits: ';
- readfile("$maj_data_directory/rss-2.0.txt");
- }
- if (file_exists("$maj_data_directory/sitemap.txt")) {
- echo '<br>Sitemap Requests: ';
- readfile("$maj_data_directory/sitemap.txt");
+ if (file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_profile();
+ maj_navigation();
+ maj_quick_links();
}
- echo '</div></div>';
+ maj_pending_comments();
+ maj_unread_comments();
+ maj_pending_members();
+ maj_bb_stats();
+ maj_search();
+ maj_find();
+ maj_categories();
+ maj_statistics();
+ maj_recent();
+ maj_albums();
+ maj_random();
+ maj_archives();
}
-if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_exists("$maj_data_directory/xrecent.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Recent Entries</div>';
-
- echo '<div class=panel_body>';
-
- $maj_increment_recent_entries = "0";
-
- if ($maj_count_latest < 10) {
- $maj_max_recent_entries = $maj_count_latest;
- }
- else {
- $maj_max_recent_entries = "10";
- }
-
- while ($maj_increment_recent_entries < $maj_max_recent_entries) {
-
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_latest[$maj_increment_recent_entries]\">";
- readfile("$maj_data_directory/items/$maj_latest[$maj_increment_recent_entries]/title.txt");
- echo "</a><br>";
-
- $maj_increment_recent_entries = $maj_increment_recent_entries + 1;
- }
-
- echo '</div></div>';
+if (file_exists("$maj_data_directory/panels-r.txt")) {
+ maj_panels($maj_left_panels);
}
-if (($maj_count_albums > 0) and (!file_exists("$maj_data_directory/xalbum.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
-
- echo "<div class=\"panel_body\">";
-
- foreach ($maj_albums as $maj_album) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$maj_album&show=album\">";
- readfile("$maj_data_directory/items/$maj_album/title.txt");
- echo "</a><br>";
- }
- echo '</div></div>';
-}
+if (!file_exists("$maj_data_directory/panels-l.txt")) {
-if (!file_exists("$maj_data_directory/xrand.txt") or ($maj_logged_in_username == $maj_admin_username)) {
-
- shuffle($maj_random);
- reset($maj_random);
+ maj_panels($maj_right_panels);
+ maj_badges();
- if (file_exists("$maj_data_directory/increase.txt")) {
- $maj_limit_random = file_get_contents("$maj_data_directory/increase.txt");
- }
- else {
- $maj_limit_random = 5;
- }
-
- if ($maj_count_random > $maj_limit_random) {
-
- echo '<div class="panel_wrapper"><div class="panel_title">Random Entries</div>';
-
- echo "<div class=\"panel_body\">";
-
- $maj_increment_random = 0;
-
- if ($maj_count_random <= $maj_limit_random * 2) {
- $maj_show_random = $maj_count_random - 1;
- }
- else {
- $maj_show_random = $maj_limit_random * 2 - 1;
- }
-
- while ($maj_increment_random <= $maj_show_random) {
- echo "<a class=\"navlink\" href=\"index.php?entry={$maj_random[$maj_increment_random]}\">";
- readfile("$maj_data_directory/items/$maj_random[$maj_increment_random]/title.txt");
- echo "</a><br>";
-
- $maj_increment_random = $maj_increment_random + 1;
- }
- }
-
- if ($maj_count_random > $maj_limit_random) {
- echo "</div></div>";
- }
+ echo "</td>";
}
-?>
+echo "</tr>";
-<?php
-
-if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_count_latest > 0) and (!file_exists("$maj_data_directory/xarc.txt") or ($maj_logged_in_username == $maj_admin_username))) {
-
- $maj_archive_entries = implode(" ",$maj_archives);
-
- $maj_unique_archive_list = array_unique($maj_archives);
-
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Archives ($maj_count_archives)</div>";
- echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
-
- foreach ($maj_unique_archive_list as $maj_archive_list_entry) {
-
- $maj_archive_list_value = mb_substr($maj_archive_list_entry,0,6);
- $maj_archive_list_year = mb_substr($maj_archive_list_entry,0,4);
- $maj_archive_list_month = mb_substr($maj_archive_list_entry,4,2);
- $maj_archive_list_month = date("F",mktime(0,0,0,$maj_archive_list_month));
- $maj_archive_list_num = mb_substr_count($maj_archive_entries,$maj_archive_list_entry);
-
- echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$maj_archive_list_value\"><nobr>$maj_archive_list_month $maj_archive_list_year</nobr></a></td><td align=right>$maj_archive_list_num</td></tr>";
- }
- echo "</table></div></div>";
+if (file_exists("$maj_data_directory/panels-l.txt") or file_exists("$maj_data_directory/panels-r.txt")) {
+ echo "<tr><td colspan=\"5\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
}
-
-maj_panels($maj_right_panels);
-
-if ($maj_count_latest > 0) {
-
- $mphp_version = phpversion();
-
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$mphp_version</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
+else {
+ echo "<tr><td colspan=\"7\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
}
-echo "</td></tr>";
-
-echo "<tr><td colspan=\"7\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
-
echo "</table>";
if (file_exists("$maj_data_directory/footer.txt")) {
diff --git a/member.php b/member.php
index 7c72ab2..594cdd6 100644
--- a/member.php
+++ b/member.php
@@ -289,7 +289,7 @@ if (file_exists("data/members/active")) {
}
sort($show_member_list);
- reset($show_member_list);
+
$count_member_list = count($show_member_list);
if ($count_member_list > 0) {
@@ -530,7 +530,6 @@ if (file_exists("data/members/active")) {
}
sort($show_cat);
- reset($show_cat);
foreach ($show_cat as $category) {
echo "<option";
diff --git a/move.php b/move.php
index 3658fb9..21f125f 100644
--- a/move.php
+++ b/move.php
@@ -37,7 +37,6 @@ if ($dh_items = opendir("data/items")) {
}
rsort($target_items);
-reset($target_items);
if (isset($_POST['target']) and !empty($_POST['target'])) {
diff --git a/panels.php b/panels.php
index b82f432..ffe913d 100644
--- a/panels.php
+++ b/panels.php
@@ -1,11 +1,5 @@
<?php
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
require("core.php");
if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
@@ -449,7 +443,7 @@ a:active {
}
sort($show_panel);
- reset($show_panel);
+
$count_panel = count($show_panel);
if ($count_panel > 0) {
@@ -549,7 +543,6 @@ a:active {
$links = glob("$maj_data_directory/items/*");
rsort($links);
- reset($links);
if ((count($links) > 0) and ($panel != file_get_contents("$maj_data_directory/header.txt")) and ($panel != file_get_contents("$maj_data_directory/footer.txt"))) {
@@ -558,7 +551,7 @@ a:active {
foreach ($links as $link) {
$link_title = file_get_contents("$link/title.txt");
- $link_entry = str_replace("$maj_data_directory/items/","",$link);
+ $link_entry = basename($link);
if (file_exists("$maj_data_directory/panels/$panel/link.txt") and (file_get_contents("$maj_data_directory/panels/$panel/link.txt") == $link_entry)) {
diff --git a/rss.php b/rss.php
index ff445c6..f048c16 100644
--- a/rss.php
+++ b/rss.php
@@ -95,7 +95,6 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
}
rsort($show_rss_items);
- reset($show_rss_items);
$count_rss_items = count($show_rss_items);
diff --git a/settings.php b/settings.php
index 9ad99bd..f3c53e1 100644
--- a/settings.php
+++ b/settings.php
@@ -1159,6 +1159,42 @@ if (isset($_FILES['background']) and !empty($_FILES['background'])) {
}
}
+if (isset($_POST['panel_position']) and !empty($_POST['panel_position'])) {
+
+ if ($_POST['panel_position'] == "default") {
+
+ if (file_exists("data/panels-l.txt")) {
+ unlink("data/panels-l.txt");
+ }
+
+ if (file_exists("data/panels-r.txt")) {
+ unlink("data/panels-r.txt");
+ }
+ }
+
+ if ($_POST['panel_position'] == "left") {
+
+ if (!file_exists("data/panels-l.txt")) {
+ touch("data/panels-l.txt");
+ }
+
+ if (file_exists("data/panels-r.txt")) {
+ unlink("data/panels-r.txt");
+ }
+ }
+
+ if ($_POST['panel_position'] == "right") {
+
+ if (!file_exists("data/panels-r.txt")) {
+ touch("data/panels-r.txt");
+ }
+
+ if (file_exists("data/panels-l.txt")) {
+ unlink("data/panels-l.txt");
+ }
+ }
+}
+
if (file_exists("data/css.txt") and (mb_strlen("data/css.txt") < 1)) {
unlink("data/css.txt");
}
@@ -1445,6 +1481,13 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
<tr><td>upload <a href="http://tools.dynamicdrive.com/favicon/" target="_maj">favicon.ico</a></td><td><input autocomplete="off" type="file" name="favicon"></td></tr>
<tr><td>upload profile picture</td><td><input autocomplete="off" type="file" name="picture"></td></tr>
<tr><td>upload background image</td><td><input autocomplete="off" type="file" name="background"></td></tr>
+
+<tr><td rowspan="4">panels</td></tr>
+
+<tr><td><input type="radio" name="panel_position" value="default"<?php if (!file_exists("data/panels-l.txt") and !file_exists("data/panels-r.txt")) { echo " checked"; } ?>> Display panels in their default positions.</td></tr>
+<tr><td><input type="radio" name="panel_position" value="left"<?php if (file_exists("data/panels-l.txt")) { echo " checked"; } ?>> Display all panels on the left side of the page.</td></tr>
+<tr><td><input type="radio" name="panel_position" value="right"<?php if (file_exists("data/panels-r.txt")) { echo " checked"; } ?>> Display all panels on the right side of the page.</td></tr>
+
<tr><td>user-defined css</td><td><textarea class="input" name="css" rows="10"><?php readfile("data/css.txt"); ?></textarea></td></tr>
<tr><td>profile*</td><td><textarea class="input" name="profile" rows="10"><?php readfile("data/profile.php"); ?></textarea></td></tr>
<tr><td>current password</td><td><input autocomplete="off" class="input" type="password" name="passwd_cur"></td></tr>
diff --git a/sitemap.php b/sitemap.php
index 52b9c48..e9e1120 100644
--- a/sitemap.php
+++ b/sitemap.php
@@ -59,7 +59,7 @@ if ($dh_sitemap_items = opendir($dir)) {
}
rsort($show_sitemap_items);
-reset($show_sitemap_items);
+
$count_sitemap_items = count($show_sitemap_items);
if ($count_sitemap_items > 0) {
diff --git a/video.php b/video.php
index c28bcab..0e06c17 100644
--- a/video.php
+++ b/video.php
@@ -198,7 +198,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST
foreach ($maj_videos as $maj_video) {
- $maj_play = str_replace("media/$maj_d/videos/","",$maj_video);
+ $maj_play = basename($maj_video);
echo "<div class=\"menu\">";
diff --git a/wiki.php b/wiki.php
index 8eff463..753f92b 100644
--- a/wiki.php
+++ b/wiki.php
@@ -217,7 +217,7 @@ del {
closedir($dh_delta);
}
rsort($show_delta);
- reset($show_delta);
+
$count_delta = count($show_delta);
if ($count_delta > 0)
{