''(Restored - please check)'' ---- MuWiki is a 9 line PHP WikiClone, it has been written for the ShortestWikiContest and isn't used anywhere. The first version, 15 lines, produces a cleaner html and is ''quasi'' readable. The second version, 10 lines, have a really bad html but is someway smaller and the logic is a bit more complicated. The third version in 9 lines also have the support for BackLink''''''s, an insane logic and doesn't fclose() files.. then i changed my mind (see note) on that and wrote a 15 lines version that is xHTML compliant.. * Working code: http://jaramir.slack.it/MuWiki/ * Source code: http://jaramir.slack.it/MuWiki/wiki.phps For the syntax see mainly TextFormattingRules, but the lists are made with "{", "@" and "}" '''Acknowledgements:''' sen (#php@irc.freenode.net) s/file_get_contents()/join(file())/ ---- PHP, Perl and ShortestWikiContest Perl have won! PHP isn't (yet) that good for short programming (or maybe: i'm not that good coder) so i've changed MuWiki to do something useful: produce xHTML clean pages (that was on my todo list) and restarted shortening this version (that's huge: 15 lines!!) Even if PHP have lost it was fun to try this contest :o) ---- Hmm, I tried the 15-line "xHTML Compliant" version and got the error "Warning: Wrong parameter count for join() in /test/index.php on line 8" -- is this a PHP version problem? php.net/implode: (join is an alias of implode) As of PHP 4.3.0, the glue parameter of implode() is optional and defaults to the empty string(''). It's a versioning problem: i've sacrified compattibility with PHP 4.2.* for 4 chars: ",' '" -- Jaramir ---- I too had the following errors while running it locally with PHP 4.3.3 : * Notice: Undefined offset: 0 in c:\muwiki.php on line 4 // yeah, I even take Notices in my alerts * Notice: Undefined offset: 2 in c:\muwiki.php on line 7 * Warning: file(_HomePage): failed to open stream: No such file or directory in c:\muwiki.php on line 8 // need to create this file by myself ? * Warning: join(): Argument to implode must be an array. in c:\muwiki.php on line 8 well, "clean" and "short" aren't that much friends in programming, if the files dosn't exists it will show an empty form so it's not needed to create the page. these are just Warnings and Notices, you'll have to write one or two lines more to take em out.. -- Jaramir ---- Here is a copy of the source: MuWiki';$r=$_REQUEST;$w=($r[0])?$r [0]:"HomePage";$l='ValidxHTML';if($r[2]){$f=fopen("_$w",'w');fwrite($f,$r[2]) ;$r[1]='';}if(!$t=join(file("_$w"),"")or$r[1])die ('
'.$e);foreach(glob("_*")as$g)if(ereg($w,join(file("$g"))))$b.=" $g";echo "

$w

".preg_replace(array("/\n( +.*)\n/","/'''([^']*)'''/","/''([^']*)'" ."'/","/\n{/","/\n@(.*)/","/\n}/","/\n+/","/(http:[^ \n]*)/","/[_']?(([A-Z][a". "-z]+){2,})/","/-{4}/","/'{6}/"),array('
\1
','\1','\1', '','
',$l. '\1">\1'," $l".'?0=\1">\1',"<" ."hr/>","",),$t."
".$b);echo" $l?0=$w&1=1\">ed $w".$e;/* xHTML */?> -- Jaramir ---- Original 9 line version: MuWiki ");foreach(glob("_*")as$g)if(ereg($w,join(file("$g")) ))$b.= " $g";echo"

$w

".preg_replace(array("/\n( +.*)\n/","/'''([^']*)'''/","". "/''([^']*)''/","/\n\*\*(.*)/","/\n\*/","/\n+/","/(http:[^ \n]*)/","/[ _']?(([" ."A-Z][a-z]+){2,})/","/-{4}/","/'{6}/"),array('
\1
','\1','\\1",'','
  • ',"

    ",$l.'\1>\1',$l.'?0=\1>\1', "
    ","",),$t."
    ".$b);echo" $l?0=".$w."&1=1>edit $w";?> -- Jaramir ---- CategoryWikiImplementation