Mercurial > hg > batmud > maputils
diff www/loc.php @ 1112:b80d263baf9f
Sync.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 02 Jul 2011 18:04:36 +0300 |
parents | fdf23fef400e |
children | 3dc58d67b7b4 |
line wrap: on
line diff
--- a/www/loc.php Sat Jul 02 17:59:30 2011 +0300 +++ b/www/loc.php Sat Jul 02 18:04:36 2011 +0300 @@ -3,6 +3,17 @@ require "common.inc.php"; +// Wizard info box special formatting tags +$specTags = array( + "b" => "<b>", + "\/b" => "</b>", + "i" => "<i>", + "\/i" => "</i>", + "p" => "<br /><br />", + "br" => "<br />", +); + + function printTitleLink($afilter, $filter, $coders, $desc, $qname, $qclass) { $s = ""; @@ -140,27 +151,35 @@ </div> <? -/* Coder/creator information box +/* Wizard/coder/creator information box */ if (isset($coderName) && isset($wizTable[$coderName]) && count($wizTable[$coderName]) > 1) { - + + // Profile picture $s = $wizTable[$coderName]["imageURL"]; if (isset($s)) { if (substr($s, 0, 6) == "bat://") $s = "img/unknown.png"; } else $s = "img/unknown.png"; - + echo "<div class=\"wizinfo\">\n <table>\n <tr>\n". " <td class=\"img\"><img src=\"".$s."\" alt=\"".$coderName."\" /></td>\n". " <td class=\"info\">\n". " <h2>".$coderName."</h2>\n"; + // Description block $s = $wizTable[$coderName]["desc"]; if (isset($s)) { + $s = preg_replace("/\~([A-Z][a-z]+)\~/i", "<a href=\"".$_SERVER["PHP_SELF"]."?a=\${1}\">\${1}</a>", $s); + + foreach ($specTags as $tag => $rep) + $s = preg_replace("/\[".$tag."\]/i", $rep, $s); + echo " <p>".$s."</p>\n"; } + // Links, etc. echo " [<a href=\"".fingerURL($coderName)."\">Finger</a>]\n"; $s = $wizTable[$coderName]["homeURL"];