Changeset 142 for minimanager/char.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/char.php
r19 r142 18 18 //######################################################################################################################## 19 19 function char_main() { 20 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $ mangos_db, $realm_id, $user_lvl,20 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 21 21 $user_name, $item_datasite, $server, $user_id; 22 22 23 23 if (empty($_GET['id'])) error($lang_global['empty_fields']); 24 24 25 25 $sql = new SQL; 26 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);26 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 27 27 28 28 $id = $sql->quote_smart($_GET['id']); … … 38 38 $owner_name = $sql->result($query, 0, 'username'); 39 39 40 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);41 40 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 41 42 42 if( !$user_lvl && !$server[$realm_id]['both_factions']){ 43 43 $side_p = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2; … … 51 51 $side_p = 0; 52 52 } 53 53 54 54 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)){ 55 55 … … 273 273 else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border\" alt=\"\" />"; 274 274 $output .= "</td> 275 275 276 276 <td>"; 277 277 if (!empty($equiped_items[14][1])) $output .= maketooltip("<img src=\"{$equiped_items[14][1]}\" class=\"icon_border\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]}", $equiped_items[14][0], "item_tooltip", "target=\"_blank\""); … … 323 323 $output .= "</td></tr> 324 324 </table><br /></center>"; 325 325 326 326 //end of admin options 327 327 } else { … … 346 346 //######################################################################################################################## 347 347 function char_inv() { 348 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $ mangos_db, $realm_id, $user_lvl,348 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 349 349 $user_name,$item_datasite; 350 350 … … 352 352 353 353 $sql = new SQL; 354 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);354 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 355 355 356 356 $id = $sql->quote_smart($_GET['id']); … … 367 367 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 368 368 369 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);369 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 370 370 371 371 $result = $sql->query("SELECT name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) FROM `character` WHERE guid = '$id'"); … … 380 380 4=>array() 381 381 ); 382 382 383 383 $bank = array( 384 384 0=>array(), … … 391 391 7=>array() 392 392 ); 393 393 394 394 $bank_bag_id = array(); 395 395 $bag_id = array(); 396 396 $equiped_bag_id = array(0,0,0,0,0); 397 397 $equip_bnk_bag_id = array(0,0,0,0,0,0,0,0); 398 398 399 399 400 400 while ($slot = $sql->fetch_row($result)) … … 405 405 { 406 406 $bag_id[$slot[2]] = ($slot[1]-18); 407 $equiped_bag_id[$slot[1]-18] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM item_templateWHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));407 $equiped_bag_id[$slot[1]-18] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots')); 408 408 } 409 409 elseif($slot[1] < 39) // SLOT 23 TO 38 (BackPack) … … 420 420 { 421 421 $bank_bag_id[$slot[2]] = ($slot[1]-66); 422 $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM item_templateWHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));422 $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots')); 423 423 } 424 424 } … … 479 479 </tr> 480 480 <tr>"; 481 481 482 482 for($t = 1; $t < count($bag); $t++){ 483 483 $output .= "<td class=\"bag\" valign=\"bottom\" align=\"center\"> 484 484 <div style=\"width:".(4*43)."px;height:".(ceil($equiped_bag_id[$t][1]/4)*41)."px;\">"; 485 485 486 486 $dsp = $equiped_bag_id[$t][1]%4; 487 487 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; … … 513 513 $output .= "</div>"; 514 514 } 515 515 516 516 $money_gold = (int)($char[3]/10000); 517 517 $money_silver = (int)(($char[3]-$money_gold*10000)/100); 518 $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100); 518 $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100); 519 519 520 520 $output .= "</div> … … 526 526 </b> 527 527 "; 528 528 529 529 $output .= "</div> 530 530 </td> … … 537 537 $output .= "</div>"; 538 538 } 539 539 540 540 $output .= "</div> 541 541 </td> … … 565 565 </tr> 566 566 <tr>"; 567 567 568 568 for($t=1; $t < count($bank); $t++){ 569 569 if($t==5){ … … 590 590 <tr>"; 591 591 } 592 592 593 593 $output .= "<td class=\"bank\" align=\"center\"> 594 594 <div style=\"width:".(4*43)."px;height:".(ceil($equip_bnk_bag_id[$t][1]/4)*41)."px;\">"; 595 595 596 596 $dsp=$equip_bnk_bag_id[$t][1]%4; 597 597 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; … … 635 635 //######################################################################################################################## 636 636 function char_quest(){ 637 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $ mangos_db, $realm_id, $user_lvl,637 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 638 638 $user_name, $quest_datasite; 639 639 … … 641 641 642 642 $sql = new SQL; 643 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);643 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 644 644 645 645 $id = $sql->quote_smart($_GET['id']); … … 651 651 if ($sql->num_rows($result)){ 652 652 $char = $sql->fetch_row($result); 653 653 654 654 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 655 655 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'"); … … 658 658 659 659 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 660 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);660 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 661 661 662 662 $result = $sql->query("SELECT quest,status FROM character_queststatus WHERE guid ='$id' AND ( status = 3 OR status = 1 ) ORDER BY status DESC"); … … 683 683 $quests_1 = array(); 684 684 $quests_3 = array(); 685 685 686 686 if ($sql->num_rows($result)){ 687 687 while ($quest = $sql->fetch_row($result)){ 688 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_templateWHERE entry ='$quest[0]'");688 $query1 = $sql->query("SELECT QuestLevel,Title FROM `".$mangos_db[$realm_id]['name']."`.`quest_template` WHERE entry ='$quest[0]'"); 689 689 $quest_info = $sql->fetch_row($query1); 690 690 if($quest[1]==1) … … 695 695 aasort($quests_1, $order_by, $dir); 696 696 aasort($quests_3, $order_by, $dir); 697 697 698 698 foreach ($quests_3 as $data){ 699 699 $output .= "<tr>"; … … 703 703 <td><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" /></td></tr>"; 704 704 } 705 705 706 706 if(count($quests_1)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "4" : "3")."\" align=\"left\"></th></tr>"; 707 707 foreach ($quests_1 as $data){ … … 712 712 <td><img src=\"img/aff_tick.png\" width=\"14\" height=\"14\" /></td></tr>"; 713 713 } 714 714 715 715 } else $output .= "<tr><td colspan=\"".($user_lvl ? "4" : "3")."\"><p>{$lang_char['no_act_quests']}</p></td></tr>"; 716 716 … … 747 747 //######################################################################################################################## 748 748 function char_rep() { 749 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $ mangos_db, $realm_id, $user_lvl,749 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 750 750 $user_name, $fact_id; 751 751 … … 753 753 754 754 $sql = new SQL; 755 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);755 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 756 756 757 757 $id = $sql->quote_smart($_GET['id']); … … 767 767 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 768 768 769 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);769 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 770 770 $result = $sql->query("SELECT faction, standing, flags FROM character_reputation WHERE guid ='$id' AND (flags = 1 OR flags = 17)"); 771 771 … … 805 805 <tr><th colspan=\"2\" align=\"left\">Unknown</th></tr>",0) 806 806 ); 807 807 808 808 if ($sql->num_rows($result)){ 809 809 while ($fact = $sql->fetch_row($result)){ … … 846 846 //######################################################################################################################## 847 847 function char_skill() { 848 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $ mangos_db, $realm_id, $user_lvl,848 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 849 849 $user_name, $skill_datasite; 850 850 … … 852 852 853 853 $sql = new SQL; 854 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);854 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 855 855 856 856 $id = $sql->quote_smart($_GET['id']); … … 870 870 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 871 871 872 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);872 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 873 873 874 874 $result = $sql->query("SELECT data,name,race,class,CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character` WHERE guid = '$id'"); … … 890 890 891 891 <table class=\"lined\" style=\"width: 550px;\"> 892 <tr> 892 <tr> 893 893 <th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['skills']}</th></tr> 894 894 <tr>" … … 898 898 </tr>"; 899 899 require_once("scripts/id_tab.php"); 900 900 901 901 $prof_1_array = array(); 902 902 $prof_2_array = array(); 903 903 $skill_array = array(); 904 904 905 905 $skill_rank_array = array( 906 906 75 => $lang_char['apprentice'], … … 917 917 $temp = unpack("S", pack("L", $char_data[$i+1])); 918 918 $skill = ($char_data[$i] & 0x0000FFFF); 919 919 920 920 if( $skill == 185 || $skill == 129 || $skill == 356 || $skill == 762) 921 921 { … … 940 940 aasort($prof_1_array, $order_by, $dir); 941 941 aasort($prof_2_array, $order_by, $dir); 942 942 943 943 foreach ($skill_array as $data){ 944 944 $max = ($data[2] < $char[4]*5) ? $char[4]*5 : $data[2]; … … 951 951 </tr>"; 952 952 } 953 953 954 954 if(count($prof_1_array)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['professions']} 1º</th></tr>"; 955 955 foreach ($prof_1_array as $data){
Note:
See TracChangeset
for help on using the changeset viewer.