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

commit de52cd33b5ff4a0fedb254c5fbb9f266a856abb4
tree 4cf16d120f48d7d669a0010e8aae12ce6875f42a
parent 776cc2216c44240b4885a0480c1c77d0c408518f
author Engels Antonio <engels@majcms.org> 1277314187 +0800
committer Engels Antonio <engels@majcms.org> 1277314187 +0800

    maj-0.14-20061031.zip

diff --git a/add.php b/add.php
index 65608b5..726a394 100644
--- a/add.php
+++ b/add.php
@@ -371,33 +371,56 @@ if (!file_exists("images")) {
 $image_dir = 'images/' . $entry;
 $file_dir = $item_dir . '/filedrop';
 
-function reformat_html($defang)
-{
-   $store=split("<html>",$defang);
-   $defang="";
-   $defang.=$store[0];
-   foreach($store as $itm=>$refh)
-   {
-       if(eregi("</html>",$refh))
-       {
-           $store1=split("</html>",$refh);
-           $store1[0]=eregi_replace("\n","",$store1[0]);
-           foreach($store1 as $itm1=>$refh1)
-           {
-               if($itm1==0)
-                   $refh1="<!-- html -->$refh1<!-- /html -->";
-               $defang.=$refh1;
-           }
-       }      
-   }
-   return $defang;
+function reformat_html($defang_html) {
+       $store_html=split("<html>",$defang_html);
+       $defang_html="";
+       $defang_html.=$store_html[0];
+       foreach($store_html as $itm_html=>$refh_html) {
+               if(eregi("</html>",$refh_html)) {
+                       $store_html1=split("</html>",$refh_html);
+                       $store_html1[0]=eregi_replace("\n","",$store_html1[0]);
+                       foreach($store_html1 as $itm_html1=>$refh_html1) {
+                               if($itm_html1==0)
+                                       $refh_html1="<!-- html -->$refh_html1<!-- /html -->";
+                                       $defang_html.=$refh_html1;
+                               }
+                       }
+               }
+       return $defang_html;
+}
+
+function reformat_code($defang_code) {
+       $store_code=split("<code>",$defang_code);
+       $defang_code="";
+       $defang_code.=$store_code[0];
+       foreach($store_code as $itm_code=>$refh_code) {
+               if(eregi("</code>",$refh_code)) {
+                       $store_code1=split("</code>",$refh_code);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/crying.png border=0>',':((',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/frown.png border=0>',':(',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/indifferent.png border=0>',':|',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/laughing.png border=0>',':D',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/lick.png border=0>',':P',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/ohno.png border=0>',':O',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/smile.png border=0>',':)',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/surprised.png border=0>','=)',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/undecided.png border=0>',':\\',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/wink.png border=0>',';)',$store_code1[0]);
+                       $store_code1[0]=htmlentities($store_code1[0],ENT_NOQUOTES);
+                       foreach($store_code1 as $itm_code1=>$refh_code1) {
+                               if($itm_code1==0)
+                                       $refh_code1="<code>$refh_code1</code>";
+                                       $defang_code.=$refh_code1;
+                               }
+                       }
+               }
+       return $defang_code;
 }
 
 $body_write_content = ucfirst($_REQUEST['body_input']);
 $body_write_content = str_replace("[html]", '<html>', $body_write_content);
 $body_write_content = str_replace("[/html]", '</html>', $body_write_content);
 $body_write_content = reformat_html($body_write_content);
-$body_write_content = str_replace("\n", '<br />', $body_write_content);
 $body_write_content = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $body_write_content);
 $body_write_content = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $body_write_content);
 $body_write_content = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $body_write_content);
@@ -408,6 +431,10 @@ $body_write_content = str_replace(':)', '<img src=images/smileys/smile.png borde
 $body_write_content = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $body_write_content);
 $body_write_content = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $body_write_content);
 $body_write_content = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $body_write_content);
