关灯
开启左侧

魔兽管理网页:角色管理页面带3D模型查看_PHP源码

  [复制链接]
admin实名认证 发表于 2016-4-22 23:30:38 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

>资源名称:魔兽管理网页:角色管理页面带3D模型查看_PHP源码

>资源类型:资料共享

>下载帮助:链接失效解压密码吾爱尚玩VIP特权

>本站所有资源均来源于网络,版权归原作者所有,禁止用于一切商业用途。

公告页游平台手游平台金币获取金币充值VIP购买

[资源名称]


魔兽管理网页:角色管理页面带3D模型查看_PHP源码


[资源类型]


资料共享


[资源详情]


 
   内容介绍

下面是一个PHP的魔兽世界私服服务端的用户角色的管理页面。。可以用来查看3D模型。

参考使用:
  1. <?php
  2. if (isset($_POST['action'])) {
  3. $config['ip'] = "localhost";
  4. $config['user'] = "username";
  5. $config['pass'] = "password";
  6. $config['char_db'] = "character222-database";
  7. $config['world_db'] = "world222-database";

  8. $charname = $_POST["name"];

  9. $definebag = "0";
  10. mysql_connect($config['ip'], $config['user'], $config['pass']);
  11. mysql_select_db($config['char_db']);

  12. $sql = mysql_query("SELECT `guid`, `race`, `name`, `level`, `gender`, `playerBytes`, `playerBytes2` FROM `characters` WHERE `name` = '".mysql_real_escape_string($charname)."' LIMIT 1");
  13. $result = mysql_fetch_array($sql);

  14. if (mysql_num_rows($sql)=='0') {
  15. die ("Character not found!");
  16. }

  17. $name = $result['name'];
  18. $level = $result['level'];
  19. $player_guid = $result['guid'];

  20. $b = $result['playerBytes'];
  21. $b2 = $result['playerBytes2'];
  22. $ha = ($b>>16)%256;
  23. $hc = ($b>>24)%256;
  24. $fa = ($b>>8)%256;
  25. $sk = $b%256;
  26. $fh = $b2%256;


  27. $queryinv = mysql_query("SELECT * FROM `character222_inventory` WHERE `guid` = '".mysql_real_escape_string($player_guid)."'");
  28. $queryres = mysql_fetch_array($queryinv);

  29. $slot = $queryres['slot'];
  30. $guid = $queryres['guid'];

  31. // maybe will work

  32. $r1 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '0' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  33. $re1 = mysql_fetch_assoc($r1);
  34. $item_head1 = $re1['item_template'];

  35. $r2 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '1' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  36. $re2 = mysql_fetch_assoc($r2);
  37. $item_neck1 = $re2['item_template'];

  38. $r3 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '2' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  39. $re3 = mysql_fetch_assoc($r3);
  40. $item_shoulder1 = $re3['item_template'];

  41. $r4 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '3' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  42. $re4 = mysql_fetch_array($r4);
  43. $item_shirt1 = $re4['item_template'];

  44. $r5 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '4' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  45. $re5 = mysql_fetch_array($r5);
  46. $item_chest1 = $re5['item_template'];

  47. $r6 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '5' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  48. $re6 = mysql_fetch_array($r6);
  49. $item_belt1 = $re6['item_template'];

  50. $r7 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '6' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  51. $re7 = mysql_fetch_array($r7);
  52. $item_legs1 = $re7['item_template'];

  53. $r8 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '7' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  54. $re8 = mysql_fetch_array($r8);
  55. $item_feet1 = $re8['item_template'];

  56. $r9 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '8' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  57. $re9 = mysql_fetch_array($r9);
  58. $item_wrist1 = $re9['item_template'];

  59. $r10 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '9' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  60. $re10 = mysql_fetch_array($r10);
  61. $item_gloves1 = $re10['item_template'];

  62. $r11 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '10' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  63. $re11 = mysql_fetch_array($r11);
  64. $item_finger1 = $re11['item_template'];

  65. $r12 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '11' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  66. $re12 = mysql_fetch_array($r12);
  67. $item_finger2 = $re12['item_template'];

  68. $r13 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '12' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  69. $re13 = mysql_fetch_array($r13);
  70. $item_trinket1 = $re13['item_template'];

  71. $r14 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '13' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  72. $re14 = mysql_fetch_array($r14);
  73. $item_trinket2 = $re14['item_template'];

  74. $r15 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '14' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  75. $re15 = mysql_fetch_array($r15);
  76. $item_back1 = $re15['item_template'];

  77. $r16 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '15' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  78. $re16 = mysql_fetch_array($r16);
  79. $item_main_hand1 = $re16['item_template'];

  80. $r17 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '16' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  81. $re17 = mysql_fetch_array($r17);
  82. $item_off_hand1 = $re17['item_template'];

  83. $r18 = mysql_query("SELECT * FROM `character222_inventory` WHERE `slot` = '17' AND `bag` = '".$definebag."' AND `guid` = '".mysql_real_escape_string($player_guid)."' LIMIT 1");
  84. $re18 = mysql_fetch_array($r18);
  85. $item_ranged_slot1 = $re18['item_template'];

  86. function wowhead_did($item) {
  87. global $config;
  88. mysql_select_db($config['world_db']);
  89. $sql = mysql_query("SELECT displayid FROM item_template WHERE entry = '".$item."'");
  90. $displayid = mysql_result($sql, 0);

  91. echo $displayid;

  92. }

  93. function char_racegender($race, $gender) {

  94. $char_race = array(
  95. 1 => 'human',
  96. 2 => 'orc',
  97. 3 => 'dwarf',
  98. 4 => 'nightelf',
  99. 5 => 'scourge',
  100. 6 => 'tauren',
  101. 7 => 'gnome',
  102. 8 => 'troll',
  103. 10 => 'bloodelf',
  104. 11 => 'draenei');

  105. $char_gender = array(
  106. 0 => 'male',
  107. 1 => 'female');

  108. echo $char_race[$race].$char_gender[$gender];
  109. }

  110. function inventory_type($inventory) {

  111. $inventory_type = array(
  112. 1 => 'item_head',
  113. 2 => 'item_neck',
  114. 3 => 'item_shoulder',
  115. 4 => 'item_shirt',
  116. 5 => 'item_chest',
  117. 6 => 'item_waist',
  118. 7 => 'item_legs',
  119. 8 => 'item_feet',
  120. 9 => 'item_wrists',
  121. 10 => 'item_hands',
  122. 11 => 'item_finger1',
  123. 11 => 'item_finger2',
  124. 12 => 'item_trinket1',
  125. 12 => 'item_trinket2',
  126. 16 => 'item_back',
  127. 21 => 'item_main_hand',
  128. 22 => 'item_off_hand');

  129. echo $inventory_type[$inventory];
  130. }
  131. }
  132. ?>

  133. <?php
  134. $cont2='
  135. <form action="" method="post">
  136. <table align="center" border="0">

  137. <tr>
  138. <td class="td">
  139. <label for="name">
  140. Character name:</label></td>
  141. <td>
  142. <input type="text" class="select" id="name" maxlength="50" name="name" /><br></td>
  143. </tr>
  144. </table><center><br />
  145. <input type="submit" name="action" value="Search" class="button" />
  146. </form></center>';

  147. print $cont2;
  148. ?>


  149. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  150. <html>
  151. <head>
  152. <meta http-equiv="Pragma" content="no-cache">
  153. <meta http-equiv="Cache-Control" content="no-cache">
  154. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  155. <title>Character Viewer</title>

  156. </head>
  157. <body>
  158. <div id="model_scene" align="center">
  159. <object id="wowhead" type="application/x-shockwave-flash" data="http://static.wowhead.com/modelviewer/ModelView.swf" height="800px" width="600px">
  160. <param name="quality" value="high">
  161. <param name="allowscriptaccess" value="always">
  162. <param name="menu" value="false">
  163. <param value="transparent" name="wmode">
  164. <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); ?>">
  165. <param name="movie" value="http://static.wowhead.com/modelviewer/ModelView.swf">
  166. </object>
  167. </div>
  168. </body>
  169. </html>

  170. <?php
  171. mysql_close();
  172. ?>
复制代码


 

精彩评论2

倒序浏览
fang139842 发表于 2019-12-5 23:49:18 | 显示全部楼层
 
无图无真相,不知道咋个用啊,哈哈
 
pwow 发表于 2019-7-1 13:52:14 | 显示全部楼层
 
不是很懂认真学习
 
VIP介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

5粉丝

3421帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地