This commit has been accessed 589 times via Git panel.
commit c6c0224284acfd5b2df5f6bdf6ce89ae0b72768f
tree d958c9122cc57e6c574e58c3787d9d1800e30820
parent 9c890cd7d9f6bac72020345997d8d604be9803f9
author Engels Antonio <engels@majcms.org> 1277314204 +0800
committer Engels Antonio <engels@majcms.org> 1277314204 +0800
maj-1.0-20081128-bb.zip
diff --git a/add.php b/add.php
index 09cb210..65eb3de 100644
--- a/add.php
+++ b/add.php
@@ -519,7 +519,7 @@ $body_write_content = str_replace(';)', '<img src="images/smileys/wink.png" bord
$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("\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);
@@ -746,7 +746,7 @@ if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_e
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = ucfirst($_POST['body_input']);
- $ml_body = str_replace('<br>', "\n", $ml_body);
+ $ml_body = str_replace('<br />', "\n", $ml_body);
$ml_body = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $ml_body);
$ml_body = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $ml_body);
$ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $ml_body);
@@ -842,7 +842,7 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$link = str_replace("add.php?entry=","index.php?entry=",$link);
$body = file_get_contents($body_file);
- $body = str_replace("\n","<br>",$body);
+ $body = str_replace("\n","<br />",$body);
$html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
diff --git a/edit.php b/edit.php
index cb6391d..734a436 100644
--- a/edit.php
+++ b/edit.php
@@ -82,6 +82,18 @@ function rmdirr($recurse_dirname) {
return rmdir($recurse_dirname);
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
$title_file = 'data/items/' . $_REQUEST['entry'] . '/title.txt';
$body_file = 'data/items/' . $_REQUEST['entry'] . '/body.txt';
$date_file = 'data/items/' . $_REQUEST['entry'] . '/date.txt';
@@ -251,7 +263,7 @@ if (isset($_POST['category']) and !empty($_POST['category'])) {
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
$comment_txt = ucfirst($_POST['comment_txt']);
- $comment_txt = str_replace("\n", '<br>', $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);
$comment_txt = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $comment_txt);
@@ -290,7 +302,7 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
<div id="panel_body"><?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt"); ?></div>
<div id="panel_footer"><font style="font-size: 10px; color: #999999;">
<?php
- echo date("l, M j, Y, g:i A",filemtime("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/timestamp.txt"));
+ entry2date($_REQUEST['comment']);
if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
echo " (Revision ";
@@ -310,8 +322,7 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
$read_comment_txt_file = fread($open_comment_txt_file,filesize($comment_txt_file));
fclose($open_comment_txt_file);
- $comment_smiley2emoticon = str_replace('<br>', "\n", $read_comment_txt_file);
- $comment_smiley2emoticon = str_replace('<br />', "\n", $comment_smiley2emoticon);
+ $comment_smiley2emoticon = str_replace('<br />', "\n", $read_comment_txt_file);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $comment_smiley2emoticon);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $comment_smiley2emoticon);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $comment_smiley2emoticon);
@@ -360,7 +371,7 @@ if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
echo " - ";
}
-echo date("l, M j, Y, g:i A",filemtime("data/items/{$_REQUEST['entry']}/date.txt"));
+entry2date($_REQUEST['entry']);
if (file_exists($revisions_file)) {
echo ' (Revision ';
@@ -457,8 +468,7 @@ $open_body_file = fopen($body_file,"r");
$read_body_file = fread($open_body_file,filesize($body_file));
fclose($open_body_file);
-$body_read_content = str_replace('<br>', "\n", $read_body_file);
-$body_read_content = str_replace('<br />', "\n", $body_read_content);
+$body_read_content = str_replace('<br />', "\n", $read_body_file);
$body_read_content = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $body_read_content);
$body_read_content = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $body_read_content);
$body_read_content = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $body_read_content);
@@ -664,7 +674,7 @@ $body_write_content = str_replace(';)', '<img src="images/smileys/wink.png" bord
$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("\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);
@@ -743,7 +753,7 @@ if (isset($_FILES['album_image_input']) and !empty($_FILES['album_image_input'])
$caption_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_txt);
$caption_txt = str_replace('[code]', '<code>', $caption_txt);
$caption_txt = str_replace('[/code]', '</code>', $caption_txt);
- $caption_txt = str_replace("\n", '<br>', $caption_txt);
+ $caption_txt = str_replace("\n", '<br />', $caption_txt);
$caption_txt = str_replace('[b]', '<b>', $caption_txt);
$caption_txt = str_replace('[/b]', '</b>', $caption_txt);
$caption_txt = str_replace('[i]', '<i>', $caption_txt);
@@ -1034,7 +1044,7 @@ if ($_SESSION['logged_in'] == $login_username) {
$link = str_replace("edit.php?entry=","index.php?entry=",$link);
$body = file_get_contents($body_file);
- $body = str_replace("\n","<br>",$body);
+ $body = str_replace("\n","<br />",$body);
$html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
diff --git a/index.php b/index.php
index bab8431..0d4f3a5 100644
--- a/index.php
+++ b/index.php
@@ -272,6 +272,18 @@ function go_download($dl_file) {
}
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
$comment_dir = "data/items/$req_entry/comments/pending/{$_REQUEST['comment']}";
@@ -367,7 +379,7 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = file_get_contents("$live_dir/comment.txt");
- $ml_body = str_replace('<br>',"\n",$ml_body);
+ $ml_body = str_replace('<br />',"\n",$ml_body);
$ml_body = str_replace('<img src="images/smileys/crying.png" border="0">',':((',$ml_body);
$ml_body = str_replace('<img src="images/smileys/frown.png" border="0">',':(',$ml_body);
$ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$ml_body);
@@ -531,7 +543,7 @@ if (isset($req_entry) and !empty($req_entry)) {
$body_content = ucfirst($_POST['new_comment']);
$body_content = htmlentities($body_content,ENT_NOQUOTES);
- $body_content = str_replace("\n",'<br>',$body_content);
+ $body_content = str_replace("\n",'<br />',$body_content);
$body_content = trim($body_content);
$body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$body_content);
$body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$body_content);
@@ -754,7 +766,7 @@ if (isset($req_entry) and !empty($req_entry) and file_exists("data/items/$req_en
$description = str_replace("&","&",$description);
$description = str_replace("<","<",$description);
$description = str_replace(">",">",$description);
- $description = str_replace("<br>"," ",$description);
+ $description = str_replace("<br />"," ",$description);
$description = str_replace("<br>"," ",$description);
$description = str_replace("\r"," ",$description);
$description = str_replace("\n"," ",$description);
@@ -2569,7 +2581,7 @@ foreach ($disp as $d) {
echo "$xavatar_author - ";
}
- echo date("l, M j, Y, g:i A",filemtime("data/items/$d/date.txt"));
+ entry2date($d);
if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) or file_exists("data/items/$d/lastmod.txt")) {
@@ -3478,7 +3490,7 @@ foreach ($disp as $d) {
echo "<a href=member.php?id=$cxavatar_author>$cxavatar_author</a> - ";
}
- echo date("l, M j, Y, g:i A",filemtime("data/items/$d/comments/live/$comment/timestamp.txt"));
+ entry2date($comment);
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
diff --git a/login.php b/login.php
index 5da91cc..21bf072 100644
--- a/login.php
+++ b/login.php
@@ -1,26 +1,26 @@
<?php
-
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
-if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)) {
- foreach ($data as $key => $value) {
- $data[$key] = stripslashes_array($value);
+ session_start();
+ header("Cache-control: private");
+ error_reporting(E_ERROR);
+ if (get_magic_quotes_gpc())
+ {
+ function stripslashes_array($data)
+ {
+ if (is_array($data))
+ {
+ foreach ($data as $key => $value)
+ {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
+ }
+ else
+ {
+ return stripslashes($data);
}
- return $data;
- }
- else {
- return stripslashes($data);
}
+ $_POST = stripslashes_array($_POST);
}
- $_POST = stripslashes_array($_POST);
-}
-
?>
<title>Login</title>
@@ -32,12 +32,15 @@ body {
margin: 10px;
padding: 0px;
text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial, helvetica, sans-serif;
+ font-family:
+<?php
+ if (file_exists("data/fonts/body.txt"))
+ {
+ $font_body = file_get_contents("data/fonts/body.txt");
+ echo "{$font_body},";
+ }
+?>
+ arial, helvetica, sans-serif;
background-color: #FFFFFF;
}
@@ -67,76 +70,75 @@ a:active {
background: #ffffff;
border: #999999 solid 1px;
width: 125px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
+ font-family:
+<?php
+ if (file_exists("data/fonts/input.txt"))
+ {
+ $font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$font_input},";
+ }
+?>
+ arial, helvetica, sans-serif;
font-size: 11px;
}
</style>
<?php
-
-if (!isset($_POST['username']) or empty($_POST['username']) or !isset($_POST['password']) or empty($_POST['password'])) {
- $_SESSION = array();
- session_destroy();
-}
-else {
- $put_username = trim($_POST['username']);
-
- /* Fun with crypt! */
- $put_password = sha1($_POST['password']);
- $put_password = md5($put_password);
- $put_password = crypt($put_password, $put_password);
-
- if ($put_username == file_get_contents("data/username.txt")) {
- $get_password = file_get_contents("data/password.txt");
- $last_login = "data/lastlog.txt";
- $logins = "data/logins.txt";
+ if (!isset($_POST['username']) or empty($_POST['username']) or !isset($_POST['password']) or empty($_POST['password']))
+ {
+ $_SESSION = array();
+ session_destroy();
}
- else {
- if (file_exists("data/members/active/$put_username") and file_exists("data/bb.txt")) {
- $get_password = file_get_contents("data/members/active/$put_username/password.txt");
- $last_login = "data/members/active/$put_username/bb-last.txt";
- $logins = "data/members/active/$put_username/bb-logins.txt";
+ else
+ {
+ $put_username = trim($_POST['username']);
+ /* Fun with crypt! */
+ $put_password = sha1($_POST['password']);
+ $put_password = md5($put_password);
+ $put_password = crypt($put_password, $put_password);
+ if ($put_username == file_get_contents("data/username.txt"))
+ {
+ $get_password = file_get_contents("data/password.txt");
+ $last_login = "data/lastlog.txt";
+ $logins = "data/logins.txt";
}
- }
-
- if ($get_password == $put_password) {
-
- $_SESSION['logged_in'] = $_POST['username'];
- $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
-
- $lastlog = date("YmdHis", time() + $offset);
-
- $fp_lastlog_txt = fopen($last_login,"w");
- fwrite($fp_lastlog_txt,$lastlog);
- fclose($fp_lastlog_txt);
-
- if (file_exists("data/bb.txt") and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
- $fp_latest_login_txt = fopen("data/bb-last.txt","w");
- fwrite($fp_latest_login_txt,$_SESSION['logged_in']);
- fclose($fp_latest_login_txt);
+ else
+ {
+ if (file_exists("data/members/active/$put_username") and file_exists("data/bb.txt"))
+ {
+ $get_password = file_get_contents("data/members/active/$put_username/password.txt");
+ $last_login = "data/members/active/$put_username/bb-last.txt";
+ $logins = "data/members/active/$put_username/bb-logins.txt";
+ }
+ }
+ if ($get_password == $put_password)
+ {
+ $_SESSION['logged_in'] = $_POST['username'];
+ $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
+ $lastlog = date("YmdHis", time() + $offset);
+ $fp_lastlog_txt = fopen($last_login, "w");
+ fwrite($fp_lastlog_txt, $lastlog);
+ fclose($fp_lastlog_txt);
+ if (file_exists("data/bb.txt") and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))
+ {
+ $fp_latest_login_txt = fopen("data/bb-last.txt", "w");
+ fwrite($fp_latest_login_txt, $_SESSION['logged_in']);
+ fclose($fp_latest_login_txt);
+ }
+ $login_count = file_get_contents($logins);
+ $login_count = $login_count + 1;
+ $login_count_file = fopen($logins, "w");
+ fwrite($login_count_file, $login_count);
+ fclose($login_count_file);
+ header("Location: index.php");
+ }
+ else
+ {
+ $_SESSION = array();
+ session_destroy();
}
-
- $login_count = file_get_contents($logins);
- $login_count = $login_count + 1;
-
- $login_count_file = fopen($logins, "w");
- fwrite($login_count_file, $login_count);
- fclose($login_count_file);
-
- header("Location: index.php");
- }
- else {
- $_SESSION = array();
- session_destroy();
}
-}
-
?>
<form enctype="multipart/form-data" action="login.php" method="post">
@@ -151,11 +153,10 @@ else {
<td colspan="3">Enter your login credentials above or click <a href="index.php">here</a> to go to the index page.
<?php
-
-if (!file_exists("data/lite.txt") and file_exists("data/reset.txt")) {
- echo "<br>Click <a href=\"reset.php\">here</a> if you forgot your password.";
-}
-
+ if (!file_exists("data/lite.txt") and file_exists("data/reset.txt"))
+ {
+ echo "<br>Click <a href=\"reset.php\">here</a> if you forgot your password.";
+ }
?>
</td>
diff --git a/rel.txt b/rel.txt
index e394f17..27e8460 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081127
\ No newline at end of file
+20081128
\ No newline at end of file
diff --git a/wiki.php b/wiki.php
index ebe9494..5fcbc71 100644
--- a/wiki.php
+++ b/wiki.php
@@ -78,6 +78,18 @@ function rmdirr($recurse_dirname) {
return rmdir($recurse_dirname);
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
?>
<title>Wiki</title>
@@ -190,8 +202,8 @@ a:active {
echo "{$font_panel_footer},";
}
?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
+ font-size: 10px;
+ color: #999999;
padding: 5px 5px 5px 5px;
background-color: #ffffff;
margin: 0px;
@@ -240,21 +252,10 @@ if (file_exists("data/items/$entry/wiki/delta")) {
$title = file_get_contents("data/items/$entry/wiki/delta/$item/title.txt");
$body = file_get_contents("data/items/$entry/wiki/delta/$item/body.txt");
- $date = date("l, M j, Y, g:i A",filemtime("data/items/$entry/wiki/delta/$item/date.txt"));
$author = file_get_contents("data/items/$entry/author.txt");
$editor = file_get_contents("data/items/$entry/wiki/delta/$item/editor.txt");
- $itemYear = substr($item,0,4);
- $itemMonth = substr($item,4,2);
- $itemDay = substr($item,6,2);
- $itemHour = substr($item,8,2);
- $itemMinute = substr($item,10,2);
- $itemSecond = substr($item,12,2);
-
- $mod = date("l, M j, Y, g:i A", mktime($itemHour,$itemMinute,$itemSecond,$itemMonth,$itemDay,$itemYear));
-
$prev = file_get_contents("data/items/$entry/wiki/delta/$item/prev.txt");
-
$prev = str_replace("<br />","<br>",$prev);
$prev = str_replace("\n"," ",$prev);
$prev = str_replace("\r"," ",$prev);
@@ -306,9 +307,12 @@ if (file_exists("data/items/$entry/wiki/delta")) {
}
echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"restore\">";
- echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - $date<br><br></font>$diff</div>";
- echo "<div id=\"panel_footer\">Edited by $editor last $mod</div>";
- echo "</td></tr></table></p>";
+ echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - ";
+ entry2date($entry);
+ echo "<br><br></font>$diff</div>";
+ echo "<div id=\"panel_footer\">Edited by $editor last ";
+ entry2date($item);
+ echo "</div></td></tr></table></p>";
unset($diff);
unset($body);
tree d958c9122cc57e6c574e58c3787d9d1800e30820
parent 9c890cd7d9f6bac72020345997d8d604be9803f9
author Engels Antonio <engels@majcms.org> 1277314204 +0800
committer Engels Antonio <engels@majcms.org> 1277314204 +0800
maj-1.0-20081128-bb.zip
diff --git a/add.php b/add.php
index 09cb210..65eb3de 100644
--- a/add.php
+++ b/add.php
@@ -519,7 +519,7 @@ $body_write_content = str_replace(';)', '<img src="images/smileys/wink.png" bord
$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("\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);
@@ -746,7 +746,7 @@ if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_e
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = ucfirst($_POST['body_input']);
- $ml_body = str_replace('<br>', "\n", $ml_body);
+ $ml_body = str_replace('<br />', "\n", $ml_body);
$ml_body = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $ml_body);
$ml_body = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $ml_body);
$ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $ml_body);
@@ -842,7 +842,7 @@ if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on"))
$link = str_replace("add.php?entry=","index.php?entry=",$link);
$body = file_get_contents($body_file);
- $body = str_replace("\n","<br>",$body);
+ $body = str_replace("\n","<br />",$body);
$html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
diff --git a/edit.php b/edit.php
index cb6391d..734a436 100644
--- a/edit.php
+++ b/edit.php
@@ -82,6 +82,18 @@ function rmdirr($recurse_dirname) {
return rmdir($recurse_dirname);
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
$title_file = 'data/items/' . $_REQUEST['entry'] . '/title.txt';
$body_file = 'data/items/' . $_REQUEST['entry'] . '/body.txt';
$date_file = 'data/items/' . $_REQUEST['entry'] . '/date.txt';
@@ -251,7 +263,7 @@ if (isset($_POST['category']) and !empty($_POST['category'])) {
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
$comment_txt = ucfirst($_POST['comment_txt']);
- $comment_txt = str_replace("\n", '<br>', $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);
$comment_txt = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $comment_txt);
@@ -290,7 +302,7 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
<div id="panel_body"><?php readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt"); ?></div>
<div id="panel_footer"><font style="font-size: 10px; color: #999999;">
<?php
- echo date("l, M j, Y, g:i A",filemtime("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/timestamp.txt"));
+ entry2date($_REQUEST['comment']);
if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
echo " (Revision ";
@@ -310,8 +322,7 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
$read_comment_txt_file = fread($open_comment_txt_file,filesize($comment_txt_file));
fclose($open_comment_txt_file);
- $comment_smiley2emoticon = str_replace('<br>', "\n", $read_comment_txt_file);
- $comment_smiley2emoticon = str_replace('<br />', "\n", $comment_smiley2emoticon);
+ $comment_smiley2emoticon = str_replace('<br />', "\n", $read_comment_txt_file);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $comment_smiley2emoticon);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $comment_smiley2emoticon);
$comment_smiley2emoticon = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $comment_smiley2emoticon);
@@ -360,7 +371,7 @@ if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
echo " - ";
}
-echo date("l, M j, Y, g:i A",filemtime("data/items/{$_REQUEST['entry']}/date.txt"));
+entry2date($_REQUEST['entry']);
if (file_exists($revisions_file)) {
echo ' (Revision ';
@@ -457,8 +468,7 @@ $open_body_file = fopen($body_file,"r");
$read_body_file = fread($open_body_file,filesize($body_file));
fclose($open_body_file);
-$body_read_content = str_replace('<br>', "\n", $read_body_file);
-$body_read_content = str_replace('<br />', "\n", $body_read_content);
+$body_read_content = str_replace('<br />', "\n", $read_body_file);
$body_read_content = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $body_read_content);
$body_read_content = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $body_read_content);
$body_read_content = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $body_read_content);
@@ -664,7 +674,7 @@ $body_write_content = str_replace(';)', '<img src="images/smileys/wink.png" bord
$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("\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);
@@ -743,7 +753,7 @@ if (isset($_FILES['album_image_input']) and !empty($_FILES['album_image_input'])
$caption_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_txt);
$caption_txt = str_replace('[code]', '<code>', $caption_txt);
$caption_txt = str_replace('[/code]', '</code>', $caption_txt);
- $caption_txt = str_replace("\n", '<br>', $caption_txt);
+ $caption_txt = str_replace("\n", '<br />', $caption_txt);
$caption_txt = str_replace('[b]', '<b>', $caption_txt);
$caption_txt = str_replace('[/b]', '</b>', $caption_txt);
$caption_txt = str_replace('[i]', '<i>', $caption_txt);
@@ -1034,7 +1044,7 @@ if ($_SESSION['logged_in'] == $login_username) {
$link = str_replace("edit.php?entry=","index.php?entry=",$link);
$body = file_get_contents($body_file);
- $body = str_replace("\n","<br>",$body);
+ $body = str_replace("\n","<br />",$body);
$html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
diff --git a/index.php b/index.php
index bab8431..0d4f3a5 100644
--- a/index.php
+++ b/index.php
@@ -272,6 +272,18 @@ function go_download($dl_file) {
}
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
$comment_dir = "data/items/$req_entry/comments/pending/{$_REQUEST['comment']}";
@@ -367,7 +379,7 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
$ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
$ml_body = file_get_contents("$live_dir/comment.txt");
- $ml_body = str_replace('<br>',"\n",$ml_body);
+ $ml_body = str_replace('<br />',"\n",$ml_body);
$ml_body = str_replace('<img src="images/smileys/crying.png" border="0">',':((',$ml_body);
$ml_body = str_replace('<img src="images/smileys/frown.png" border="0">',':(',$ml_body);
$ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$ml_body);
@@ -531,7 +543,7 @@ if (isset($req_entry) and !empty($req_entry)) {
$body_content = ucfirst($_POST['new_comment']);
$body_content = htmlentities($body_content,ENT_NOQUOTES);
- $body_content = str_replace("\n",'<br>',$body_content);
+ $body_content = str_replace("\n",'<br />',$body_content);
$body_content = trim($body_content);
$body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$body_content);
$body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$body_content);
@@ -754,7 +766,7 @@ if (isset($req_entry) and !empty($req_entry) and file_exists("data/items/$req_en
$description = str_replace("&","&",$description);
$description = str_replace("<","<",$description);
$description = str_replace(">",">",$description);
- $description = str_replace("<br>"," ",$description);
+ $description = str_replace("<br />"," ",$description);
$description = str_replace("<br>"," ",$description);
$description = str_replace("\r"," ",$description);
$description = str_replace("\n"," ",$description);
@@ -2569,7 +2581,7 @@ foreach ($disp as $d) {
echo "$xavatar_author - ";
}
- echo date("l, M j, Y, g:i A",filemtime("data/items/$d/date.txt"));
+ entry2date($d);
if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) or file_exists("data/items/$d/lastmod.txt")) {
@@ -3478,7 +3490,7 @@ foreach ($disp as $d) {
echo "<a href=member.php?id=$cxavatar_author>$cxavatar_author</a> - ";
}
- echo date("l, M j, Y, g:i A",filemtime("data/items/$d/comments/live/$comment/timestamp.txt"));
+ entry2date($comment);
if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
diff --git a/login.php b/login.php
index 5da91cc..21bf072 100644
--- a/login.php
+++ b/login.php
@@ -1,26 +1,26 @@
<?php
-
-session_start();
-
-header("Cache-control: private");
-
-error_reporting(E_ERROR);
-
-if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)) {
- foreach ($data as $key => $value) {
- $data[$key] = stripslashes_array($value);
+ session_start();
+ header("Cache-control: private");
+ error_reporting(E_ERROR);
+ if (get_magic_quotes_gpc())
+ {
+ function stripslashes_array($data)
+ {
+ if (is_array($data))
+ {
+ foreach ($data as $key => $value)
+ {
+ $data[$key] = stripslashes_array($value);
+ }
+ return $data;
+ }
+ else
+ {
+ return stripslashes($data);
}
- return $data;
- }
- else {
- return stripslashes($data);
}
+ $_POST = stripslashes_array($_POST);
}
- $_POST = stripslashes_array($_POST);
-}
-
?>
<title>Login</title>
@@ -32,12 +32,15 @@ body {
margin: 10px;
padding: 0px;
text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial, helvetica, sans-serif;
+ font-family:
+<?php
+ if (file_exists("data/fonts/body.txt"))
+ {
+ $font_body = file_get_contents("data/fonts/body.txt");
+ echo "{$font_body},";
+ }
+?>
+ arial, helvetica, sans-serif;
background-color: #FFFFFF;
}
@@ -67,76 +70,75 @@ a:active {
background: #ffffff;
border: #999999 solid 1px;
width: 125px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
+ font-family:
+<?php
+ if (file_exists("data/fonts/input.txt"))
+ {
+ $font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$font_input},";
+ }
+?>
+ arial, helvetica, sans-serif;
font-size: 11px;
}
</style>
<?php
-
-if (!isset($_POST['username']) or empty($_POST['username']) or !isset($_POST['password']) or empty($_POST['password'])) {
- $_SESSION = array();
- session_destroy();
-}
-else {
- $put_username = trim($_POST['username']);
-
- /* Fun with crypt! */
- $put_password = sha1($_POST['password']);
- $put_password = md5($put_password);
- $put_password = crypt($put_password, $put_password);
-
- if ($put_username == file_get_contents("data/username.txt")) {
- $get_password = file_get_contents("data/password.txt");
- $last_login = "data/lastlog.txt";
- $logins = "data/logins.txt";
+ if (!isset($_POST['username']) or empty($_POST['username']) or !isset($_POST['password']) or empty($_POST['password']))
+ {
+ $_SESSION = array();
+ session_destroy();
}
- else {
- if (file_exists("data/members/active/$put_username") and file_exists("data/bb.txt")) {
- $get_password = file_get_contents("data/members/active/$put_username/password.txt");
- $last_login = "data/members/active/$put_username/bb-last.txt";
- $logins = "data/members/active/$put_username/bb-logins.txt";
+ else
+ {
+ $put_username = trim($_POST['username']);
+ /* Fun with crypt! */
+ $put_password = sha1($_POST['password']);
+ $put_password = md5($put_password);
+ $put_password = crypt($put_password, $put_password);
+ if ($put_username == file_get_contents("data/username.txt"))
+ {
+ $get_password = file_get_contents("data/password.txt");
+ $last_login = "data/lastlog.txt";
+ $logins = "data/logins.txt";
}
- }
-
- if ($get_password == $put_password) {
-
- $_SESSION['logged_in'] = $_POST['username'];
- $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
-
- $lastlog = date("YmdHis", time() + $offset);
-
- $fp_lastlog_txt = fopen($last_login,"w");
- fwrite($fp_lastlog_txt,$lastlog);
- fclose($fp_lastlog_txt);
-
- if (file_exists("data/bb.txt") and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))) {
- $fp_latest_login_txt = fopen("data/bb-last.txt","w");
- fwrite($fp_latest_login_txt,$_SESSION['logged_in']);
- fclose($fp_latest_login_txt);
+ else
+ {
+ if (file_exists("data/members/active/$put_username") and file_exists("data/bb.txt"))
+ {
+ $get_password = file_get_contents("data/members/active/$put_username/password.txt");
+ $last_login = "data/members/active/$put_username/bb-last.txt";
+ $logins = "data/members/active/$put_username/bb-logins.txt";
+ }
+ }
+ if ($get_password == $put_password)
+ {
+ $_SESSION['logged_in'] = $_POST['username'];
+ $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
+ $lastlog = date("YmdHis", time() + $offset);
+ $fp_lastlog_txt = fopen($last_login, "w");
+ fwrite($fp_lastlog_txt, $lastlog);
+ fclose($fp_lastlog_txt);
+ if (file_exists("data/bb.txt") and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))
+ {
+ $fp_latest_login_txt = fopen("data/bb-last.txt", "w");
+ fwrite($fp_latest_login_txt, $_SESSION['logged_in']);
+ fclose($fp_latest_login_txt);
+ }
+ $login_count = file_get_contents($logins);
+ $login_count = $login_count + 1;
+ $login_count_file = fopen($logins, "w");
+ fwrite($login_count_file, $login_count);
+ fclose($login_count_file);
+ header("Location: index.php");
+ }
+ else
+ {
+ $_SESSION = array();
+ session_destroy();
}
-
- $login_count = file_get_contents($logins);
- $login_count = $login_count + 1;
-
- $login_count_file = fopen($logins, "w");
- fwrite($login_count_file, $login_count);
- fclose($login_count_file);
-
- header("Location: index.php");
- }
- else {
- $_SESSION = array();
- session_destroy();
}
-}
-
?>
<form enctype="multipart/form-data" action="login.php" method="post">
@@ -151,11 +153,10 @@ else {
<td colspan="3">Enter your login credentials above or click <a href="index.php">here</a> to go to the index page.
<?php
-
-if (!file_exists("data/lite.txt") and file_exists("data/reset.txt")) {
- echo "<br>Click <a href=\"reset.php\">here</a> if you forgot your password.";
-}
-
+ if (!file_exists("data/lite.txt") and file_exists("data/reset.txt"))
+ {
+ echo "<br>Click <a href=\"reset.php\">here</a> if you forgot your password.";
+ }
?>
</td>
diff --git a/rel.txt b/rel.txt
index e394f17..27e8460 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081127
\ No newline at end of file
+20081128
\ No newline at end of file
diff --git a/wiki.php b/wiki.php
index ebe9494..5fcbc71 100644
--- a/wiki.php
+++ b/wiki.php
@@ -78,6 +78,18 @@ function rmdirr($recurse_dirname) {
return rmdir($recurse_dirname);
}
+function entry2date($f_entry) {
+
+ $f_entry_year = substr($f_entry,0,4);
+ $f_entry_month = substr($f_entry,4,2);
+ $f_entry_day = substr($f_entry,6,2);
+ $f_entry_hour = substr($f_entry,8,2);
+ $f_entry_min = substr($f_entry,10,2);
+ $f_entry_sec = substr($f_entry,12,2);
+
+ echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
+}
+
?>
<title>Wiki</title>
@@ -190,8 +202,8 @@ a:active {
echo "{$font_panel_footer},";
}
?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
+ font-size: 10px;
+ color: #999999;
padding: 5px 5px 5px 5px;
background-color: #ffffff;
margin: 0px;
@@ -240,21 +252,10 @@ if (file_exists("data/items/$entry/wiki/delta")) {
$title = file_get_contents("data/items/$entry/wiki/delta/$item/title.txt");
$body = file_get_contents("data/items/$entry/wiki/delta/$item/body.txt");
- $date = date("l, M j, Y, g:i A",filemtime("data/items/$entry/wiki/delta/$item/date.txt"));
$author = file_get_contents("data/items/$entry/author.txt");
$editor = file_get_contents("data/items/$entry/wiki/delta/$item/editor.txt");
- $itemYear = substr($item,0,4);
- $itemMonth = substr($item,4,2);
- $itemDay = substr($item,6,2);
- $itemHour = substr($item,8,2);
- $itemMinute = substr($item,10,2);
- $itemSecond = substr($item,12,2);
-
- $mod = date("l, M j, Y, g:i A", mktime($itemHour,$itemMinute,$itemSecond,$itemMonth,$itemDay,$itemYear));
-
$prev = file_get_contents("data/items/$entry/wiki/delta/$item/prev.txt");
-
$prev = str_replace("<br />","<br>",$prev);
$prev = str_replace("\n"," ",$prev);
$prev = str_replace("\r"," ",$prev);
@@ -306,9 +307,12 @@ if (file_exists("data/items/$entry/wiki/delta")) {
}
echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"restore\">";
- echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - $date<br><br></font>$diff</div>";
- echo "<div id=\"panel_footer\">Edited by $editor last $mod</div>";
- echo "</td></tr></table></p>";
+ echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - ";
+ entry2date($entry);
+ echo "<br><br></font>$diff</div>";
+ echo "<div id=\"panel_footer\">Edited by $editor last ";
+ entry2date($item);
+ echo "</div></td></tr></table></p>";
unset($diff);
unset($body);