+$body_write_content = str_replace('[code]', '<code>', $body_write_content);
+$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
+$body_write_content = reformat_code($body_write_content);
+$body_write_content = str_replace("\n", '<br />', $body_write_content);
 $body_write_content = str_replace('[b]', '<b>', $body_write_content);
 $body_write_content = str_replace('[/b]', '</b>', $body_write_content);
 $body_write_content = str_replace('[i]', '<i>', $body_write_content);
@@ -420,16 +447,17 @@ $body_write_content = str_replace('[sup]', '<sup>', $body_write_content);
 $body_write_content = str_replace('[/sup]', '</sup>', $body_write_content);
 $body_write_content = str_replace('[sub]', '<sub>', $body_write_content);
 $body_write_content = str_replace('[/sub]', '</sub>', $body_write_content);
-$body_write_content = str_replace('[code]', '<code>', $body_write_content);
-$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
 $body_write_content = str_replace('[highlight]', '<highlight>', $body_write_content);
 $body_write_content = str_replace('[/highlight]', '</highlight>', $body_write_content);
 $body_write_content = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $body_write_content);
 $body_write_content = str_replace('</highlight>', '</span>', $body_write_content);
+$body_write_content =  preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.0-9a-z-]+)>/", '&lt;$1@$2.$3&gt;',$body_write_content);
 
 mkdir($item_dir);
 
 $title_write_content = ucfirst($_REQUEST['title_input']);
+$title_write_content = str_replace('<','&lt;',$title_write_content);
+$title_write_content = str_replace('>','&gt;',$title_write_content);
 $title_file = $item_dir . '/title.txt';
 $fp_title_txt = fopen($title_file,"w");
 fwrite($fp_title_txt,$title_write_content);
diff --git a/dig.php b/dig.php
index 42758a8..38f5b64 100644
--- a/dig.php
+++ b/dig.php
@@ -163,7 +163,7 @@ if (($count_search_items > 0) and ($count_total_items > 0)) {
                echo "</p>";
                $increment_search_entries = $increment_search_entries + 1;
        }
-echo "<p>Click <a href=http://google.com/search?q=$google rel=nofollow target=_maj>here</a> to search for <b>$search</b> with Google.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
+echo "<p>Click <a href=http://google.com/search?q=$google target=_maj>here</a> to search for <b>$search</b> with Google.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
 }
 else {
        echo "<p>Search string not found in $count_total_items ";
@@ -173,7 +173,7 @@ else {
        if ($count_total_items > 1) {
                echo "entries";
        }
-       echo ".<br>Click <a href=http://google.com/search?q=$google rel=nofollow target=_maj>here</a> to search for <b>$search</b> with Google.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
+       echo ".<br>Click <a href=http://google.com/search?q=$google target=_maj>here</a> to search for <b>$search</b> with Google.<br>Click <a href=index.php>here</a> to go to the index page.</p>";
 }
 
 ?>
diff --git a/edit.php b/edit.php
index d562ef3..9255d35 100644
--- a/edit.php
+++ b/edit.php
@@ -159,7 +159,7 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
 
        $comment_txt = ucfirst($_REQUEST['comment_txt']);
        $comment_txt = htmlentities($comment_txt, ENT_NOQUOTES);
-       // $comment_txt = str_replace('href=', 'rel=nofollow target=_blank href=', $comment_txt);
+       // $comment_txt = str_replace('href=', 'target=_maj href=', $comment_txt);
        $comment_txt = str_replace("\n", '<br />', $comment_txt);
        $comment_txt = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $comment_txt);
        $comment_txt = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $comment_txt);
@@ -415,37 +415,62 @@ if (!isset($_REQUEST['title_input']) or !isset($_REQUEST['body_input']) or empty
 }
 
 $title_write_content = ucfirst($_REQUEST['title_input']);
+$title_write_content = str_replace('<','&lt;',$title_write_content);
+$title_write_content = str_replace('>','&gt;',$title_write_content);
 $open_title_file = fopen($title_file,"w");
 fwrite($open_title_file,$title_write_content);
 fclose($open_title_file);
 
