Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta charset="utf-8">
- <title>LiF Mapa Interactivo Comunidad Cogollops</title>
- <meta name="author" content="MacDante, Kortal, Jakommo">
- <meta name="copyright" content="MacDante, Kortal, Jakommo">
- <link rel="stylesheet" href="grid.css" />
- <style>
- * {transition: all 1s ease 0s; margin:0; padding: 0;}
- body {background: #0e283d; font-family: 'MedievalSharp', sans-serif; line-height:14px; }
- .wrap {width: 100%; height: 1250px; }
- .map {width: 1533px;height:1533px; margin: 0px auto; position:relative; background: url('mapv3.jpg');
- }
- .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; }
- .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;}
- </style>
- </head>
- <body >
- <div class="wrap">
- <div class="map">
- <?php
- include("config.php");
- $db_handle = mysqli_connect($SERVER, $USER, $PASS);
- $db_found = mysqli_select_db($db_handle, $DB);
- $db_handle->set_charset("utf8");
- $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
- from guild_lands as gl
- left join guilds g on gl.GuildID=g.ID";
- $res = mysqli_query($db_handle, $sql) or die("Błąd wykonania: " . mysqli_error($db_handle));
- $sum_guild = mysqli_num_rows($res);
- while( $row = mysqli_fetch_array($res) ) {
- $x=0;
- $y=0;
- $size = $row['Radius'];
- $guild = $row['guild'];
- $GuildID = $row['ID'];
- if ($row['terID'] == 442) {
- $y=1533-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 443) {
- $y=1533-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 444) {
- $y=1533-$row['y'];
- $x=$row['x']+1022;
- }
- else if ($row['terID'] == 445) {
- $y=1022-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 446) {
- $y=1022-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 447) {
- $y=1022-$row['y'];
- $x=$row['x']+1022;
- }
- else if ($row['terID'] == 448) {
- $y=511-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 449) {
- $y=511-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 450) {
- $y=511-$row['y'];
- $x=$row['x']+1022;
- }
- $guildname= preg_replace ("/[\"']/", "", $guild);
- $sql = "SELECT Name, LastName FROM `character` WHERE `GuildID` = '$GuildID'";
- $result = mysqli_query($db_handle, $sql);
- $guildmembers="";
- while ( $db_field = mysqli_fetch_assoc($result) )
- {
- $guildmembers = $guildmembers . $db_field['Name'] . " " . $db_field['LastName'] . ", ";
- }
- $guildmembers= preg_replace ("/[\"']/", "", $guildmembers);
- 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>";
- print "<div class='guild_name' style='left:".($x-70)."px !important; top: ".($y-($size/2)-15)."px !important; '>".$guild."</div>";
- }
- 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>";
- $daynumber = date('z');
- $infos = "Dia " . $daynumber . ": " . date("F j, Y, g:i a") . "<br />";
- $sql = "SELECT * FROM `lifdscp_online_character`";
- $result = mysqli_query($db_handle, $sql);
- if ($result)
- {
- $playerscount = mysqli_num_rows($result);
- $playeronline = "";
- while ( $db_field = mysqli_fetch_assoc($result) )
- {
- $db_tmp = $db_field['CharacterID'];
- $sql = "SELECT ID, Name, LastName FROM `character` WHERE `ID` = '$db_tmp'";
- $result1 = mysqli_query($db_handle, $sql);
- $db_field1 = mysqli_fetch_assoc($result1);
- $playeronline = $playeronline . $db_field1['Name'] . " " . $db_field1['LastName'] . ", ";
- }
- $infos = $infos . "Jugadores Conectados: " . $playerscount . " (" . $playeronline . ")<br />";
- }
- if (file_exists('./cm_weather1.xml')) {
- $data = file_get_contents('./cm_weather1.xml', true);
- $pos = strpos($data, "=" . $daynumber .">");
- $weather=substr($data, $pos+2+strlen($daynumber), 15);
- $weather=substr($weather, 0, strpos($weather,"<"));
- $daynumber2 = $daynumber + 1;
- if ($daynumber == 365) { $daynumber2 = 1;}
- $pos = strpos($data, "=" . $daynumber2 .">");
- $weather2=substr($data, $pos+2+strlen($daynumber2), 15);
- $weather2=substr($weather2, 0, strpos($weather2,"<"));
- $infos = $infos . "El Tiempo esta " . $weather ." (Mañana estará ". $weather2 . ")<br />";
- }
- 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>";
- // Script Player Online
- $sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
- $res = mysqli_query($db_handle, $sql) or die("error: " . mysqli_error($db_handle));
- $sum_players=0;
- while( $row = mysqli_fetch_array($res) ) {
- $x=0;
- $y=0;
- $size = $_POST['size'];
- $name = $row['Name']." ".$row['LastName'];
- if ($row['terID'] == 442) {
- $y=1533-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 443) {
- $y=1533-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 444) {
- $y=1533-$row['y'];
- $x=$row['x']+1022;
- }
- else if ($row['terID'] == 445) {
- $y=1022-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 446) {
- $y=1022-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 447) {
- $y=1022-$row['y'];
- $x=$row['x']+1022;
- }
- else if ($row['terID'] == 448) {
- $y=511-$row['y'];
- $x=$row['x'];
- }
- else if ($row['terID'] == 449) {
- $y=511-$row['y'];
- $x=$row['x']+511;
- }
- else if ($row['terID'] == 450) {
- $y=511-$row['y'];
- $x=$row['x']+1022;
- }
- print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
- }
- print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
- ?>
- </div>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement