Advertisement
Sops

Untitled

Feb 18th, 2016
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.96 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LiF Mapa Interactivo Comunidad Cogollops</title>
  6. <meta name="author" content="MacDante, Kortal, Jakommo">
  7. <meta name="copyright" content="MacDante, Kortal, Jakommo">
  8. <link rel="stylesheet" href="grid.css" />
  9. <style>
  10. * {transition: all 1s ease 0s; margin:0; padding: 0;}
  11. body {background: #0e283d; font-family: 'MedievalSharp', sans-serif; line-height:14px; }
  12. .wrap {width: 100%; height: 1250px; }
  13. .map {width: 1533px;height:1533px; margin: 0px auto; position:relative; background: url('mapv3.jpg');
  14. }
  15. .guild {z-index: 1;cursor:help; text-align: center;color: white; font-size: 14px; opacity: 0.8; position: absolute; margin:0; padding: 0; border: 1px solid yellow; text-shadow: 1px 1px 2px black; box-shadow: 0 0 6px black; background: none; }
  16.  
  17. .guild_name {width: 140px;color: white; font-size: 14px; margin: 0; padding: 0;border-bottom: 0px solid white; font-weight: bold; text-shadow: 1px 1px 1px black; position:absolute; text-align: center; z-index: 100; opacity: 1;}
  18. </style>
  19. </head>
  20.  
  21. <body >
  22. <div class="wrap">
  23. <div class="map">
  24. <?php
  25. include("config.php");
  26.  
  27. $db_handle = mysqli_connect($SERVER, $USER, $PASS);
  28. $db_found = mysqli_select_db($db_handle, $DB);
  29. $db_handle->set_charset("utf8");
  30.  
  31. $sql = "select gl.*, (gl.CenterGeoID >> 18) as terID,(gl.CenterGeoID & ((1 << 9) - 1)) as `x`, ((gl.CenterGeoID >> 9) & ((1 << (9)) - 1)) as `y`, g.Name as guild
  32. from guild_lands as gl
  33. left join guilds g on gl.GuildID=g.ID";
  34.  
  35. $res = mysqli_query($db_handle, $sql) or die("Błąd wykonania: " . mysqli_error($db_handle));
  36. $sum_guild = mysqli_num_rows($res);
  37. while( $row = mysqli_fetch_array($res) ) {
  38. $x=0;
  39. $y=0;
  40. $size = $row['Radius'];
  41. $guild = $row['guild'];
  42. $GuildID = $row['ID'];
  43. if ($row['terID'] == 442) {
  44. $y=1533-$row['y'];
  45. $x=$row['x'];
  46. }
  47. else if ($row['terID'] == 443) {
  48. $y=1533-$row['y'];
  49. $x=$row['x']+511;
  50. }
  51. else if ($row['terID'] == 444) {
  52. $y=1533-$row['y'];
  53. $x=$row['x']+1022;
  54. }
  55. else if ($row['terID'] == 445) {
  56. $y=1022-$row['y'];
  57. $x=$row['x'];
  58. }
  59. else if ($row['terID'] == 446) {
  60. $y=1022-$row['y'];
  61. $x=$row['x']+511;
  62. }
  63. else if ($row['terID'] == 447) {
  64. $y=1022-$row['y'];
  65. $x=$row['x']+1022;
  66. }
  67. else if ($row['terID'] == 448) {
  68. $y=511-$row['y'];
  69. $x=$row['x'];
  70. }
  71. else if ($row['terID'] == 449) {
  72. $y=511-$row['y'];
  73. $x=$row['x']+511;
  74. }
  75. else if ($row['terID'] == 450) {
  76. $y=511-$row['y'];
  77. $x=$row['x']+1022;
  78. }
  79.  
  80.  
  81. $guildname= preg_replace ("/[\"']/", "", $guild);
  82.  
  83.  
  84. $sql = "SELECT Name, LastName FROM `character` WHERE `GuildID` = '$GuildID'";
  85. $result = mysqli_query($db_handle, $sql);
  86. $guildmembers="";
  87. while ( $db_field = mysqli_fetch_assoc($result) )
  88. {
  89. $guildmembers = $guildmembers . $db_field['Name'] . " " . $db_field['LastName'] . ", ";
  90. }
  91. $guildmembers= preg_replace ("/[\"']/", "", $guildmembers);
  92. print "<a class='guild' title='".$guildname. ": ".$guildmembers."' style='border-radius: ".$size."px; width: ".$size."px; height: ".$size."px; left:".($x-($size/2))."px; top: ".($y-($size/2))."px; ' ></a>";
  93. print "<div class='guild_name' style='left:".($x-70)."px !important; top: ".($y-($size/2)-15)."px !important; '>".$guild."</div>";
  94.  
  95. }
  96. print "<div style='position: absolute; margin:0; padding: 0; width: auto; height: auto; left: 1px; top:1533px; color: white; font-size: 10px;'>code by MacDante, update by Kortal, css by Jakommo</div>";
  97.  
  98. $daynumber = date('z');
  99. $infos = "Dia " . $daynumber . ": " . date("F j, Y, g:i a") . "<br />";
  100.  
  101. $sql = "SELECT * FROM `lifdscp_online_character`";
  102. $result = mysqli_query($db_handle, $sql);
  103. if ($result)
  104. {
  105. $playerscount = mysqli_num_rows($result);
  106. $playeronline = "";
  107. while ( $db_field = mysqli_fetch_assoc($result) )
  108. {
  109. $db_tmp = $db_field['CharacterID'];
  110. $sql = "SELECT ID, Name, LastName FROM `character` WHERE `ID` = '$db_tmp'";
  111. $result1 = mysqli_query($db_handle, $sql);
  112. $db_field1 = mysqli_fetch_assoc($result1);
  113. $playeronline = $playeronline . $db_field1['Name'] . " " . $db_field1['LastName'] . ", ";
  114.  
  115. }
  116.  
  117. $infos = $infos . "Jugadores Conectados: " . $playerscount . " (" . $playeronline . ")<br />";
  118. }
  119.  
  120. if (file_exists('./cm_weather1.xml')) {
  121. $data = file_get_contents('./cm_weather1.xml', true);
  122. $pos = strpos($data, "=" . $daynumber .">");
  123. $weather=substr($data, $pos+2+strlen($daynumber), 15);
  124. $weather=substr($weather, 0, strpos($weather,"<"));
  125.  
  126. $daynumber2 = $daynumber + 1;
  127. if ($daynumber == 365) { $daynumber2 = 1;}
  128. $pos = strpos($data, "=" . $daynumber2 .">");
  129. $weather2=substr($data, $pos+2+strlen($daynumber2), 15);
  130. $weather2=substr($weather2, 0, strpos($weather2,"<"));
  131.  
  132. $infos = $infos . "El Tiempo esta " . $weather ." (Mañana estará ". $weather2 . ")<br />";
  133. }
  134.  
  135. echo "<div style='position: absolute; margin:0; padding:5px; width: auto; height: auto; left:75px; top:110px; color: yellow; font-size: 16px; border: 2px solid black;'>" . $infos ."</div>";
  136.  
  137. // Script Player Online
  138. $sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
  139.  
  140. $res = mysqli_query($db_handle, $sql) or die("error: " . mysqli_error($db_handle));
  141. $sum_players=0;
  142. while( $row = mysqli_fetch_array($res) ) {
  143. $x=0;
  144. $y=0;
  145. $size = $_POST['size'];
  146. $name = $row['Name']." ".$row['LastName'];
  147.  
  148. if ($row['terID'] == 442) {
  149. $y=1533-$row['y'];
  150. $x=$row['x'];
  151. }
  152. else if ($row['terID'] == 443) {
  153. $y=1533-$row['y'];
  154. $x=$row['x']+511;
  155. }
  156. else if ($row['terID'] == 444) {
  157. $y=1533-$row['y'];
  158. $x=$row['x']+1022;
  159. }
  160. else if ($row['terID'] == 445) {
  161. $y=1022-$row['y'];
  162. $x=$row['x'];
  163. }
  164. else if ($row['terID'] == 446) {
  165. $y=1022-$row['y'];
  166. $x=$row['x']+511;
  167. }
  168. else if ($row['terID'] == 447) {
  169. $y=1022-$row['y'];
  170. $x=$row['x']+1022;
  171. }
  172. else if ($row['terID'] == 448) {
  173. $y=511-$row['y'];
  174. $x=$row['x'];
  175. }
  176. else if ($row['terID'] == 449) {
  177. $y=511-$row['y'];
  178. $x=$row['x']+511;
  179. }
  180. else if ($row['terID'] == 450) {
  181. $y=511-$row['y'];
  182. $x=$row['x']+1022;
  183. }
  184. print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
  185. }
  186. print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
  187. ?>
  188. </div>
  189. </div>
  190. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement