[资源名称]
魔兽管理网页:角色管理页面带3D模型查看_PHP源码
[资源类型]
资料共享
[资源详情]
下面是一个PHP的魔兽世界私服服务端的用户角色的管理页面。。可以用来查看3D模型。
参考使用:- <?php
- if (isset($_POST['action'])) {
- $config['ip'] = "localhost";
- $config['user'] = "username";
- $config['pass'] = "password";
- $config['char_db'] = "character222-database";
- $config['world_db'] = "world222-database";
- $charname = $_POST["name"];
- $definebag = "0";
- mysql_connect($config['ip'], $config['user'], $config['pass']);
- mysql_select_db($config['char_db']);
- $sql = mysql_query("SELECT `guid`, `race`, `name`, `level`, `gender`, `playerBytes`, `playerBytes2` FROM `characters` WHERE `name` = '".mysql_real_escape_string($charname)."' LIMIT 1");
- $result = mysql_fetch_array($sql);
- if (mysql_num_rows($sql)=='0') {
- die ("Character not found!");
- }
- $name = $result['name'];
- $level = $result['level'];
- $player_guid = $result['guid'];
- $b = $result['playerBytes'];
- $b2 = $result['playerBytes2'];
- $ha = ($b>>16)%256;
- $hc = ($b>>24)%256;
- $fa = ($b>>8)%256;
- $sk = $b%256;
- $fh = $b2%256;
- $queryinv = mysql_query("SELECT * FROM `character222_inventory` WHERE `guid` = '".mysql_real_escape_string($player_guid)."'");
- $queryres = mysql_fetch_array($queryinv);
- $slot = $queryres['slot'];
- $guid = $queryres['guid'];
- // maybe will work
- $r1 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '0' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re1 = mysql_fetch_assoc($r1);
- $item_head1 = $re1['item_template'];
- $r2 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '1' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re2 = mysql_fetch_assoc($r2);
- $item_neck1 = $re2['item_template'];
- $r3 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '2' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re3 = mysql_fetch_assoc($r3);
- $item_shoulder1 = $re3['item_template'];
- $r4 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '3' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re4 = mysql_fetch_array($r4);
- $item_shirt1 = $re4['item_template'];
- $r5 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '4' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re5 = mysql_fetch_array($r5);
- $item_chest1 = $re5['item_template'];
- $r6 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '5' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re6 = mysql_fetch_array($r6);
- $item_belt1 = $re6['item_template'];
- $r7 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '6' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re7 = mysql_fetch_array($r7);
- $item_legs1 = $re7['item_template'];
- $r8 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '7' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re8 = mysql_fetch_array($r8);
- $item_feet1 = $re8['item_template'];
- $r9 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '8' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re9 = mysql_fetch_array($r9);
- $item_wrist1 = $re9['item_template'];
- $r10 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '9' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re10 = mysql_fetch_array($r10);
- $item_gloves1 = $re10['item_template'];
- $r11 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '10' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re11 = mysql_fetch_array($r11);
- $item_finger1 = $re11['item_template'];
- $r12 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '11' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re12 = mysql_fetch_array($r12);
- $item_finger2 = $re12['item_template'];
- $r13 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '12' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re13 = mysql_fetch_array($r13);
- $item_trinket1 = $re13['item_template'];
- $r14 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '13' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re14 = mysql_fetch_array($r14);
- $item_trinket2 = $re14['item_template'];
- $r15 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '14' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re15 = mysql_fetch_array($r15);
- $item_back1 = $re15['item_template'];
- $r16 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '15' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re16 = mysql_fetch_array($r16);
- $item_main_hand1 = $re16['item_template'];
- $r17 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '16' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re17 = mysql_fetch_array($r17);
- $item_off_hand1 = $re17['item_template'];
- $r18 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '17' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
- $re18 = mysql_fetch_array($r18);
- $item_ranged_slot1 = $re18['item_template'];
- function wowhead_did($item) {
- global $config;
- mysql_select_db($config['world_db']);
- $sql = mysql_query("SELECT displayid FROM item_template WHERE entry = '".$item."'");
- $displayid = mysql_result($sql, 0);
- echo $displayid;
- }
- function char_racegender($race, $gender) {
- $char_race = array(
- 1 => 'human',
- 2 => 'orc',
- 3 => 'dwarf',
- 4 => 'nightelf',
- 5 => 'scourge',
- 6 => 'tauren',
- 7 => 'gnome',
- 8 => 'troll',
- 10 => 'bloodelf',
- 11 => 'draenei');
- $char_gender = array(
- 0 => 'male',
- 1 => 'female');
- echo $char_race[$race].$char_gender[$gender];
- }
- function inventory_type($inventory) {
- $inventory_type = array(
- 1 => 'item_head',
- 2 => 'item_neck',
- 3 => 'item_shoulder',
- 4 => 'item_shirt',
- 5 => 'item_chest',
- 6 => 'item_waist',
- 7 => 'item_legs',
- 8 => 'item_feet',
- 9 => 'item_wrists',
- 10 => 'item_hands',
- 11 => 'item_finger1',
- 11 => 'item_finger2',
- 12 => 'item_trinket1',
- 12 => 'item_trinket2',
- 16 => 'item_back',
- 21 => 'item_main_hand',
- 22 => 'item_off_hand');
- echo $inventory_type[$inventory];
- }
- }
- ?>
- <?php
- $cont2='
- <form action="" method="post">
- <table align="center" border="0">
- <tr>
- <td class="td">
- <label for="name">
- Character name:</label></td>
- <td>
- <input type="text" class="select" id="name" maxlength="50" name="name" /><br></td>
- </tr>
- </table><center><br />
- <input type="submit" name="action" value="Search" class="button" />
- </form></center>';
- print $cont2;
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="Cache-Control" content="no-cache">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Character Viewer</title>
- </head>
- <body>
- <div id="model_scene" align="center">
- <object id="wowhead" type="application/x-shockwave-flash" data="http://static.wowhead.com/modelviewer/ModelView.swf" height="800px" width="600px">
- <param name="quality" value="high">
- <param name="allowscriptaccess" value="always">
- <param name="menu" value="false">
- <param value="transparent" name="wmode">
- <param name="flashvars" value="model=<?php char_racegender($result['race'], $result['gender']); ?>&modelType=16&ha=<?php echo $ha;?>&hc=<?php echo $hc;?>&fa=<?php echo $fa;?>&sk=<?php echo $sk;?>&fh=<?php echo $fh;?>&fc=0&contentPath=http://static.wowhead.com/modelviewer/&blur=0&equipList=1,<?php wowhead_did($item_head1); ?>,3,<?php wowhead_did($item_shoulder1); ?>,16,<?php wowhead_did($item_back1); ?>,5,<?php wowhead_did($item_chest1); ?>,9,<?php wowhead_did($item_wrist1); ?>,10,<?php wowhead_did($item_gloves1); ?>,6,<?php wowhead_did($item_belt1); ?>,7,<?php wowhead_did($item_legs1); ?>,8,<?php wowhead_did($item_feet1); ?>,14,<?php wowhead_did($item_off_hand1); ?>,21,<?php wowhead_did($item_main_hand1); ?>">
- <param name="movie" value="http://static.wowhead.com/modelviewer/ModelView.swf">
- </object>
- </div>
- </body>
- </html>
- <?php
- mysql_close();
- ?>
复制代码
|
|