forked from ThatCasualMatt/OpenParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgalaxyfeedback.php
More file actions
108 lines (99 loc) · 5.28 KB
/
Copy pathgalaxyfeedback.php
File metadata and controls
108 lines (99 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
header("Access-Control-Allow-Origin: *");
//INCLUDE THE CONFIGURATION / CONNECT TO DATABASE
include('config.php');
//GET URL VARIABLES FROM URL AND SET OTHER VARIABLES
$player = mysql_real_escape_string($_GET['player']);
$currentplanet = mysql_real_escape_string($_GET['cp']);
$req = mysql_real_escape_string($_GET['req']);
$galaxy = mysql_real_escape_string($_GET['g']);
$system = mysql_real_escape_string($_GET['s']);
$slot = mysql_real_escape_string($_GET['slot']);
$slot .= "h";
if($req === 'hephsearch') {
$hephsearch = mysql_query("SELECT player FROM heph_tracker WHERE galaxy='".$galaxy."' AND system='".$system."' AND slot='".$slot."' ORDER BY timeupdated DESC LIMIT 1");
$hephresultcount = mysql_num_rows($hephsearch);
if($hephresultcount === 0) {
$noresults = 1;
} else {
$player = mysql_result($hephsearch, 0);
}
}
$results = mysql_query("SELECT * FROM planets WHERE player='".$player."' AND slot NOT LIKE '%e' AND slot NOT LIKE '' ORDER BY galaxy ASC, system ASC, slot ASC");
$resultscount = mysql_num_rows($results);
if($resultscount === 0) {
$noresults = 1;
}
$hephresults = mysql_query("SELECT * FROM heph_tracker WHERE player='".$player."' ORDER BY timeupdated DESC LIMIT 10");
$hephresultcount = mysql_num_rows($hephresults);
if($is_uni !== 'sde'){
echo'
<head>
<style type="text/css">
#intelpop a {
color: #00D5FF;
outline: 0;
text-decoration: none;
}
#intelpop a:hover {
color: #00D5FF;
text-decoration: underline;
}
</style>
</head>'; }
if ($noresults === 1) { echo 'No data available!';
} else {
echo '<strong><a class="content" href="http://'.$_SERVER['SERVER_NAME'].'/search.php?cp='.$currentplanet.'&search=p&exact=true&query='.htmlspecialchars(stripslashes(stripslashes($player))).'" target="_blank">'.htmlspecialchars(stripslashes(stripslashes($player))).'</a></strong>';
echo '
<table cellspacing="20px" width="100%">
<tr><td valign="top">
<table width="100%">
<thead><tr>
<th align="left">Colony</th>
<th> </th>
<th align="right">Coords</td>
</tr></thead><tbody>';
while($planets = mysql_fetch_assoc($results)){
echo "<td>".htmlspecialchars(stripslashes($planets['planet']));
if(preg_match('[m]', $planets['slot'])) {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/moon.png" border="0" style="height:10px;width:10px">';
} elseif(preg_match('[h]', $planets['slot'])) {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/';if($is_uni === 'sde' || $is_uni === 'sden'){echo'sde';} else{echo'sfc';}echo'_roaming_planet.png" border="0" style="height:10px;width:10px">';
} elseif(($is_uni === 'guns') && (preg_match('[t]', $planets['slot']))) {
if ($planets['planet'] === 'Advanced Factory') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/advanced_factory.png" border="0" style="height:10px;width:10px">';
} elseif ($planets['planet'] === 'Alien Experiment') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/alien_experiment.png" border="0" style="height:10px;width:10px">';
} elseif ($planets['planet'] === 'Alien Space Dock') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/alien_space_dock.png" border="0" style="height:10px;width:10px">';
} elseif ($planets['planet'] === 'Labor') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/labor.png" border="0" style="height:10px;width:10px">';
} elseif ($planets['planet'] === 'Missile Silo') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/missile_silo.png" border="0" style="height:10px;width:10px">';
} elseif ($planets['planet'] === 'Resource Vault') {
echo ' <img src="http://'.$_SERVER['SERVER_NAME'].'/assets/img/resource_vault.png" border="0" style="height:10px;width:10px">';
}
}
echo "</td><td> </td>";
echo "<td align=\"right\"><a href=".$game_url."/galaxy/show?current_planet=".$currentplanet."&galaxy=".$planets['galaxy']."&solar_system=".$planets['system'].">[".$planets['galaxy'].":".$planets['system'].":".$planets['slot']."]</a></span></td>
</tr>";}
echo '<tr><td colspan="3"><center><a href="http://'.$_SERVER['SERVER_NAME'].'/search.php?cp='.$currentplanet.'&search=p&exact=true&query='.$player.'" target="_blank">View tracking data</a>.</strong></center></td></tr>';
echo"</tbody></table>
</td>";
if($hephresultcount > 0){
echo'<td> </td><td valign="top"><table width="100%">
<thead><tr>
<th align="left">'; if($is_uni === 'sde' || $is_uni === 'sden'){echo "Titan ";} else {echo "Heph ";} echo 'Location</th>
<th> </th>
<th align="right">Time Seen</th></tr></thead><tbody>';
while($hephs = mysql_fetch_assoc($hephresults)){
echo "<tr><td><a href=".$game_url."/galaxy/show?current_planet=".$currentplanet."&galaxy=".$hephs['galaxy']."&solar_system=".$hephs['system'].">[".$hephs['galaxy'].":".$hephs['system'].":".$hephs['slot']."]</a></td><td> </td>";
echo "<td>".date("m-d-Y H:i:s",$hephs['timeupdated'])."</td></tr>";
}
if($hephresultcount === 10){
echo '<tr><td colspan="3"><center><a href="http://'.$_SERVER['SERVER_NAME'].'/search.php?cp='.$currentplanet.'&search=h&exact=true&query='.$player.'" target="_blank">View more locations</a>.</center></td></tr>';}
echo '</tbody></table>';
}
echo'</td></tr></table>';}
include('foot2include.php');
?>