Profile
MAJ is an Open Source, PHP-based content management system (CMS) that can be deployed as a blog, bulletin or message board, Internet forum, and wiki. It is extensible via PHP panels and is HTML5 and CSS3 ready.
Git
This commit has been accessed 989 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
 
 
Credits
Sunday, Sep 18, 2005, 12:00 AM (Revision 11 - Thursday, Jul 14, 2011, 7:30 PM)
Open Source enables software developers to stand on the shoulders of giants instead of reinventing the wheel, so to speak. Kudos and many thanks to the folks who made their work freely available for reuse in MAJ.

read more
Bugs and Exploits
Friday, Aug 26, 2005, 12:00 AM (Revision 23 - Wednesday, May 29, 2013, 5:25 AM)
Although MAJ started as a family project, care has been taken to make it as "safe" as possible. With more people now working on MAJ, bugs and exploitable code may sometimes slip in. We invite you to poke around and see if you can find any. Generally, there are two things you can do when you find a MAJ or PHP-related bug or exploit:

1. Take advantage of it. But hey, what's so exciting about messing up someone's blog? Ho-hum, right?
2. Report it here so that we can work on a fix and make MAJ better.

read more
Search
Download
MAJ 2.0
75 files
33164 downloads
MAJ 1.0
26 files
13196 downloads
MAJ 0.14
45 files
35116 downloads