From 4a27b517fc52dde60e5c1837860e4785317490a6 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 15 Feb 2011 17:06:09 +0000 Subject: improved wiki --- h-source/Application/Include/myFunctions.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'h-source/Application/Include/myFunctions.php') diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 8299157..d2b54e7 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -195,6 +195,8 @@ function decodeWikiText($string) $string = preg_replace('/(\[hr\])/', '
',$string); + $string = preg_replace_callback('/(\[\[)(.*?)\|(.*?)(\]\])/', 'linkToInternalPageWithText' ,$string); + $string = preg_replace_callback('/(\[\[)(.*?)(\]\])/', 'linkToInternalPage' ,$string); $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); @@ -276,6 +278,11 @@ function linkToInternalPage($match) return "".$match[2].""; } +function linkToInternalPageWithText($match) +{ + return "".$match[3].""; +} + function linkToWithText($match) { if (checkUrl($match[2])) -- cgit v1.2.3