Before:
' . $modified . '
END Before
${1}
' $patterns[0] = '/>[\n[:space:]]?:::(.*)/'; $patterns[1] = '/>[\n[:space:]]?::(.*)/'; $patterns[2] = '/>[\n[:space:]]?:(.*)/'; $replacements[0] = '${1}
'; $replacements[1] = '${1}
'; $replacements[2] = '${1}
'; $modified = preg_replace($patterns, $replacements, $modified); // $modified = preg_replace_callback('/>[\n[:space:]]?:(.*)/', 'replace_callback_colon', $modified); /* All formatting*/ $patterns[0] = '/\^{5}(.*)\^{5}/'; $patterns[1] = '/\^{3}(.*)\^{3}/'; $patterns[2] = '/\^{2}(.*)\^{2}/'; $replacements[0] = '${1}'; $replacements[1] = '${1}'; $replacements[2] = '${1}'; $modified = preg_replace('/(\(821[67]);)/', '^', $modified); $modified = preg_replace($patterns, $replacements, $modified); $modified = preg_replace('/\^/', '\'', $modified); /* All Links: */ $modified = preg_replace_callback('/\[http:([a-zA-Z0-9\/=?\.-_&]*) (.*)\]/', 'replace_callback_links_with_substitute', $modified); // NOT working yet: links not surrounded by [] // $modified = preg_replace_callback('/http:([a-zA-Z0-9\/=?\.-_&]*)/', 'replace_callback_links', $modified); // already working for links with [{link}] $modified = preg_replace_callback('/\[http:([a-zA-Z0-9\/=?\.-_&]*)\]/', 'replace_callback_links', $modified); //Replaces wiki links in format [wiki:{PAGE_ID}] with a textile link to the page $modified = preg_replace_callback('/\[wiki:([0-9]*)\]/', 'replace_wiki_link_callback', $modified); //Replaces wiki links in format [[wikipage|title]] with a textile link to the wikipage under the name 'title' $modified = preg_replace_callback('/\[\[(.*)\|(.*)\]\]/', 'replace_wiki_link_title_callback_2', $modified); //Replaces wiki links in format [[wikipage]] with a textile link to the wikipage $modified = preg_replace_callback('/\[\[(.*)\]\]/', 'replace_wiki_link_title_callback', $modified); /* signature shortcuts */ $username = logged_user()->getUsername(); $timestamp = time(); $finalTimeAndDate = date("H:i",$timestamp) . ", " . date("d.m.Y",$timestamp) . " (UTC)";//07:46, 27 November 2005 (UTC) $patterns[0] = '/~~~~~/'; $patterns[1] = '/~~~~/'; $patterns[2] = '/~~~/'; $replacements[0] = ''.$finalTimeAndDate.'
'; $replacements[1] = ''.$username . ' ' . $finalTimeAndDate.'
'; $replacements[2] = ''.$username.'
'; $modified = preg_replace($patterns, $replacements, $modified); $tocContent = getTocContent($content); if ($tocContent != '') printTocFrame($tocContent); return $modified; } function printTocFrame($tocContent) { $tocframe = ' ' . 'Contents
' . $tocContent . ' ' . //' |
'.$numbering[$matches[1][$key]-1].' '.$val.'
'; $string = $string . ''.$numbering[$toclevel].' '.$val.''.$matches{1}.'
'; } */ /* All Links: */ /** * Call back function for wiki helper to link by title * * @param mixed $matches * @return */ function replace_callback_links($matches) { // echo 'replace_callback_links: ' . count($matches); // echo '