Mercurial > owls
changeset 8:2672cd855fa2
added further doxygen-comments
author | Meillo r e t u r n s <meillo@marmaro.de> |
---|---|
date | Wed, 13 Dec 2006 23:08:55 +0100 |
parents | a3a651f0cac6 |
children | eb5bff360deb |
files | Includes/Bbcodeparser.inc.php Includes/Nav.inc.php |
diffstat | 2 files changed, 41 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/Includes/Bbcodeparser.inc.php Wed Dec 13 22:16:59 2006 +0100 +++ b/Includes/Bbcodeparser.inc.php Wed Dec 13 23:08:55 2006 +0100 @@ -1,27 +1,39 @@ <?php - /** - * * BB-Code-Parser * - * by Meillo r e t u r n s - * + * @author Meillo r e t u r n s <meillo@marmaro.de> */ - define('SMILIE_DIR', 'Smilies/'); // path to smilies + /// path to smilies + define('SMILIE_DIR', 'Smilies/'); - - function parse_quote1($textinput,$level = 1) { // ohne Quelle + /** + * parses recursive quotes without a source mentioned + * + * @param $textinput the bbcode-text + * @param $level number of levels to go inside + * @return HTML-text + */ + function parse_quote1($textinput,$level = 1) { $pattern = '#\[quote\](((?R)|(.*))*)\[/quote\]#isUe'; $replacement = "'<br />[nl]<span class=\"quote0\">Zitat:</span>[nl]<div class=\"quote1\">[nl]'.parse_quote1('$1', ". ($level + 1) ." ).'[nl]</div>[nl]'"; return preg_replace($pattern, $replacement, $textinput); } - function parse_quote2($textinput,$level = 1) { // mit Quelle + + /** + * parses recursive quotes with a source mentioned + * + * @param $textinput the bbcode-text + * @param $level number of levels to go inside + * @return HTML-text + */ + function parse_quote2($textinput,$level = 1) { $pattern = '#\[quote\=(.*)\](((?R)|(.*))*)\[/quote\]#isUe'; $replacement = "'<br />[nl]<span class=\"quote0\">Zitat: ($1)</span>[nl]<div class=\"quote2\">[nl]'.parse_quote2('$2', ". ($level + 1) ." @@ -29,6 +41,12 @@ return preg_replace($pattern, $replacement, $textinput); } + /** + * replaces smilies + * + * @param $text text with ASCII-smilies + * @return text with [img]-smilies + */ function smilies($text) { $smilies = array( ':-)' => 'Smile.gif', ':)' => 'Smile.gif', @@ -57,6 +75,14 @@ } + /** + * turns bbcode in HTML + * + * @param $text the text with bbcode inside + * @param $smilies set to 1 causes smilies to be replaced with pics + * @param $images set to 1 causes images to be displayed ([img]-tag) + * @return text with HTML-code + */ function bbcode($text, $smilies = 0, $images = 0) { // smilies @@ -94,4 +120,4 @@ return $text; } -?> \ No newline at end of file +?>
--- a/Includes/Nav.inc.php Wed Dec 13 22:16:59 2006 +0100 +++ b/Includes/Nav.inc.php Wed Dec 13 23:08:55 2006 +0100 @@ -93,7 +93,12 @@ <?php - + /** + * recursive function creates the output for the nav tree + * + * @param $root the id of the parent of the root node + * @return string HTML output that shows the nav tree + */ function navtree($root) { // fetch subcategories $sql = sprintf("