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 888 times via Git panel.

commit e0af0ab934fa4b5bd5c695c3512adc9aa2d5ba1b
tree 3b6df7ab2520dcabcb2b11495af1df20459b54ef
parent d6784da6b67fc6c08ef54a82213a328a0f98938d
author Engels Antonio <engels@majcms.org> 1294539190 +0800
committer Engels Antonio <engels@majcms.org> 1294539190 +0800

    Holiday release backlog commit

diff --git a/album.php b/album.php
index 436ecc8..f5aed1f 100644
--- a/album.php
+++ b/album.php
@@ -310,7 +310,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
        }
        if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
                if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
-                       echo "<tr bgcolor=#ffffff><td colspan=4 width=$album_image_width>";
+                       echo "<tr bgcolor=\"#ffffff\"><td colspan=\"$album_image_colspan\" width=\"$album_image_width\">";
                        $caption_get = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
                        echo $caption_get;
                        echo "</td></tr>";
@@ -453,21 +453,25 @@ if (file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
        echo "</td></tr></table>";
 }
 
-if (isset($_SERVER['HTTPS'])) {
-       $maj_proto = "https://";
-}
-else {
-       $maj_proto = "http://";
-}
-
-$maj_url = $maj_proto . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
+// Look into this!
+//
+//if (isset($_SERVER['HTTPS'])) {
+//     $maj_proto = "https://";
+//}
+//else {
+//     $maj_proto = "http://";
+//}
+//
+//$maj_url = $maj_proto . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
 
 if ($key_prev >= 0) {
-
-       echo "\n\n<script>\n\tvar img_prev = new Image();\n\timg_prev.src = \"$maj_url/images/{$_REQUEST['entry']}/album/$show_prev\";\n</script>";
+       //echo "\n\n<script>\n\tvar img_prev = new Image();\n\timg_prev.src = \"$maj_url/images/{$_REQUEST['entry']}/album/$show_prev\";\n</script>";
+       echo "\n\n<script>\n\tvar img_prev = new Image();\n\timg_prev.src = \"images/{$_REQUEST['entry']}/album/$show_prev\";\n</script>";
 }
 
 if ($key_next < $count_album_entry) {
-       echo "\n\n<script>\n\tvar img_next = new Image();\n\timg_next.src = \"$maj_url/images/{$_REQUEST['entry']}/album/$show_next\";\n</script>";}
+       //echo "\n\n<script>\n\tvar img_next = new Image();\n\timg_next.src = \"$maj_url/images/{$_REQUEST['entry']}/album/$show_next\";\n</script>";
+       echo "\n\n<script>\n\tvar img_next = new Image();\n\timg_next.src = \"images/{$_REQUEST['entry']}/album/$show_next\";\n</script>";
+}
 
 ?>
diff --git a/edit.php b/edit.php
index 028d32f..1c38457 100644
--- a/edit.php
+++ b/edit.php
@@ -578,6 +578,34 @@ a:active {
   }
 ?>
 
+<?php
+
+if (file_exists("images/{$_REQUEST['entry']}/album")) {
+
+       $count_album_images = count(glob("images/{$_REQUEST['entry']}/album/*"));
+      
+       if ($count_album_images < 1) {
+               rmdirr("images/{$_REQUEST['entry']}/album");
+       }
+       else {
+               if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
+                       echo "<tr><td><input type=\"checkbox\" name=\"auto_album\" checked>";
+               }
+               else {
+                       echo "<tr><td><input type=\"checkbox\" name=\"auto_album\">";
+               }
+      
+               if ($count_album_images > 1) {
+                       echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images images</a>).</td></tr>";
+               }
+               else {
+                       echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images image</a>).</td></tr>";
+               }
+       }
+}
+
+?>
+
 </table></p>
 
 <input type="hidden" name="entry" value="<?php
@@ -1159,6 +1187,20 @@ a:active {
               unlink($lastmod_sem);
           }
       }
+
+       if (isset($_POST['auto_album']) and !empty($_POST['auto_album']) and ($_POST['auto_album'] == "on")) {
+      
+               if (!file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
+                       touch("data/items/{$_REQUEST['entry']}/auto-album.txt");
+               }
+       }
+      
+       if (!isset($_POST['auto_album']) or empty($_POST['auto_album'])) {
+      
+               if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
+                       unlink("data/items/{$_REQUEST['entry']}/auto-album.txt");
+               }
+       }
       
       if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
           if (!file_exists("data/items/{$_REQUEST['entry']}/pdf")) {
diff --git a/index.php b/index.php
index 53e263f..9169f27 100644
--- a/index.php
+++ b/index.php
@@ -3005,7 +3005,7 @@ foreach ($maj_disp as $maj_d) {
                }
        }
 
-       if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album) and file_exists("images/$maj_d/album")) {
+       if (file_exists("images/$maj_d/album") and (file_exists("data/items/$maj_d/auto-album.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album)))) {
 
                echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
 
@@ -3144,6 +3144,7 @@ foreach ($maj_disp as $maj_d) {
                                                }
                                                echo "></a>";
                                        }
+                                       unset($maj_sort_album);
                                }
                        }
                }
diff --git a/rel.txt b/rel.txt
index 4d998e1..a2d124c 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-201010101010
+201011081123
 
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