This commit has been accessed 637 times via Git panel.
commit f0af01aa38ff14385de35469036b0e111add6271
tree dd24240db4c96e1b5825afc3b180b82ff55c124f
parent c9ae728483994b6c17c78466117331aa63812c6e
author Psylocke Antonio <psylocke@majcms.org> 1326238884 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1326238884 +0800
Add RSS 0.91 and RSS 1.0 badge display toggles
diff --git a/core.php b/core.php
index a5055a2..dc65757 100644
--- a/core.php
+++ b/core.php
@@ -1677,15 +1677,23 @@ function maj_archives() {
function maj_badges() {
global $maj_count_latest;
-
+ global $maj_data_directory;
+
if ($maj_count_latest > 0) {
$php_version = phpversion();
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$php_version</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+
+ if (file_exists("$maj_data_directory/b-rss-0.91.txt")) {
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
+ }
+
+ if (file_exists("$maj_data_directory/b-rss-1.0.txt")) {
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+ }
+
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
}
diff --git a/settings.php b/settings.php
index f3c53e1..17adee3 100644
--- a/settings.php
+++ b/settings.php
@@ -329,6 +329,30 @@ if (!isset($_POST['round']) or empty($_POST['round'])) {
}
}
+if (isset($_POST['rss_0_91']) and !empty($_POST['rss_0_91']) and ($_POST['rss_0_91'] == "on") and !file_exists("data/b-rss-0.91.txt")) {
+ touch("data/b-rss-0.91.txt");
+}
+
+if (!isset($_POST['rss_0_91']) or empty($_POST['rss_0_91'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/b-rss-0.91.txt")) {
+ unlink("data/b-rss-0.91.txt");
+ }
+ }
+}
+
+if (isset($_POST['rss_1_0']) and !empty($_POST['rss_1_0']) and ($_POST['rss_1_0'] == "on") and !file_exists("data/b-rss-1.0.txt")) {
+ touch("data/b-rss-1.0.txt");
+}
+
+if (!isset($_POST['rss_1_0']) or empty($_POST['rss_1_0'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/b-rss-1.0.txt")) {
+ unlink("data/b-rss-1.0.txt");
+ }
+ }
+}
+
if (isset($_POST['center']) and !empty($_POST['center']) and ($_POST['center'] == "on") and !file_exists("data/center.txt")) {
touch("data/center.txt");
}
@@ -1306,7 +1330,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 = "17";
if (file_exists("data/email.txt")) {
$toggles_rowspan = $toggles_rowspan + 1;
@@ -1343,6 +1367,10 @@ a:active {
<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="rss_0_91" <?php if (file_exists("data/b-rss-0.91.txt")) { echo checked; } ?>> Display RSS 0.91 badge.</td></tr>
+<tr><td><input type="checkbox" name="rss_1_0" <?php if (file_exists("data/b-rss-0.91.txt")) { echo checked; } ?>> Display RSS 1.0 badge.</td></tr>
+
<tr><td><input type="checkbox" name="center" <?php if (file_exists("data/center.txt")) { echo checked; } ?>> Display <?php
if (file_exists("data/bb.txt")) {
tree dd24240db4c96e1b5825afc3b180b82ff55c124f
parent c9ae728483994b6c17c78466117331aa63812c6e
author Psylocke Antonio <psylocke@majcms.org> 1326238884 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1326238884 +0800
Add RSS 0.91 and RSS 1.0 badge display toggles
diff --git a/core.php b/core.php
index a5055a2..dc65757 100644
--- a/core.php
+++ b/core.php
@@ -1677,15 +1677,23 @@ function maj_archives() {
function maj_badges() {
global $maj_count_latest;
-
+ global $maj_data_directory;
+
if ($maj_count_latest > 0) {
$php_version = phpversion();
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://majcms.org/\"><span class=\"mbox1\">MAJ</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"http://php.net/\"><span class=\"mbox1\">PHP</span><span class=\"mbox2\">$php_version</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
- echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+
+ if (file_exists("$maj_data_directory/b-rss-0.91.txt")) {
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=0.91\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">0.91</span></a></nobr></div>";
+ }
+
+ if (file_exists("$maj_data_directory/b-rss-1.0.txt")) {
+ echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=1.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">1.0</span></a></nobr></div>";
+ }
+
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"rss.php?ver=2.0\"><span class=\"mbox1\">RSS</span><span class=\"mbox2\">2.0</span></a></nobr></div>";
echo "<div class=\"mbadge\"><nobr><a class=\"mblink\" target=\"_maj\" href=\"sitemap.php\"><span class=\"mbox1\">XML</span><span class=\"mbox2\">SITEMAP</span></a></nobr></div>";
}
diff --git a/settings.php b/settings.php
index f3c53e1..17adee3 100644
--- a/settings.php
+++ b/settings.php
@@ -329,6 +329,30 @@ if (!isset($_POST['round']) or empty($_POST['round'])) {
}
}
+if (isset($_POST['rss_0_91']) and !empty($_POST['rss_0_91']) and ($_POST['rss_0_91'] == "on") and !file_exists("data/b-rss-0.91.txt")) {
+ touch("data/b-rss-0.91.txt");
+}
+
+if (!isset($_POST['rss_0_91']) or empty($_POST['rss_0_91'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/b-rss-0.91.txt")) {
+ unlink("data/b-rss-0.91.txt");
+ }
+ }
+}
+
+if (isset($_POST['rss_1_0']) and !empty($_POST['rss_1_0']) and ($_POST['rss_1_0'] == "on") and !file_exists("data/b-rss-1.0.txt")) {
+ touch("data/b-rss-1.0.txt");
+}
+
+if (!isset($_POST['rss_1_0']) or empty($_POST['rss_1_0'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/b-rss-1.0.txt")) {
+ unlink("data/b-rss-1.0.txt");
+ }
+ }
+}
+
if (isset($_POST['center']) and !empty($_POST['center']) and ($_POST['center'] == "on") and !file_exists("data/center.txt")) {
touch("data/center.txt");
}
@@ -1306,7 +1330,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 = "17";
if (file_exists("data/email.txt")) {
$toggles_rowspan = $toggles_rowspan + 1;
@@ -1343,6 +1367,10 @@ a:active {
<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="rss_0_91" <?php if (file_exists("data/b-rss-0.91.txt")) { echo checked; } ?>> Display RSS 0.91 badge.</td></tr>
+<tr><td><input type="checkbox" name="rss_1_0" <?php if (file_exists("data/b-rss-0.91.txt")) { echo checked; } ?>> Display RSS 1.0 badge.</td></tr>
+
<tr><td><input type="checkbox" name="center" <?php if (file_exists("data/center.txt")) { echo checked; } ?>> Display <?php
if (file_exists("data/bb.txt")) {