Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php /* * Funkcija serverio ping'inimui */ function pingDomain($server, &$port) { $start_time = microtime(true); $file = @fsockopen ($server, $port, $errno, $errstr, 10); $stop_time = microtime(true); $status = 0; if(!$file) { $status = -1; } else { fclose($file); $status = ($stop_time - $start_time) * 12000; $status = floor($status); } return $status; } /* * Funkcija serverio būklei pagal ping nustatyti */ function server_status($ping = 0) { if($ping <= 50) { $MessageStatus = 'Great'; } elseif($ping <= 80) { $MessageStatus = 'Good'; } elseif($ping <= 100) { $MessageStatus = 'OK'; } elseif($ping <= 150) { $MessageStatus = 'Bad'; } elseif($ping <= 999) { $MessageStatus = 'Poor'; } else { $MessageStatus = 'Disconnected'; } return $MessageStatus; } /* * Nustatymai */ $server_1 = '212.122.86.243'; $port_1 = '2106'; $server_2 = '212.122.86.243'; $port_2 = '6667'; $server_3 = '212.122.86.243'; $port_3 = '6666'; $status = pingDomain($server_1, $port_1); $MessageStatus = server_status($status); $upmessage = "<font size='1' color='black'><br>Stability: </font><font color='gray' size='1'>$MessageStatus</font><br>"; $downmessage = "<font size='1' color='black'><br>Stability: </font><font color='gray' size='1'>Disconnected</font><br>"; $tout = "5"; $serverg1 = @fsockopen ($server_1, $port_1, $errno, $errstr, $tout); if(!$serverg1) { echo "<br> <font color='C8B560' size='2' style='Arial'><strong>Login</strong></font> <br> <font size='1' color='black'>Status:</font> <font color='red' size='1' style='Arial'> Off</font>$downmessage"; } else { echo"<br> <font color='C8B560' size='2' style='Arial'><strong>Login</strong></font> <br> <font size='1' color='black'>Status:</font> <font color='green' size='1' style='Arial'> On</font>$upmessage"; } $status = pingDomain($server_2, $port_2); $MessageStatus = server_status($status); $upmessage = "<font size='1' color='black'><br>Stability: </font><font color='gray' size='1'>$MessageStatus</font><br>"; $downmessage = "<font size='1' color='black'><br>Stability: </font><font color='gray' size='1'>Disconnected</font><br>"; $tout = "5"; $serverg2 = @fsockopen ($server_2, $port_2, $errno, $errstr, $tout); if(!$serverg2) { echo "<br> <font color='C8B560' size='2' style='Arial'><strong>Login</strong></font> <br> <font size='1' color='black'>Status:</font> <font color='red' size='1' style='Arial'> Off</font>$downmessage"; } else { echo "<br> <font color='C8B560' size='2' style='Arial'><strong>Login</strong></font> <br> <font size='1' color='black'>Status:</font> <font color='green' size='1' style='Arial'> On</font>$upmessage"; } ?>
This paste will be private.
From the Design Piracy series on my blog: