From: Anders R. <ma...@us...> - 2007-03-31 13:25:07
|
Update of /cvsroot/planeshift/planeshift/www/serverconsole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31214/www/serverconsole Modified Files: util.php Log Message: - Updated WC for better handling of regions for NPCs - Modified create simple NPC to specify fields in the insert statement so that a DB change dosn't break the insert. - Updated help to descripbe the first part of /waypoint path format [first]. Index: util.php =================================================================== RCS file: /cvsroot/planeshift/planeshift/www/serverconsole/util.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** util.php 28 Dec 2006 22:20:01 -0000 1.33 --- util.php 31 Mar 2007 13:25:04 -0000 1.34 *************** *** 317,320 **** --- 317,343 ---- } + function SelectRegion($current_region,$select_name){ + printf("<SELECT name=%s>", $select_name); + $query_events = "select distinct type_id, t.name from sc_locations, sc_location_type t where id_prev_loc_in_region != -1 and t.id=type_id"; + $result = mysql_query2($query_events); + printf("<OPTION selected value=\"-1\">None(-1)</OPTION>"); + while ($list = mysql_fetch_array($result, MYSQL_NUM)){ + if ($list[0] == $current_region || $list[1] == $current_region){ + printf("<OPTION selected value=\"%s\">%s(%s)</OPTION>", $list[0], $list[1], $list[0]); + }else{ + printf("<OPTION value=\"%s\">%s(%s)</OPTION>", $list[0], $list[1], $list[0]); + } + } + printf("</SELECT>"); + } + + function GetRegionName($region_id) + { + $query = "select name from sc_location_type where id='$region_id'"; + $result = mysql_query2($query); + $list = mysql_fetch_array($result, MYSQL_NUM); + return $list[0]; + } + function getDataFromArea($area) { *************** *** 562,564 **** } ! ?> \ No newline at end of file --- 585,587 ---- } ! ?> |