From: Hendrik B. <nh...@us...> - 2009-11-14 12:17:51
|
Update of /cvsroot/arianne/stendhal_website/scripts In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23285/scripts Modified Files: urlrewrite.php npcs.php Log Message: use nice urls for npc images Index: urlrewrite.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/scripts/urlrewrite.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** urlrewrite.php 14 Nov 2009 09:35:17 -0000 1.3 --- urlrewrite.php 14 Nov 2009 12:15:00 -0000 1.4 *************** *** 51,56 **** ! if (preg_match('|^/images/outfit/(.*)\.png$|', $url)) { ! return preg_replace('|^/images/outfit/(.*)\.png$|', '/createoutfit.php?outfit=$1', $url); } } --- 51,61 ---- ! if (preg_match('|^/images/.*|', $url)) { ! if (preg_match('|^/images/outfit/(.*)\.png$|', $url)) { ! return preg_replace('|^/images/outfit/(.*)\.png$|', '/createoutfit.php?outfit=$1', $url); ! } ! if (preg_match('|^/images/npc/(.*)\.png$|', $url)) { ! return preg_replace('|^/images/npc/(.*)\.png$|', 'monsterimage.php?url=data/sprites/npc/$1.png', $url); ! } } } Index: npcs.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/scripts/npcs.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** npcs.php 14 Nov 2009 09:45:17 -0000 1.12 --- npcs.php 14 Nov 2009 12:15:01 -0000 1.13 *************** *** 40,48 **** $this->class=$class; $this->outfit=$outfit; ! $imagefile = 'monsterimage.php?url=data/sprites/npc/'.$class.'.png'; if (isset($outfit) && $outfit != '') { ! $imagefile = rewriteURL('/images/outfit/'.urlencode($outfit).'.png'); } ! $this->imagefile=$imagefile; $this->level=$level; $this->hp=$hp; --- 40,48 ---- $this->class=$class; $this->outfit=$outfit; ! $imagefile = '/images/npc/'.$class.'.png'; if (isset($outfit) && $outfit != '') { ! $imagefile = '/images/outfit/'.urlencode($outfit).'.png'; } ! $this->imagefile=rewriteURL($imagefile); $this->level=$level; $this->hp=$hp; |