Revision [6609]

This is an old revision of SteveB made by SteveB on 2005-03-08 17:34:54.

 

All about me! Steve Berryman

Well, basically i'm at Manchester Uni (UK) studying computer science. I own my own webserver which is colocated at the Redbus Datacentre in London and have a number of sites running on it. One of them (or rather two sites using the same script) is a wiki! Not a Wikka wiki tho. Yet.

And thats the point. I want to move. I am going to move. Wikka is written better, has better support (JavaWoman has been great!) and more functionality. There are some problems with it for what *I* want it to do but i am working those out as i go along.

Anyway i dont come empty handed - One of the things i wanted was free links (pages with spaces in) and so i set about trying to hack wikka a bit to allow for that. With the help of JavaWoman here are the changes you need to make to let it happen :) (btw when i say "With the help of JavaWoman" i really mean, she did most of it and told me where and what i needed to do... I might have worked it out eventually... maybe ;). i also know regex a lot better now!)

Without farther rambling (im very good at rambling) here is the hack:

This changes the format for forced links. Because pages can now have spaces obviouly the old method of the seperator being a space wont work any more. So on JavaWomans suggestion i changed it to a | (pipe). the new format after these changes for a forced link is link text here

in wikka.php find:
if (preg_match("/^([A-ZÄÖÜ][A-Za-zÄÖÜßäöü]+)[:](\S*)$/", $tag, $matches)) # before the : should be a WikiName; anything after can be (nearly) anything that's allowed in a URL


and replace it with:
if (preg_match("/^([A-ZÄÖÜ][A-Z\ a-zÄÖÜßäöü]+)[:](\S*)$/", $tag, $matches))   # before the : should be a WikiName; anything after can be (nearly) anything that's allowed in a URL


then find:
// is this a full link? ie, does it contain alpha-numeric characters?
elseif (preg_match("/[^[:alnum:],ÄÖÜ,ßäöü]/", $tag))


and replace it with:
// is this a full link? ie, does it contain characters not valid for a wiki page name?
elseif (preg_match("/[^[:alnum:]\ ÄÖÜßäöü]/", $tag))


and last but not least, find:
return ($linkedPage ? "<a href=\"".$this->Href($method, $linkedPage['tag'])."\" title=\"$title\">".$text."</a>" : "<a class=\"missingpage\" href=\"".$this->Href("edit", $tag)."\" title=\"Create this page\">".$text."</a>");


and replace with:
return ($linkedPage ? "<a href=\"".$this->Href($method, urlencode($linkedPage['tag']))."\" title=\"$title\">".$text."</a>" : "<a class=\"missingpage\" href=\"".$this->Href("edit", $tag)."\" title=\"Create this page\">".$text."</a>");


then in handlers/page/edit.php find
if (!(preg_match("/^[A-Za-zÄÖÜßäöü]+[A-Za-z0-9ÄÖÜßäöü]*$/s", $this->tag))) {


and replace with:
if (!(preg_match("/^[A-Za-zÄÖÜßäöü]+[A-Za-z\ 0-9\+ÄÖÜßäöü]*$/s", $this->tag))) {


and the last file to change is formatters/wakka.php.
find:
else if (preg_match("/^\[\[(\S*)(\s+(.+))?\]\]$/s", $thing, $matches))      # recognize forced links across lines


and replace with:
else if (preg_match("/^\[\[(.+?)(\|(.+))?\]\]$/s", $thing, $matches))       # recognize forced links across lines


i THINK thats all of the changes. let me know what you think, if anything needs to be changed or whatever.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki