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 1539 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")) {
 
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
33087 downloads
MAJ 1.0
26 files
13170 downloads
MAJ 0.14
45 files
35071 downloads