diff options
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index d731062..6b87958 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -23,28 +23,32 @@ if (!defined('EG')) die('Direct access not allowed!'); function encodeUrl($url) { $url = str_replace(' ','-',$url); + $url = str_replace('.','-',$url); $url = str_replace('[','-',$url); $url = str_replace(']','-',$url); $url = str_replace('(','-',$url); $url = str_replace(')','-',$url); $url = str_replace('/','-',$url); $url = str_replace('@','-at-',$url); + $url = str_replace('#','-at-',$url); + $url = str_replace('?','-at-',$url); - $temp = null; - for ($i=0;$i<strlen($url); $i++) - { - if (strcmp($url[$i],' ') === 0) - { - $temp .= '-'; - } - else - { - if (preg_match('/^[a-zA-Z0-9\-]$/',$url[$i])) $temp .= $url[$i]; - } - } +// $temp = null; +// for ($i=0;$i<strlen($url); $i++) +// { +// if (strcmp($url[$i],' ') === 0) +// { +// $temp .= '-'; +// } +// else +// { +// if (preg_match('/^[a-zA-Z0-9\-]$/',$url[$i])) $temp .= $url[$i]; +// } +// } - $temp = urlencode($temp); - return $temp; +// $url = urlencode($url); +// $url = urlencode($url); + return $url; } // function encodeUrl($url) @@ -232,6 +236,8 @@ function decodeWikiText($string) $string = preg_replace('/(\[h2\])(.*?)(\[\/h2\])/s', '<div class="div_h2">${2}</div>',$string); $string = preg_replace('/(\[h3\])(.*?)(\[\/h3\])/s', '<div class="div_h3">${2}</div>',$string); + + $string = preg_replace('/(\[lang\])(.*?)(\[\/lang\])/s', '<div class="div_lang">${2}</div>',$string); return $string; } |