This commit has been accessed 570 times via Git panel.
commit 3da81473c5463d762ca6f61fda63db8e04619380
tree ee50d405fb500fae10e6e1094a584677f9f9e836
parent 7ed2998e3552daf3bec9b8a95fc4300ffb23c933
author Engels Antonio <engels@majcms.org> 1277314196 +0800
committer Engels Antonio <engels@majcms.org> 1277314196 +0800
maj-0.14-20080303-bb.zip
diff --git a/add.php b/add.php
index 98d9acf..f83b914 100644
--- a/add.php
+++ b/add.php
@@ -344,11 +344,19 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
if ($count_cat > 0) {
- echo "<p><select name=category><option selected>unfiled";
+ echo "<p><select name=\"category\"><option selected>unfiled";
foreach ($show_cat as $category) {
- echo "<option>";
+ echo "<option value=\"";
echo strtolower($category);
+ echo "\">";
+
+ if (file_exists("data/categories/$category/title.txt")) {
+ readfile("data/categories/$category/title.txt");
+ }
+ else {
+ echo strtolower($category);
+ }
}
echo "</select> Select category.</p>";
diff --git a/edit.php b/edit.php
index 10c522c..6daf675 100644
--- a/edit.php
+++ b/edit.php
@@ -418,19 +418,25 @@ if ($_SESSION['logged_in'] == $login_username) {
if ($count_cat > 0) {
- echo "<p><select name=category><option selected>";
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- readfile("data/items/{$_REQUEST['entry']}/category.txt");
- echo '<option>unfiled';
- }
- else {
- echo "unfiled";
- }
-
+ echo "<p><select name=\"category\"><option>unfiled";
foreach ($show_cat as $category) {
- echo "<option>";
+ echo "<option value=\"";
echo strtolower($category);
+ echo "\"";
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/category.txt") and (file_get_contents("data/items/{$_REQUEST['entry']}/category.txt") == $category)) {
+ echo " selected";
+ }
+
+ echo ">";
+
+ if (file_exists("data/categories/$category/title.txt")) {
+ readfile("data/categories/$category/title.txt");
+ }
+ else {
+ echo strtolower($category);
+ }
}
echo "</select> Select category.</p>";
diff --git a/index.php b/index.php
index 273075e..208dc03 100644
--- a/index.php
+++ b/index.php
@@ -1780,6 +1780,19 @@ if (is_dir($dir)) {
$items[] = $entry_main;
}
}
+ elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ if (!file_exists("data/items/$entry_main/category.txt")) {
+ $items[] = $entry_main;
+ }
+ }
+ elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ if (count(glob("data/items/$entry_main/comments/live/*")) === 0) {
+ rmdir("data/items/$entry_main/comments/live");
+ }
+ if (file_exists("data/items/$entry_main/comments/live")) {
+ $items[] = $entry_main;
+ }
+ }
elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "filedrop")) {
if (count(glob("data/items/$entry_main/filedrop/*")) === 0) {
rmdir("data/items/$entry_main/filedrop");
@@ -3574,9 +3587,15 @@ if (($start >= $increase) and ($start != 0)) {
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
echo "find=member&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ echo "find=unfiled&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
echo "find=passwd&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ echo "find=comments&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
echo "find=album&";
}
@@ -3606,9 +3625,15 @@ if ($end < sizeof($items)) {
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
echo "find=member&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ echo "find=unfiled&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
echo "find=passwd&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ echo "find=comments&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
echo "find=album&";
}
@@ -3658,7 +3683,7 @@ rsort($show_latest_items);
reset($show_latest_items);
$count_latest_items = count($show_latest_items);
-if ($count_latest_items > 0) {
+if (($count_latest_items > 0) and (!file_exists("data/xrecent.txt") or isset($_SESSION['logged_in']))) {
if (file_exists("data/round.txt")) {
echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
@@ -3811,7 +3836,9 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
if (file_exists("data/bb.txt")) {
echo "<br><a href=index.php?find=member>Members-Only</a>";
}
+ echo "<br><a href=index.php?find=unfiled>Unfiled</a>";
echo "<br><a href=index.php?find=passwd>Password Protected</a>";
+ echo "<br><a href=index.php?find=comments>With Comments</a>";
echo "<br><a href=index.php?find=filedrop>With Attached Files</a>";
echo "<br><a href=index.php?find=album>With Photo Album</a>";
echo "</div>";
@@ -4245,7 +4272,7 @@ if (file_exists("data/items")) {
reset($show_archive_list);
$count_archive_list = count($show_archive_list);
- if ($count_archive_list > 0) {
+ if (($count_archive_list > 0) and ($count_latest_items > 0)) {
$archive_entries = implode(" ",$show_archive_list);
$unique_archive_list = array_unique($show_archive_list);
diff --git a/settings.php b/settings.php
index 6d5380d..5a1cfa2 100644
--- a/settings.php
+++ b/settings.php
@@ -201,6 +201,18 @@ if (!isset($_POST['nocat']) or empty($_POST['nocat'])) {
}
}
+if (isset($_POST['xrecent']) and !empty($_POST['xrecent']) and ($_POST['xrecent'] == "on") and !file_exists("data/xrecent.txt")) {
+ touch("data/xrecent.txt");
+}
+
+if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xrecent.txt")) {
+ unlink("data/xrecent.txt");
+ }
+ }
+}
+
if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on") and !file_exists("data/round.txt")) {
touch("data/round.txt");
}
@@ -975,10 +987,10 @@ a:active {
<tr><td><p>ping on content change</p></td><td><input autocomplete=off class=input type=text name=ping value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan=<?php
if (file_exists("data/email.txt")) {
- echo "10";
+ echo "11";
}
else {
- echo "9";
+ echo "10";
}
?>
><p>toggles</p></td><td><p><input type=checkbox name=nocomment <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</p></td></tr>
@@ -986,6 +998,7 @@ a:active {
<tr><td><p><input type=checkbox name=nak <?php if (file_exists("data/nak.txt")) { echo checked; } ?>> Do not acknowledge comment submissions via e-mail.</p></td></tr>
<?php } ?>
<tr><td><p><input type=checkbox name=nopdf <?php if (file_exists("data/nopdf.txt")) { echo checked; } ?>> Do not allow PDF generation for all entries.</p></td></tr>
+<tr><td><p><input type=checkbox name=xrecent <?php if (file_exists("data/xrecent.txt")) { echo checked; } ?>> Do not show recent entries panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xrand <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xarc <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xcat <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</p></td></tr>
tree ee50d405fb500fae10e6e1094a584677f9f9e836
parent 7ed2998e3552daf3bec9b8a95fc4300ffb23c933
author Engels Antonio <engels@majcms.org> 1277314196 +0800
committer Engels Antonio <engels@majcms.org> 1277314196 +0800
maj-0.14-20080303-bb.zip
diff --git a/add.php b/add.php
index 98d9acf..f83b914 100644
--- a/add.php
+++ b/add.php
@@ -344,11 +344,19 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
if ($count_cat > 0) {
- echo "<p><select name=category><option selected>unfiled";
+ echo "<p><select name=\"category\"><option selected>unfiled";
foreach ($show_cat as $category) {
- echo "<option>";
+ echo "<option value=\"";
echo strtolower($category);
+ echo "\">";
+
+ if (file_exists("data/categories/$category/title.txt")) {
+ readfile("data/categories/$category/title.txt");
+ }
+ else {
+ echo strtolower($category);
+ }
}
echo "</select> Select category.</p>";
diff --git a/edit.php b/edit.php
index 10c522c..6daf675 100644
--- a/edit.php
+++ b/edit.php
@@ -418,19 +418,25 @@ if ($_SESSION['logged_in'] == $login_username) {
if ($count_cat > 0) {
- echo "<p><select name=category><option selected>";
- if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
- readfile("data/items/{$_REQUEST['entry']}/category.txt");
- echo '<option>unfiled';
- }
- else {
- echo "unfiled";
- }
-
+ echo "<p><select name=\"category\"><option>unfiled";
foreach ($show_cat as $category) {
- echo "<option>";
+ echo "<option value=\"";
echo strtolower($category);
+ echo "\"";
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/category.txt") and (file_get_contents("data/items/{$_REQUEST['entry']}/category.txt") == $category)) {
+ echo " selected";
+ }
+
+ echo ">";
+
+ if (file_exists("data/categories/$category/title.txt")) {
+ readfile("data/categories/$category/title.txt");
+ }
+ else {
+ echo strtolower($category);
+ }
}
echo "</select> Select category.</p>";
diff --git a/index.php b/index.php
index 273075e..208dc03 100644
--- a/index.php
+++ b/index.php
@@ -1780,6 +1780,19 @@ if (is_dir($dir)) {
$items[] = $entry_main;
}
}
+ elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ if (!file_exists("data/items/$entry_main/category.txt")) {
+ $items[] = $entry_main;
+ }
+ }
+ elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ if (count(glob("data/items/$entry_main/comments/live/*")) === 0) {
+ rmdir("data/items/$entry_main/comments/live");
+ }
+ if (file_exists("data/items/$entry_main/comments/live")) {
+ $items[] = $entry_main;
+ }
+ }
elseif (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "filedrop")) {
if (count(glob("data/items/$entry_main/filedrop/*")) === 0) {
rmdir("data/items/$entry_main/filedrop");
@@ -3574,9 +3587,15 @@ if (($start >= $increase) and ($start != 0)) {
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
echo "find=member&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ echo "find=unfiled&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
echo "find=passwd&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ echo "find=comments&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
echo "find=album&";
}
@@ -3606,9 +3625,15 @@ if ($end < sizeof($items)) {
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "member")) {
echo "find=member&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "unfiled")) {
+ echo "find=unfiled&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "passwd")) {
echo "find=passwd&";
}
+ if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "comments")) {
+ echo "find=comments&";
+ }
if (isset($_REQUEST['find']) and !empty($_REQUEST['find']) and ($_REQUEST['find'] == "album")) {
echo "find=album&";
}
@@ -3658,7 +3683,7 @@ rsort($show_latest_items);
reset($show_latest_items);
$count_latest_items = count($show_latest_items);
-if ($count_latest_items > 0) {
+if (($count_latest_items > 0) and (!file_exists("data/xrecent.txt") or isset($_SESSION['logged_in']))) {
if (file_exists("data/round.txt")) {
echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
@@ -3811,7 +3836,9 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
if (file_exists("data/bb.txt")) {
echo "<br><a href=index.php?find=member>Members-Only</a>";
}
+ echo "<br><a href=index.php?find=unfiled>Unfiled</a>";
echo "<br><a href=index.php?find=passwd>Password Protected</a>";
+ echo "<br><a href=index.php?find=comments>With Comments</a>";
echo "<br><a href=index.php?find=filedrop>With Attached Files</a>";
echo "<br><a href=index.php?find=album>With Photo Album</a>";
echo "</div>";
@@ -4245,7 +4272,7 @@ if (file_exists("data/items")) {
reset($show_archive_list);
$count_archive_list = count($show_archive_list);
- if ($count_archive_list > 0) {
+ if (($count_archive_list > 0) and ($count_latest_items > 0)) {
$archive_entries = implode(" ",$show_archive_list);
$unique_archive_list = array_unique($show_archive_list);
diff --git a/settings.php b/settings.php
index 6d5380d..5a1cfa2 100644
--- a/settings.php
+++ b/settings.php
@@ -201,6 +201,18 @@ if (!isset($_POST['nocat']) or empty($_POST['nocat'])) {
}
}
+if (isset($_POST['xrecent']) and !empty($_POST['xrecent']) and ($_POST['xrecent'] == "on") and !file_exists("data/xrecent.txt")) {
+ touch("data/xrecent.txt");
+}
+
+if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xrecent.txt")) {
+ unlink("data/xrecent.txt");
+ }
+ }
+}
+
if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on") and !file_exists("data/round.txt")) {
touch("data/round.txt");
}
@@ -975,10 +987,10 @@ a:active {
<tr><td><p>ping on content change</p></td><td><input autocomplete=off class=input type=text name=ping value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan=<?php
if (file_exists("data/email.txt")) {
- echo "10";
+ echo "11";
}
else {
- echo "9";
+ echo "10";
}
?>
><p>toggles</p></td><td><p><input type=checkbox name=nocomment <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</p></td></tr>
@@ -986,6 +998,7 @@ a:active {
<tr><td><p><input type=checkbox name=nak <?php if (file_exists("data/nak.txt")) { echo checked; } ?>> Do not acknowledge comment submissions via e-mail.</p></td></tr>
<?php } ?>
<tr><td><p><input type=checkbox name=nopdf <?php if (file_exists("data/nopdf.txt")) { echo checked; } ?>> Do not allow PDF generation for all entries.</p></td></tr>
+<tr><td><p><input type=checkbox name=xrecent <?php if (file_exists("data/xrecent.txt")) { echo checked; } ?>> Do not show recent entries panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xrand <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xarc <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</p></td></tr>
<tr><td><p><input type=checkbox name=xcat <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</p></td></tr>