-function reformat_html($defang)
-{
-   $store=split("<html>",$defang);
-   $defang="";
-   $defang.=$store[0];
-   foreach($store as $itm=>$refh)
-   {
-       if(eregi("</html>",$refh))
-       {
-           $store1=split("</html>",$refh);
-           $store1[0]=eregi_replace("\n","",$store1[0]);
-           foreach($store1 as $itm1=>$refh1)
-           {
-               if($itm1==0)
-                   $refh1="<!-- html -->$refh1<!-- /html -->";
-               $defang.=$refh1;
-           }
-       }      
-   }
-   return $defang;
+function reformat_html($defang_html) {
+       $store_html=split("<html>",$defang_html);
+       $defang_html="";
+       $defang_html.=$store_html[0];
+       foreach($store_html as $itm_html=>$refh_html) {
+               if(eregi("</html>",$refh_html)) {
+                       $store_html1=split("</html>",$refh_html);
+                       $store_html1[0]=eregi_replace("\n","",$store_html1[0]);
+                       foreach($store_html1 as $itm_html1=>$refh_html1) {
+                               if($itm_html1==0)
+                                       $refh_html1="<!-- html -->$refh_html1<!-- /html -->";
+                                       $defang_html.=$refh_html1;
+                               }
+                       }
+               }
+       return $defang_html;
+}
+
+function reformat_code($defang_code) {
+       $store_code=split("<code>",$defang_code);
+       $defang_code="";
+       $defang_code.=$store_code[0];
+       foreach($store_code as $itm_code=>$refh_code) {
+               if(eregi("</code>",$refh_code)) {
+                       $store_code1=split("</code>",$refh_code);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/crying.png border=0>',':((',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/frown.png border=0>',':(',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/indifferent.png border=0>',':|',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/laughing.png border=0>',':D',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/lick.png border=0>',':P',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/ohno.png border=0>',':O',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/smile.png border=0>',':)',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/surprised.png border=0>','=)',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/undecided.png border=0>',':\\',$store_code1[0]);
+                       $store_code1[0] = eregi_replace('<img src=images/smileys/wink.png border=0>',';)',$store_code1[0]);
+                       $store_code1[0]=htmlentities($store_code1[0],ENT_NOQUOTES);
+                       foreach($store_code1 as $itm_code1=>$refh_code1) {
+                               if($itm_code1==0)
+                                       $refh_code1="<code>$refh_code1</code>";
+                                       $defang_code.=$refh_code1;
+                               }
+                       }
+               }
+       return $defang_code;
 }
 
 $body_write_content = ucfirst($_REQUEST['body_input']);
 $body_write_content = str_replace("[html]", '<html>', $body_write_content);
 $body_write_content = str_replace("[/html]", '</html>', $body_write_content);
 $body_write_content = reformat_html($body_write_content);
-$body_write_content = str_replace("\n", '<br />', $body_write_content);
 $body_write_content = str_replace(':((', '<img src=images/smileys/crying.png border=0>', $body_write_content);
 $body_write_content = str_replace(':(', '<img src=images/smileys/frown.png border=0>', $body_write_content);
 $body_write_content = str_replace(':|', '<img src=images/smileys/indifferent.png border=0>', $body_write_content);
@@ -456,6 +481,10 @@ $body_write_content = str_replace(':)', '<img src=images/smileys/smile.png borde
 $body_write_content = str_replace('=)', '<img src=images/smileys/surprised.png border=0>', $body_write_content);
 $body_write_content = str_replace(':\\', '<img src=images/smileys/undecided.png border=0>', $body_write_content);
 $body_write_content = str_replace(';)', '<img src=images/smileys/wink.png border=0>', $body_write_content);
+$body_write_content = str_replace('[code]', '<code>', $body_write_content);
+$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
+$body_write_content = reformat_code($body_write_content);
+$body_write_content = str_replace("\n", '<br />', $body_write_content);
 $body_write_content = str_replace('[b]', '<b>', $body_write_content);
 $body_write_content = str_replace('[/b]', '</b>', $body_write_content);
 $body_write_content = str_replace('[i]', '<i>', $body_write_content);
@@ -468,12 +497,11 @@ $body_write_content = str_replace('[sup]', '<sup>', $body_write_content);
 $body_write_content = str_replace('[/sup]', '</sup>', $body_write_content);
 $body_write_content = str_replace('[sub]', '<sub>', $body_write_content);
 $body_write_content = str_replace('[/sub]', '</sub>', $body_write_content);
-$body_write_content = str_replace('[code]', '<code>', $body_write_content);
-$body_write_content = str_replace('[/code]', '</code>', $body_write_content);
 $body_write_content = str_replace('[highlight]', '<highlight>', $body_write_content);
 $body_write_content = str_replace('[/highlight]', '</highlight>', $body_write_content);
 $body_write_content = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $body_write_content);
 $body_write_content = str_replace('</highlight>', '</span>', $body_write_content);
+$body_write_content =  preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.0-9a-z-]+)>/", '&lt;$1@$2.$3&gt;',$body_write_content);
 
 $fp_revisions_file = fopen($revisions_file, "r");
 $revisions_count = fread($fp_revisions_file, filesize($revisions_file));
