diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-15 11:45:38 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-15 11:45:38 +0000 |
commit | d85570c9946aef61d8d935d9f50169215338d665 (patch) | |
tree | 80ff5e94178d9aa09bebfc6b897251078836cdd5 /h-source/Application/Include/myFunctions.php | |
parent | 8c287999487883a54271ae5e91bbb79b4fd15826 (diff) |
improved wiki
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index d494eb6..8299157 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\])/', '<hr />',$string); + $string = preg_replace_callback('/(\[\[)(.*?)(\]\])/', 'linkToInternalPage' ,$string); + $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); $string = preg_replace_callback('/(\[a\])(.*?)\|(.*?)(\[\/a\])/', 'linkToWithText',$string); @@ -269,6 +271,11 @@ function linkTo($match) } } +function linkToInternalPage($match) +{ + return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>"; +} + function linkToWithText($match) { if (checkUrl($match[2])) |