Hadeszeus
New member
Guys, I'm currently working on my CP using FLUX. I'm having problem changing the output text OFFLINE/ONLINE in MAP SERVER STATUS.
Here's the original code:
<table><?php foreach ($serverStatus as $privServerName => $gameServers): ?> <?php foreach ($gameServers as $serverName => $gameServer): ?> <tr> <th class="server"><?php echo htmlspecialchars($serverName) ?></th> <td class="status-login"><?php echo $this->serverUpDown($gameServer['loginServerUp'])?></td> <td class="status-char"><?php echo $this->serverUpDown($gameServer['charServerUp']) ?></td> <td class="status-map"><?php echo $this->serverUpDown($gameServer['mapServerUp']) ?></td> <td class="status-online"><?php echo $gameServer['playersOnline'] ?></td> </tr> <?php endforeach ?></table>
Here's my if statement to change the text to image (I used text to echo the return value for testing purposes only.)
The problem is even if the server is Offline the status still display green text instead of red
<td class="status-login"><?php if($this->serverUpDown($gameServer['loginServerUp']) == "Offline") {echo "red";} else {echo "green";}?></td>
Any thoughts? Thanks!
Here's the original code:
<table><?php foreach ($serverStatus as $privServerName => $gameServers): ?> <?php foreach ($gameServers as $serverName => $gameServer): ?> <tr> <th class="server"><?php echo htmlspecialchars($serverName) ?></th> <td class="status-login"><?php echo $this->serverUpDown($gameServer['loginServerUp'])?></td> <td class="status-char"><?php echo $this->serverUpDown($gameServer['charServerUp']) ?></td> <td class="status-map"><?php echo $this->serverUpDown($gameServer['mapServerUp']) ?></td> <td class="status-online"><?php echo $gameServer['playersOnline'] ?></td> </tr> <?php endforeach ?></table>
Here's my if statement to change the text to image (I used text to echo the return value for testing purposes only.)
The problem is even if the server is Offline the status still display green text instead of red
<td class="status-login"><?php if($this->serverUpDown($gameServer['loginServerUp']) == "Offline") {echo "red";} else {echo "green";}?></td>
Any thoughts? Thanks!
Last edited by a moderator: