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

commit d7adfb7e10d7ebffcdcd53250fc22e79bcaa3317
tree bbddb1fe8238c465639bcb2ec2b8fa78af430d7b
parent 56b47f1febf599f172a02c6e3a0af88347ce9b78
author Psylocke Antonio <psylocke@majcms.org> 1309773671 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1309773671 +0800

    Add Facebook support toggle in settings.php

diff --git a/edit.php b/edit.php
index ab7087c..a8af112 100644
--- a/edit.php
+++ b/edit.php
@@ -617,15 +617,18 @@ else {
       }
 ?>>Display last modification date and time.</td></tr>
 
-  <tr><td><input type="checkbox" name="fb" <?php
-      $lastmod_sem = "data/items/{$_REQUEST['entry']}/fb.txt";
-      if (file_exists($lastmod_sem)) {
-          echo checked;
-      }
-?>>Enable Facebook support.</td></tr>
+<?php
 
+if (file_exists("data/fb.txt")) {
 
-<?php
+       echo "<tr><td><input type=\"checkbox\" name=\"fb\"";
+
+       if (file_exists("data/items/{$_REQUEST['entry']}/fb.txt")) {
+               echo checked;
+       }
+      
+       echo ">Enable Facebook support.</td></tr>";
+}
 
 if (file_exists("images/{$_REQUEST['entry']}/album")) {
 
diff --git a/settings.php b/settings.php
index 93ef550..882d57b 100644
--- a/settings.php
+++ b/settings.php
@@ -365,6 +365,18 @@ if (!isset($_POST['old']) or empty($_POST['old'])) {
        }
 }
 
+if (isset($_POST['fb']) and !empty($_POST['fb']) and ($_POST['fb'] == "on") and !file_exists("data/fb.txt")) {
+       touch("data/fb.txt");
+}
+
+if (!isset($_POST['fb']) or empty($_POST['fb'])) {
+       if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+               if (file_exists("data/fb.txt")) {
+                       unlink("data/fb.txt");
+               }
+       }
+}
+
 if (isset($_POST['wiki']) and !empty($_POST['wiki']) and ($_POST['wiki'] == "on") and !file_exists("data/wiki.txt")) {
        touch("data/wiki.txt");
 }
@@ -1422,6 +1434,8 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
 
 <?php if (!file_exists("data/lite.txt")) { ?>
 
+<tr><td>facebook</td><td><input type="checkbox" name="fb" <?php if (file_exists("data/fb.txt")) { echo checked; } ?>> Enable Facebook support.</td></tr>
+
 <tr><td>wiki</td><td><input type="checkbox" name="wiki" <?php if (file_exists("data/wiki.txt")) { echo checked; } ?>> Enable wiki-style editing.</td></tr>
 
 <tr><td>profanity filter</td><td><input type="checkbox" name="pf" <?php if (file_exists("data/pf.txt")) { echo checked; } ?>> Enable profanity filter.</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
33012 downloads
MAJ 1.0
26 files
13144 downloads
MAJ 0.14
45 files
35026 downloads