This commit has been accessed 592 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>
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>