Menu

WikiRootry / News: Recent posts

Heavy construction

There will be great changes in new version!
It is under heavy construction.

Posted by Harold Chan 2004-07-09

New user

Posted by Harold Chan 2004-06-08



0.1.4 has been released

-search functions
-bugs fixed
-better security
-some major changes

Posted by Harold Chan 2004-04-18

Development of 0.1.4 is in progress

please check out the CVS or try the demo~

Posted by Harold Chan 2004-04-10

0.1.3 is released!

- new content replacement
- bugs fixed
- better alignment of forms
- new function of keeping the cookie

Posted by Harold Chan 2004-04-09

CVS version is out now!

I have started to use CVS to update the code.

you can access freely in order to get the most updated version

Posted by Harold Chan 2004-04-08

another bug fixed in edit.php in 0.1.2

Please use this version, 0.1.3 will include the fixed version.

<?php
include "timer.php";
include "config.php";
include "lang.php";
include "cookie.php";
$titlehead=$lang[titlehead][edit];
$page=$HTTP_POST_VARS[page];
if ($page==""){
$page=$HTTP_GET_VARS[page];
}
if ($page==""){
$page=$config[main];
}
if ((strpos($page, ".")!==false)or(strpos($page, "?")!==false)or(strpos($page, "=")!==false)or(strpos($page, "#")!==false)
or(strpos($page, "%23")!==false)or(strpos($page, "%3D")!==false)or(strpos($page, "%3F")!==false)){
include "top.php";
print $lang[illegalpagename];
include "bottom.php";
exit;
}
$spaceonlyprevent=str_replace(" ","",$page);
$spaceonlyprevent=str_replace("%20","",$spaceonlyprevent);
if ($spaceonlyprevent==""){
include "top.php";
print $lang[illegalpagename];
include "bottom.php";
exit;
}
$page=urldecode($page);
$page=utf8_decode($page);
$enpage=base64_encode($page);
if (strlen($page)>60){
include "top.php";
print strlen($page);
print $lang[nametoolong];
include "bottom.php";
exit;
}
if ($HTTP_GET_VARS[source]=="1"){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
include "top.php";
print "<h2>$lang[sourcecode] - <a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a></h2>";
print "<tr><td>\n<textarea cols=\"80\" rows=\"25\">$contents</textarea>\n";
$mtime=gmdate("$config[time]",$lastedited+$config[timezone]*3600);
print "<br><font color=\"#AAAAAA\"><small>$lang[lasteditby] $lasteditor $lang[at] $mtime $config[timezonetxt] <a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a></small></font>\n";
include "bottom.php";
}else{
if ((($config[permission]==1)or
(($config[permission]==2)and($cookie[exist]==TRUE))or
(($config[permission]==3)and($cookie[exist]==TRUE)and($cookie[admin]==TRUE)))
and
((($config[protect][$page]==TRUE)and($cookie[exist]==TRUE)and($cookie[admin]==TRUE))or
($config[protect][$page]!=TRUE))){
if ($HTTP_POST_VARS[contents]==""){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
include "top.php";
print "<h2>$lang[edit] $page</h2>\n";
print "<table><form action=\"edit.php\" method=\"POST\">\n";
print "<textarea name=\"contents\" cols=\"80\" rows=\"25\">$contents</textarea><br>\n";
print "<input name=\"page\" value=\"".rawurlencode(utf8_encode($page))."\" type=\"hidden\">\n";
print "<input name=\"time\" value=\"".time()."\" type=\"hidden\">\n";
print "<input name=\"submit\" type=\"submit\" value=\"$lang[save]\">\n";
print "<input name=\"preview\" type=\"submit\" value=\"$lang[preview]\">\n";
print "</form></table>\n";
include "bottom.php";
}elseif($HTTP_POST_VARS[preview]!=""){
$contents=stripslashes($HTTP_POST_VARS[contents]);
$contents=str_replace("</textarea>","",$contents);
include "top.php";
print "<h2>$lang[edit] $page</h2>\n";
print "<table><form action=\"edit.php\" method=\"POST\">\n";
print "<textarea name=\"contents\" cols=\"80\" rows=\"25\">$contents</textarea><br>\n";
print "<input name=\"page\" value=\"".rawurlencode(utf8_encode($page))."\" type=\"hidden\">\n";
print "<input name=\"time\" value=\"$HTTP_POST_VARS[time]\" type=\"hidden\">\n";
print "<input name=\"submit\" type=\"submit\" value=\"$lang[save]\">\n";
print "<input name=\"preview\" type=\"submit\" value=\"$lang[preview]\">\n";
print "</form></table>\n";
$contents=process($contents);
print "<h2><u>$lang[preview]</u></h2>\n<table width=\"100%\" border=\"0\" bgcolor=\"$config[tablecolor]\">";
print "<tr><td>\n$contents\n";
print "</td></tr></table>";
include "bottom.php";
}else{
if ($config[backup]>0){
$backuplist=list_backup($enpage);
for ($i = 0; $i < count($backuplist); $i++) {
$filename = explode(".", $backuplist[$i]);
if($filename[1]<(time()-$config[backup])){
if (!unlink("./backup/$backuplist[$i]")) {
include "top.php";
print $lang[failtodelbackup];
include "bottom.php";
exit;
}
}
}}
if (file_exists("./data/$enpage")){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
if (!copy("./data/$enpage", "./backup/$enpage.$lastedited")) {
include "top.php";
print $lang[failtobackup];
include "bottom.php";
exit;
}
@chmod("./backup/$enpage.$lastedited", 0777);
}
$handle = @fopen("./data/$enpage", "r");
$oldcontents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($oldlasteditor,$oldlastedited,$oldcontents) = split ("|\:|", $oldcontents);
$contents=stripslashes($HTTP_POST_VARS[contents]);
$contents=str_replace("</textarea>","",$contents);
if ($oldcontents==$contents){
include "top.php";
print "$lang[editfailnochange]<br>\n";
print "<a href=\"edit.php?page=".rawurlencode(utf8_encode($page))."\">$lang[edit] $page</a>";
include "bottom.php";
exit;
}
if ($HTTP_POST_VARS[time]<=$oldlastedited){
include "top.php";
print "$lang[editfailhaschange]<br>\n";
print "<a href=\"edit.php?page=".rawurlencode(utf8_encode($page))."\">$lang[edit] $page</a>";
include "bottom.php";
exit;
}
$handle = @fopen ("./data/$enpage", "w") or die($lang[editfail]);
if ($cookie[id]==""){$editor=$HTTP_SERVER_VARS['REMOTE_ADDR'];}else{$editor=$cookie[id];}
fwrite($handle, $editor."|:|".time()."|:|".$contents);
fclose($handle);
@chmod("./data/$enpage", 0777);
header("Location: index.php?page=".rawurlencode(utf8_encode($page)));
include "top.php";
print "$lang[updatesuccess]<br>\n";
print "<a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a>";
include "bottom.php";
exit;
}
}else{
include "top.php";
print $lang[editnotallow];
print "\n<br><a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a>";
include "bottom.php";
exit;
}
}... read more

