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

commit 6d5ad0f90542989234c6baddfb696e6d1556d299
tree 649dfbe553a8a2267549d1422c77db2a8e56a5d6
parent b295f19209dde018078fc35394a8745284423521
author Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800

    Add blur distance option for global box-shadow

diff --git a/css.php b/css.php
index d3ffd87..c287705 100644
--- a/css.php
+++ b/css.php
@@ -42,6 +42,13 @@ else {
        $maj_border_radius = "5px";
 }
 
+if (file_exists("data/shadow.txt")) {
+       $maj_blur_distance = file_get_contents("data/shadow.txt") . "px";
+}
+else {
+       $maj_blur_distance = "2px";
+}
+
 ?>
 
 <style>
@@ -229,10 +236,10 @@ a.status:link,a.status:visited,a.status:active,a.status:hover {
        }
       
        if (file_exists("data/shadow.txt")) {
-               echo "\n\t-moz-box-shadow: 0 0 2px #ddd;";
-               echo "\n\t-webkit-box-shadow: 0 0 2px #ddd;";
-               echo "\n\t-khtml-box-shadow: 0 0 2px #ddd;";
-               echo "\n\tbox-shadow: 0 0 2px #ddd;";
+               echo "\n\t-moz-box-shadow: 0 0 $maj_blur_distance #ddd;";
+               echo "\n\t-webkit-box-shadow: 0 0 $maj_blur_distance #ddd;";
+               echo "\n\t-khtml-box-shadow: 0 0 $maj_blur_distance #ddd;";
+               echo "\n\tbox-shadow: 0 0 $maj_blur_distance #ddd;";
        }
       
        ?>
diff --git a/settings.php b/settings.php
index 743e384..60b9250 100644
--- a/settings.php
+++ b/settings.php
@@ -269,8 +269,26 @@ if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
        }
 }
 
-if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on") and !file_exists("data/shadow.txt")) {
-       touch("data/shadow.txt");
+if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on")) {
+
+       if (!file_exists("data/shadow.txt")) {
+               $fp_shadow_txt = fopen("data/shadow.txt","w");
+               fwrite($fp_shadow_txt,"2");
+               fclose($fp_shadow_txt);
+       }
+      
+       if (isset($_POST['blur']) and is_numeric($_POST['blur']) and (file_get_contents("data/shadow.txt") != $_POST['blur'])) {
+      
+               if ($_POST['blur'] > 0) {
+                       $shadow_write_content = number_format($_POST['blur'],0,'.','');
+                       $fp_shadow_txt = fopen("data/shadow.txt","w");
+                       fwrite($fp_shadow_txt,$shadow_write_content);
+                       fclose($fp_shadow_txt);
+               }
+               else {
+                       unlink("data/shadow.txt");
+               }
+       }
 }
 
 if (!isset($_POST['shadow']) or empty($_POST['shadow'])) {
@@ -1246,6 +1264,12 @@ else {
 
 <tr><td><input type="checkbox" name="round" <?php if (file_exists("data/round.txt")) { echo checked; } ?>> Display rounded corners on progressive browsers.</td></tr>
 
+<?php if (file_exists("data/shadow.txt")) { ?>
+
+<tr><td>shadow blur distance</td><td><input autocomplete="off" class="input" type="text" name="blur" value="<?php readfile('data/shadow.txt'); ?>" maxlength="2"></td></tr>
+
+<?php } ?>
+
 <?php if (file_exists("data/round.txt")) { ?>
 
 <tr><td>panel border radius</td><td><input autocomplete="off" class="input" type="text" name="radius" value="<?php readfile('data/round.txt'); ?>" maxlength="2"></td></tr>
 
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
32980 downloads
MAJ 1.0
26 files
13132 downloads
MAJ 0.14
45 files
35010 downloads