diff --git a/index.php b/index.php
index e8a3390..f9c4d20 100644
--- a/index.php
+++ b/index.php
@@ -29,7 +29,7 @@ else {
 $default_blog_title = "My Activity Journal";
 $default_username = "maj";
 $default_password = "php";
-$default_blog_profile = "This cool site is powered by <a href=http://engels.mortega.net/index.php?entry=20050521000019 target=_blank>My Activity Journal</a>, a dead-simple, <a href=http://php.net/ target=_blank>PHP</a>-based, <a href=http://www.opensource.org/licenses/gpl-license.php target=_blank>GPL</a>'ed blog written from scratch as a spare time family project by <a href=http://engels.mortega.net/ target=_blank>Engels</a>, <a href=http://gaffud.com/ target=_blank>Magie</a>, and <a href=http://psylocke.org/ target=_blank>Psylocke</a> Antonio.";
+$default_blog_profile = "This cool site is powered by <a href=http://engels.mortega.net/index.php?entry=20050521000019 target=_maj>My Activity Journal</a>, a dead-simple, <a href=http://php.net/ target=_maj>PHP</a>-based, <a href=http://www.opensource.org/licenses/gpl-license.php target=_maj>GPL</a>'ed blog written from scratch as a spare time family project by <a href=http://engels.mortega.net/ target=_maj>Engels</a>, <a href=http://gaffud.com/ target=_maj>Magie</a>, and <a href=http://psylocke.org/ target=_maj>Psylocke</a> Antonio.";
 $default_blog_author = "My Activity Journal";
 
 if (!file_exists("data")) {
@@ -274,7 +274,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
 
                $body_content = ucfirst($_REQUEST['new_comment']);
                $body_content = htmlentities($body_content, ENT_NOQUOTES);
-               // $body_content = str_replace('href=', 'rel=nofollow target=_blank href=', $body_content);
+               // $body_content = str_replace('href=', 'target=_maj href=', $body_content);
                $body_content = str_replace("\n", '<br />', $body_content);
                $body_content = trim($body_content);
 
@@ -732,6 +732,10 @@ else {
        font-family: verdana,helvetica,sans-serif;
        font-size: 11px;
 }
+#panel_free {
+       padding: 0px 5px 0px 5px;
+       margin: 10px 0px 0px 0px;
+}
 </style>
 
 <link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
@@ -884,6 +888,10 @@ if (file_exists("data/panels")) {
                                continue;
                        }
 
+                       if (file_exists("data/panels/$entry_panel_list/right.txt")) {
+                               continue;
+                       }
+
                        if ($entry_panel_list != "." && $entry_panel_list != ".." && fnmatch("*", $entry_panel_list)) {
                                $show_panel_list[] = $entry_panel_list;
                        }
@@ -897,9 +905,18 @@ if (file_exists("data/panels")) {
       
        if ($count_panel_list > 0) {
                foreach ($show_panel_list as $panel_list_entry) {
-                       echo '<div id=panel_title>';
-                       readfile("data/panels/$panel_list_entry/title.txt");
-                       echo '</div><div id=panel_body>';
+                       if (!file_exists("data/panels/$panel_list_entry/free.txt")) {
+                               echo '<div id=panel_title>';
+                               readfile("data/panels/$panel_list_entry/title.txt");
+                               if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+                                       echo "<a href=panels.php#{$panel_list_entry}>";
+                                       echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+                               }
+                               echo '</div><div id=panel_body>';
+                       }
+                       if (file_exists("data/panels/$panel_list_entry/free.txt")) {
+                               echo '<div id=panel_free>';
+                       }
                        include("data/panels/$panel_list_entry/panel.php");
                        echo '</div>';
                }
@@ -1376,15 +1393,15 @@ else {
                                                        imagejpeg($work_thumb, "images/$d/thumbnails/{$album_entry}-thumbnail.jpg", 80);
       
                                                }
-                                               echo "<a href=images/$d/album/$album_entry>";
+                                               echo "<a href=\"images/$d/album/$album_entry\">";
 
                                                /* auto-thumbnails (20060519) - Just in case php-gd does not exist, do it the old way. */
 
                                                if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
-                                                       echo "<img src=images/$d/album/$album_entry width=$new_width height=$new_height border=0 hspace=2 vspace=2";
+                                                       echo "<img src=\"images/$d/album/$album_entry\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
                                                }
                                                else {
-                                                       echo "<img src=images/$d/thumbnails/{$album_entry}-thumbnail.jpg width=$new_width height=$new_height border=0 hspace=2 vspace=2";
+                                                       echo "<img src=\"images/$d/thumbnails/{$album_entry}-thumbnail.jpg\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
                                                }
 
                                                if (file_exists("data/items/$d/album/captions/{$album_entry}.txt")) {
@@ -1424,10 +1441,18 @@ else {
                                                echo '<img src=images/filedrop.png width=36 height=36 border=0 alt="download file"></a></td>';
                                                echo '<td><p><b>';
                                                echo $dl_file;
-                                               echo'</b><br>';
+                                               echo'</b>';
+                                               if (file_exists("data/items/$d/filedrop/sha1.txt")) {
+                                                       $sha1 = sha1_file("data/items/$d/filedrop/files/$dl_file");
+                                                       echo "<br />$sha1 (<a href=http://www.faqs.org/rfcs/rfc3174 target=_maj>sha1</a>)";
+                                               }
+                                               if (file_exists("data/items/$d/filedrop/md5.txt")) {
+                                                       $md5 = md5_file("data/items/$d/filedrop/files/$dl_file");
+                                                       echo "<br />$md5 (<a href=http://www.faqs.org/rfcs/rfc1321 target=_maj>md5</a>)";
+                                               }
                                                $size = filesize("data/items/$d/filedrop/files/$dl_file");
                                                $size_string = ($size > 512)?(  ($size/1024 > 512)  ?sprintf("%.02f MB",($size/1024)/1024)  :sprintf("%.02f KB",$size/1024))  :sprintf("%d B",$size);
-                                               echo $size_string;
+                                               echo "<br />$size_string";
                                                $filedrop_count_file = "data/items/$d/filedrop/count/$dl_file" . '.txt';
                                                if (file_exists($filedrop_count_file)) {
                                                        $fp_filedrop_count = fopen($filedrop_count_file, "r");
@@ -1521,7 +1546,7 @@ else {
                                echo '<div id=panel_title>';
       
                                if (file_exists("$dir/$d/comments/live/$comment/url.txt")) {
-                                       echo '<a rel=nofollow target=_blank href=';
+                                       echo '<a target=_maj href=';
                                        readfile("$dir/$d/comments/live/$comment/url.txt");
                                        echo '>';
                                }
@@ -1584,7 +1609,7 @@ if (!file_exists("data/nocomment.txt")) {
                                echo "sent";
                        }
 
-                       echo ' to me first.</p>';
+                       echo ' to me first. Comments with bogus contact information will be discarded.</p>';
       
                        ?>
                       
@@ -1660,7 +1685,7 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
                        echo '<div id=panel_title>';
 
                        if (file_exists("$dir/$d/comments/pending/$pending_comment/url.txt")) {
-                               echo '<a rel=nofollow target=_blank href=';
+                               echo '<a target=_maj href=';
                                readfile("$dir/$d/comments/pending/$pending_comment/url.txt");
                                echo '>';
                        }
@@ -2036,15 +2061,60 @@ if (file_exists("data/adsense.php")) {
 ?>
 
 <?php
+if (file_exists("data/panels")) {
+       if ($dh_right_panel_list = opendir("data/panels")) {
+               while (($entry_right_panel_list = readdir($dh_right_panel_list)) !== false) {
+
+                       if (file_exists("data/panels/$entry_right_panel_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+                               continue;
+                       }
+
+                       if (!file_exists("data/panels/$entry_right_panel_list/right.txt")) {
+                               continue;
+                       }
+
+                       if ($entry_right_panel_list != "." && $entry_right_panel_list != ".." && fnmatch("*", $entry_right_panel_list)) {
+                               $show_right_panel_list[] = $entry_right_panel_list;
+                       }
+               }
+               closedir($dh_right_panel_list);
+       }
+
+       sort($show_right_panel_list);
+       reset($show_right_panel_list);
+       $count_right_panel_list = count($show_right_panel_list);
+      
+       if ($count_right_panel_list > 0) {
+               foreach ($show_right_panel_list as $right_panel_list_entry) {
+                       if (!file_exists("data/panels/$right_panel_list_entry/free.txt")) {
+                               echo '<div id=panel_title>';
+                               readfile("data/panels/$right_panel_list_entry/title.txt");
+                               if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
+                                       echo "<a href=panels.php#{$right_panel_list_entry}>";
+                                       echo '<img src=images/widget.edit.png border=0 width=11 height=11 align=right></a>';
+                               }
+                               echo '</div><div id=panel_body>';
+                       }
+                       if (file_exists("data/panels/$right_panel_list_entry/free.txt")) {
+                               echo '<div id=panel_free>';
+                       }
+                       include("data/panels/$right_panel_list_entry/panel.php");
+                       echo '</div>';
+               }
+       }
+}
+?>
+
+<?php
 
 if ($count_latest_items > 0) {
        echo '<p><table border=0 cellspacing=2 cellpadding=0 width=100%>';
        echo '<tr><td align=center><a target="_button" href="http://engels.mortega.net/index.php?entry=20050521000019"><img src=images/button.maj.png border=0 width=80 height=15></a></td></tr>';
-       echo '<tr><td align=center><a target="_button" rel="nofollow" href="http://php.net/"><img src=images/button.php.png border=0 width=80 height=15></a></td></tr>';
+       echo '<tr><td align=center><a target="_button" href="http://php.net/"><img src=images/button.php.png border=0 width=80 height=15></a></td></tr>';
        $validate_uri = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
        $validate_uri = str_replace('//', '/', $validate_uri);
        $validate_uri = "http://" . $validate_uri;
-       echo '<tr><td align=center><a target="_button" rel="nofollow" href="http://jigsaw.w3.org/css-validator/validator?uri=' . $validate_uri . '"><img src=images/button.w3c.css.png border=0 width=80 height=15></a></td></tr>';
+       echo '<tr><td align=center><a target="_button" href="http://jigsaw.w3.org/css-validator/validator?uri=' . $validate_uri . '"><img src=images/button.w3c.css.png border=0 width=80 height=15></a></td></tr>';
        echo '<tr><td align=center><a target="_button" href="rss.php?ver=0.91"><img src=images/button.rss-0.91.png border=0 width=80 height=15></a></td></tr>';
        echo '<tr><td align=center><a target="_button" href="rss.php?ver=1.0"><img src=images/button.rss-1.0.png border=0 width=80 height=15></a></td></tr>';
        echo '<tr><td align=center><a target="_button" href="rss.php?ver=2.0"><img src=images/button.rss-2.0.png border=0 width=80 height=15></a></td></tr>';
@@ -2053,7 +2123,7 @@ if ($count_latest_items > 0) {
                $fp_sfx = fopen("data/sfx.txt", "r");
                $sfx = fread($fp_sfx, filesize("data/sfx.txt"));
                fclose($fp_sfx);
-               echo '<tr><td align=center><a target="_button" rel="nofollow" href="http://www.spreadfirefox.com/?q=affiliates&amp;id=' . $sfx . '&amp;t=85"><img src=images/button.firefox.png border=0 width=80 height=15></a></td></tr>';
+               echo '<tr><td align=center><a target="_button" href="http://www.spreadfirefox.com/?q=affiliates&amp;id=' . $sfx . '&amp;t=85"><img src=images/button.firefox.png border=0 width=80 height=15></a></td></tr>';
        }
        echo '</table></p>';
 
diff --git a/panels.php b/panels.php
index 8f5014f..2fbc6b5 100644
--- a/panels.php
+++ b/panels.php
@@ -76,6 +76,30 @@ if (isset($_REQUEST['panel_hide']) and !empty($_REQUEST['panel_hide']) and ($_RE
        }
 }
 
+if ((!isset($_REQUEST['panel_free']) or !empty($_REQUEST['panel_free'])) and ($_REQUEST['panel_edit'] == "on")) {
+       if (file_exists("data/panels/{$_REQUEST['panel_id']}/free.txt")) {
+               unlink("data/panels/{$_REQUEST['panel_id']}/free.txt");
+       }
+}
+
+if (isset($_REQUEST['panel_free']) and !empty($_REQUEST['panel_free']) and ($_REQUEST['panel_free'] == "on")) {
+       if (!file_exists("data/panels/{$_REQUEST['panel_id']}/free.txt")) {
+               touch("data/panels/{$_REQUEST['panel_id']}/free.txt");
+       }
+}
+
+if ((!isset($_REQUEST['panel_right']) or !empty($_REQUEST['panel_right'])) and ($_REQUEST['panel_edit'] == "on")) {
+       if (file_exists("data/panels/{$_REQUEST['panel_id']}/right.txt")) {
+               unlink("data/panels/{$_REQUEST['panel_id']}/right.txt");
+       }
+}
+
+if (isset($_REQUEST['panel_right']) and !empty($_REQUEST['panel_right']) and ($_REQUEST['panel_right'] == "on")) {
+       if (!file_exists("data/panels/{$_REQUEST['panel_id']}/right.txt")) {
+               touch("data/panels/{$_REQUEST['panel_id']}/right.txt");
+       }
+}
+
 if (isset($_REQUEST['panel_title']) and !empty($_REQUEST['panel_title'])) {
 
        $panel_title = ucfirst(strip_tags(trim($_REQUEST['panel_title'])));
@@ -180,15 +204,25 @@ a:active {
                                echo '<form enctype="multipart/form-data" action="';
                                echo $_SERVER['PHP_SELF'];
                                echo '" method="post">';
-                               echo "<tr><td><p><b>";
+                               echo "<tr><td><p><b><a name=\"";
+                               echo strtolower(str_replace("_", " ", $panel));
+                               echo "\">";
                                echo strtolower(str_replace("_", " ", $panel));
-                               echo '</b></p></td><td><p><input type=text class=input name=panel_title value="';
+                               echo '</a></b></p></td><td><p><input type=text class=input name=panel_title value="';
                                readfile("data/panels/$panel/title.txt");
                                echo '" autocomplete=off maxlength=90></p></td></tr><tr><td valign=top><p><input type=checkbox name=panel_hide';
                                if (file_exists("data/panels/$panel/private.txt")) {
                                        echo " checked";
                                }
-                               echo '> hide<br><input type=checkbox name=panel_del> delete&nbsp;</p></td><td><textarea class=input name=panel_content rows=10>';
+                               echo '> hide<br><input type=checkbox name=panel_free';
+                               if (file_exists("data/panels/$panel/free.txt")) {
+                                       echo " checked";
+                               }
+                               echo '> free<br><input type=checkbox name=panel_right';
+                               if (file_exists("data/panels/$panel/right.txt")) {
+                                       echo " checked";
+                               }
+                               echo '> right<br><input type=checkbox name=panel_del> delete&nbsp;</p></td><td><textarea class=input name=panel_content rows=10>';
                                readfile("data/panels/$panel/panel.php");
                                echo "</textarea></td></tr><tr><td></td><td><input type=hidden name=panel_id value=$panel><input type=hidden name=panel_edit value=on><input type=submit class=input value=submit></p></td>";
                                echo "</tr><tr><td></td><td><p>&nbsp;</p></td></tr></form>";
diff --git a/settings.php b/settings.php
index e6544b9..d094484 100644
--- a/settings.php
+++ b/settings.php
@@ -462,7 +462,7 @@ a:active {
 <tr><td><p>author*</p></td><td><input autocomplete=off class=input type=text name=author value="<?php readfile("data/author.txt"); ?>"></td></tr>
 <tr><td><p>e-mail address*</p></td><td><input autocomplete=off class=input type=text name=email <?php if (file_exists("data/email.txt")) { echo 'value="'; readfile("data/email.txt"); } ?>"></td></tr>
 <tr><td><p>username*</p></td><td><input autocomplete=off class=input type=text name=username value="<?php readfile("data/username.txt"); ?>"></td></tr>
-<tr><td><p>entries per page*</p></td><td><input autocomplete=off class=input type=text name=increase value="<?php readfile("data/increase.txt"); ?>"></td></tr>
+<tr><td><p>entries per page</p></td><td><input autocomplete=off class=input type=text name=increase value="<?php readfile("data/increase.txt"); ?>"></td></tr>
 <tr><td><p>timezone offset in seconds</p></td><td><input autocomplete=off class=input type=text name=offset value="<?php readfile("data/offset.txt"); ?>"></td></tr>
 <tr><td><p>spread firefox <a href="http://www.spreadfirefox.com/?q=user/register&r=76458" target=_maj>affiliate</a> id</p></td><td><input autocomplete=off class=input type=text name=sfx value="<?php readfile("data/sfx.txt"); ?>"></td></tr>
 <tr><td><p>ping on content change</p></td><td><input autocomplete=off class=input type=text name=ping value="<?php readfile("data/ping.txt"); ?>"></td></tr>
@@ -586,7 +586,7 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
        }
 }
 ?>
-<tr><td><p>upload <a href=http://www.chami.com/html-kit/services/favicon/ rel=nofollow target=_maj>favicon.ico</a></p></td><td><input autocomplete=off type=file name=favicon></td></tr>
+<tr><td><p>upload <a href=http://www.chami.com/html-kit/services/favicon/ target=_maj>favicon.ico</a></p></td><td><input autocomplete=off type=file name=favicon></td></tr>
 <tr><td><p>upload profile picture</p></td><td><input autocomplete=off type=file name=picture></td></tr>
 <tr><td><p>upload background image</p></td><td><input autocomplete=off type=file name=background></td></tr>
 <tr><td><p>profile*</p></td><td><textarea class=input name=profile rows=10><?php readfile("data/profile.php"); ?></textarea></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
32977 downloads
MAJ 1.0
26 files
13132 downloads
MAJ 0.14
45 files
35010 downloads