Posted by Harold Chan 2004-04-08

edit.php bugs fixed

bugs fixed:potential space and special character problems, fixed version will be included in the next release
Here is the new version of edit.php

<?php
include "timer.php";
include "config.php";
include "lang.php";
include "cookie.php";
$titlehead=$lang[titlehead][edit];
$page=$HTTP_POST_VARS[page];
if ($page==""){
$page=$HTTP_GET_VARS[page];
}
if ($page==""){
$page=$config[main];
}
if ((strpos($page, ".")!==false)or(strpos($page, "?")!==false)or(strpos($page, "=")!==false)or(strpos($page, "#")!==false)
or(strpos($page, "%23")!==false)or(strpos($page, "%3D")!==false)or(strpos($page, "%3F")!==false)){
include "top.php";
print $lang[illegalpagename];
include "bottom.php";
exit;
}
$spaceonlyprevent=str_replace(" ","",$page);
$spaceonlyprevent=str_replace("%20","",$spaceonlyprevent);
if ($spaceonlyprevent==""){
include "top.php";
print $lang[illegalpagename];
include "bottom.php";
exit;
}
$page=urldecode($page);
$page=utf8_decode($page);
$enpage=base64_encode($page);
if (strlen($page)>60){
include "top.php";
print strlen($page);
print $lang[nametoolong];
include "bottom.php";
exit;
}
if ($HTTP_GET_VARS[source]=="1"){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
include "top.php";
print "<h2>$lang[sourcecode] - <a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a></h2>";
print "<tr><td>\n<textarea cols=\"80\" rows=\"25\">$contents</textarea>\n";
$mtime=gmdate("$config[time]",$lastedited+$config[timezone]*3600);
print "<br><font color=\"#AAAAAA\"><small>$lang[lasteditby] $lasteditor $lang[at] $mtime $config[timezonetxt] <a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a></small></font>\n";
include "bottom.php";
}else{
if ((($config[permission]==1)or
(($config[permission]==2)and($cookie[exist]==TRUE))or
(($config[permission]==3)and($cookie[exist]==TRUE)and($cookie[admin]==TRUE)))
and
((($config[protect][$page]==TRUE)and($cookie[exist]==TRUE)and($cookie[admin]==TRUE))or
($config[protect][$page]!=TRUE))){
if ($HTTP_POST_VARS[contents]==""){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
include "top.php";
print "<h2>$lang[edit] $page</h2>\n";
print "<table><form action=\"edit.php\" method=\"POST\">\n";
print "<textarea name=\"contents\" cols=\"80\" rows=\"25\">$contents</textarea><br>\n";
print "<input name=\"page\" value=\"".rawurlencode(utf8_encode($page))."\" type=\"hidden\">\n";
print "<input name=\"time\" value=\"".time()."\" type=\"hidden\">\n";
print "<input name=\"submit\" type=\"submit\" value=\"$lang[save]\">\n";
print "<input name=\"preview\" type=\"submit\" value=\"$lang[preview]\">\n";
print "</form></table>\n";
include "bottom.php";
}elseif($HTTP_POST_VARS[preview]!=""){
$contents=stripslashes($HTTP_POST_VARS[contents]);
include "top.php";
print "<h2>$lang[edit] $page</h2>\n";
print "<table><form action=\"edit.php\" method=\"POST\">\n";
print "<textarea name=\"contents\" cols=\"80\" rows=\"25\">$contents</textarea><br>\n";
print "<input name=\"page\" value=\"".rawurlencode(utf8_encode($page))."\" type=\"hidden\">\n";
print "<input name=\"time\" value=\"$HTTP_POST_VARS[time]\" type=\"hidden\">\n";
print "<input name=\"submit\" type=\"submit\" value=\"$lang[save]\">\n";
print "<input name=\"preview\" type=\"submit\" value=\"$lang[preview]\">\n";
print "</form></table>\n";
$contents=process($contents);
print "<h2><u>$lang[preview]</u></h2>\n<table width=\"100%\" border=\"0\" bgcolor=\"$config[tablecolor]\">";
print "<tr><td>\n$contents\n";
print "</td></tr></table>";
include "bottom.php";
}else{
if ($config[backup]>0){
$backuplist=list_backup($enpage);
for ($i = 0; $i < count($backuplist); $i++) {
$filename = explode(".", $backuplist[$i]);
if($filename[1]<(time()-$config[backup])){
if (!unlink("./backup/$backuplist[$i]")) {
include "top.php";
print $lang[failtodelbackup];
include "bottom.php";
exit;
}
}
}}
if (file_exists("./data/$enpage")){
$handle = @fopen("./data/$enpage", "r");
$contents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($lasteditor,$lastedited,$contents) = split ("|\:|", $contents,3);
if (!copy("./data/$enpage", "./backup/$enpage.$lastedited")) {
include "top.php";
print $lang[failtobackup];
include "bottom.php";
exit;
}
@chmod("./backup/$enpage.$lastedited", 0777);
}
$handle = @fopen("./data/$enpage", "r");
$oldcontents = @fread($handle, filesize("./data/$enpage"));
@fclose($handle);
list ($oldlasteditor,$oldlastedited,$oldcontents) = split ("|\:|", $oldcontents);
$contents=stripslashes($HTTP_POST_VARS[contents]);
if ($oldcontents==$contents){
include "top.php";
print "$lang[editfailnochange]<br>\n";
print "<a href=\"edit.php?page=".rawurlencode(utf8_encode($page))."\">$lang[edit] $page</a>";
include "bottom.php";
exit;
}
if ($HTTP_POST_VARS[time]<=$oldlastedited){
include "top.php";
print "$lang[editfailhaschange]<br>\n";
print "<a href=\"edit.php?page=".rawurlencode(utf8_encode($page))."\">$lang[edit] $page</a>";
include "bottom.php";
exit;
}
$handle = @fopen ("./data/$enpage", "w") or die($lang[editfail]);
if ($cookie[id]==""){$editor=$HTTP_SERVER_VARS['REMOTE_ADDR'];}else{$editor=$cookie[id];}
fwrite($handle, $editor."|:|".time()."|:|".$contents);
fclose($handle);
@chmod("./data/$enpage", 0777);
header("Location: index.php?page=".rawurlencode(utf8_encode($page)));
include "top.php";
print "$lang[updatesuccess]<br>\n";
print "<a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a>";
include "bottom.php";
exit;
}
}else{
include "top.php";
print $lang[editnotallow];
print "\n<br><a href=\"index.php?page=".rawurlencode(utf8_encode($page))."\">$page</a>";
include "bottom.php";
exit;
}
}... read more

Posted by Harold Chan 2004-04-07

0.1.2 released

- bugs fixed in diff.php
- new functions in redirect.php (auto search similar page name)
- new content replacement (external links with different colours, links to wikipedia & right alignment)
- Sorted page list

Posted by Harold Chan 2004-04-07

bugs solved in diff.php in version 0.1

Bugs are found in diff.php, in the next version, the bug-fixed verion will be included
please update diff.php as:

<?php
include "timer.php";
include "config.php";
include "lang.php";
include "cookie.php";
$page1=$HTTP_POST_VARS[page1];
if ($page1==""){$page1=$config[main];}
$page1=urldecode($page1);
$page1=utf8_decode($page1);
$pos1 = strpos($page1, ".");
$filename1 = explode(".", $page1);
$filename1[0]=base64_encode($filename1[0]);
if ($pos1==0){$loc1="data";}else{$loc1="backup";}... read more

Posted by Harold Chan 2004-04-06

0.1 released

WikiRootry 0.1 is released
It uses PHP, no DB is needed.
It outputs text as unicode

problems: safe mode, diff is not working very well

Posted by Harold Chan 2004-04-06