This commit has been accessed 579 times via Git panel.
commit 2051f9e587173958f8ad8d836c7b079d9a4cb086
tree 1df190d9eefc93bab5cd07c99a3e112a64420feb
parent dc61dbe93d2a2285275425d7262a93ae37a9fc14
author Psylocke Antonio <psylocke@majcms.org> 1305126611 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1305126611 +0800
Add album display toggle
diff --git a/index.php b/index.php
index b9dd483..6691ab2 100644
--- a/index.php
+++ b/index.php
@@ -4993,7 +4993,7 @@ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_e
echo '</div></div>';
}
-if ($maj_count_albums > 0) {
+if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
diff --git a/settings.php b/settings.php
index 60b9250..12f60dc 100644
--- a/settings.php
+++ b/settings.php
@@ -257,6 +257,18 @@ if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
}
}
+if (isset($_POST['xalbum']) and !empty($_POST['xalbum']) and ($_POST['xalbum'] == "on") and !file_exists("data/xalbum.txt")) {
+ touch("data/xalbum.txt");
+}
+
+if (!isset($_POST['xalbum']) or empty($_POST['xalbum'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xalbum.txt")) {
+ unlink("data/xalbum.txt");
+ }
+ }
+}
+
if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
touch("data/xucomment.txt");
}
@@ -1207,7 +1219,7 @@ a:active {
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
- $toggles_rowspan = "15";
+ $toggles_rowspan = "16";
if (file_exists("data/email.txt")) {
$toggles_rowspan = $toggles_rowspan + 1;
@@ -1247,6 +1259,7 @@ a:active {
<tr><td><input type="checkbox" name="xrand" <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</td></tr>
<tr><td><input type="checkbox" name="xarc" <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</td></tr>
<tr><td><input type="checkbox" name="xcat" <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</td></tr>
+<tr><td><input type="checkbox" name="xalbum" <?php if (file_exists("data/xalbum.txt")) { echo checked; } ?>> Do not show albums panel.</td></tr>
<tr><td><input type="checkbox" name="nocat" <?php if (file_exists("data/nocat.txt")) { echo checked; } ?>> Do not show categorized items with unfiled entries.</td></tr>
<tr><td><input type="checkbox" name="center" <?php if (file_exists("data/center.txt")) { echo checked; } ?>> Display <?php
tree 1df190d9eefc93bab5cd07c99a3e112a64420feb
parent dc61dbe93d2a2285275425d7262a93ae37a9fc14
author Psylocke Antonio <psylocke@majcms.org> 1305126611 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1305126611 +0800
Add album display toggle
diff --git a/index.php b/index.php
index b9dd483..6691ab2 100644
--- a/index.php
+++ b/index.php
@@ -4993,7 +4993,7 @@ if (($maj_count_latest > 0) and ($maj_count_latest > $maj_increase) and (!file_e
echo '</div></div>';
}
-if ($maj_count_albums > 0) {
+if (($maj_count_albums > 0) and (!file_exists("data/xalbum.txt") or ($_SESSION['logged_in'] == file_get_contents("data/username.txt")))) {
echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Albums</div>";
diff --git a/settings.php b/settings.php
index 60b9250..12f60dc 100644
--- a/settings.php
+++ b/settings.php
@@ -257,6 +257,18 @@ if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
}
}
+if (isset($_POST['xalbum']) and !empty($_POST['xalbum']) and ($_POST['xalbum'] == "on") and !file_exists("data/xalbum.txt")) {
+ touch("data/xalbum.txt");
+}
+
+if (!isset($_POST['xalbum']) or empty($_POST['xalbum'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xalbum.txt")) {
+ unlink("data/xalbum.txt");
+ }
+ }
+}
+
if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
touch("data/xucomment.txt");
}
@@ -1207,7 +1219,7 @@ a:active {
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
- $toggles_rowspan = "15";
+ $toggles_rowspan = "16";
if (file_exists("data/email.txt")) {
$toggles_rowspan = $toggles_rowspan + 1;
@@ -1247,6 +1259,7 @@ a:active {
<tr><td><input type="checkbox" name="xrand" <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</td></tr>
<tr><td><input type="checkbox" name="xarc" <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</td></tr>
<tr><td><input type="checkbox" name="xcat" <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</td></tr>
+<tr><td><input type="checkbox" name="xalbum" <?php if (file_exists("data/xalbum.txt")) { echo checked; } ?>> Do not show albums panel.</td></tr>
<tr><td><input type="checkbox" name="nocat" <?php if (file_exists("data/nocat.txt")) { echo checked; } ?>> Do not show categorized items with unfiled entries.</td></tr>
<tr><td><input type="checkbox" name="center" <?php if (file_exists("data/center.txt")) { echo checked; } ?>> Display <?php