currentItem = &$data["item"];
$this->currentItem->body = NP_WikiLink::wikiLink( $this->currentItem->body );
$this->currentItem->more = NP_WikiLink::wikiLink( $this->currentItem->more );
// $this->currentItem->body = preg_replace( "/\[\[(.+?)\|(.+?)\]\]/", "\\2", $this->currentItem->body );
// $this->currentItem->more = preg_replace( "/\[\[(.+?)\|(.+?)\]\]/", "\\2", $this->currentItem->more );
// $this->currentItem->body = preg_replace( "/\[\[(.+?)\]\]/", "\\1", $this->currentItem->body );
// $this->currentItem->more = preg_replace( "/\[\[(.+?)\]\]/", "\\1", $this->currentItem->more );
}
function wikiLink( $text ) {
$links = preg_match_all( "/(\[\[.+?\]\])/", $text, $wiki, PREG_SET_ORDER );
for( $i=0; $i<$links; $i++ ) {
$link = preg_match( "/^\[\[(.+?)\]\]$/", $wiki[$i][0], $item );
//$info .= $item[1];
$split = explode( "|", $item[1] );
if ( count($split) == 2 ) {
$linkage = "$split[1]";
} else {
$linkage = "$split[0]";
}
$text = str_replace( $item[0], $linkage, $text );
}
return($text);
}
}
?>