aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Include/myFunctions.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
commit4a27b517fc52dde60e5c1837860e4785317490a6 (patch)
tree73b91c5d212f1bb67eb83fea9694cf8d1a360846 /h-source/Application/Include/myFunctions.php
parentd85570c9946aef61d8d935d9f50169215338d665 (diff)
improved wiki
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r--h-source/Application/Include/myFunctions.php7
1 files changed, 7 insertions, 0 deletions
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\])/', '<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 "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>";
}
+function linkToInternalPageWithText($match)
+{
+ return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[3]."</a>";
+}
+
function linkToWithText($match)
{
if (checkUrl($match[2]))