Changeset 19 for minimanager/pomm/pomm_run.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/pomm/pomm_run.php
r5 r19 14 14 $JsHttpRequest =& new JsHttpRequest($site_encoding); 15 15 16 $ mysql = new MySQL;17 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);16 $sql = new SQL; 17 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 18 18 19 19 if( !$user_lvl && !$server[$realm_id]['both_factions']){ 20 $result = $ mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");21 if ($ mysql->num_rows($result)){22 $order_side = (in_array($ mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?20 $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1"); 21 if ($sql->num_rows($result)){ 22 $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 23 23 " AND race IN (2,5,6,8,10) " : " AND race IN (1,3,4,7,11) "; 24 24 } else $order_side = ""; 25 25 } else $order_side = ""; 26 26 27 $result = $ mysql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),28 SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1) 27 $result = $sql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1), 28 SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1),zone 29 29 FROM `character` WHERE `online`= 1 $order_side"); 30 30 31 31 $i = 0; 32 while($char = $ mysql->fetch_row($result)){32 while($char = $sql->fetch_row($result)){ 33 33 $char_gender = str_pad(dechex($char[7]),8, 0, STR_PAD_LEFT); 34 34 35 $pos = get_player_position($char[3],$char[4],$char[5] );35 $pos = get_player_position($char[3],$char[4],$char[5],$char[8]); 36 36 $arr[$i]['x'] = $pos['x']; 37 37 $arr[$i]['y'] = $pos['y']; 38 38 $arr[$i]['name'] = $char[0]; 39 if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[ 5], $char[3], $char[4]));39 if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[8])); 40 40 else $arr[$i]['zone'] = ereg_replace("'", "`", get_map_name($char[5])); 41 41 $arr[$i]['cl'] = $char[2]; … … 46 46 } 47 47 48 $ mysql->close();48 $sql->close(); 49 49 50 50 $_RESULT =$arr;
Note:
See TracChangeset
for help on using the changeset viewer.