q3astatus
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| q3astatus [2006/11/07 22:53] – 209.8.22.197 | q3astatus [2006/11/08 02:35] (current) – old revision restored 84.142.251.254 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== q3astatus.php ====== | ||
| + | |||
| + | This snippet displays the current map and players on your [[quake3arena]] server on your homepage. Just include it somewhere. | ||
| + | |||
| + | <code php> | ||
| + | <? | ||
| + | $server = " | ||
| + | $port = 27960; | ||
| + | $query | ||
| + | |||
| + | $fp = fsockopen(" | ||
| + | if (!$fp) { | ||
| + | echo " | ||
| + | exit; | ||
| + | } else { | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | $rows = split(" | ||
| + | |||
| + | preg_match('# | ||
| + | $map = $matches[1]; | ||
| + | ?> | ||
| + | |||
| + | <table style=" | ||
| + | <tr> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </tr> | ||
| + | <? | ||
| + | for($i=2; $i< | ||
| + | list($frags, | ||
| + | $name = str_replace('"','', | ||
| + | |||
| + | //decode colors | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | $name = preg_replace(' | ||
| + | |||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | print "</ | ||
| + | } | ||
| + | ?> | ||
| + | <tr> | ||
| + | < | ||
| + | <td colspan=" | ||
| + | </tr> | ||
| + | </ | ||
| + | </ | ||
