File: index.php

package info (click to toggle)
openclonk 8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 169,656 kB
  • sloc: cpp: 180,484; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 148; sh: 101; javascript: 34
file content (45 lines) | stat: -rw-r--r-- 1,269 bytes parent folder | download | duplicates (7)
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
<?php
/**
 * C4Masterserver main frontend
 *
 * @package C4Masterserver
 * @version 1.2.0-en
 * @author  Benedict Etzel <b.etzel@live.de>
 * @license http://creativecommons.org/licenses/by/3.0/ CC-BY 3.0
 */

error_reporting(E_NONE); //suppress errors
header('Content-Type: text/html; charset=utf-8'); //utf-8

require_once('frontend.php');

?>
<!doctype html>
<html>
    <head>
        <title>OpenClonk Masterserver</title>
        <meta charset='utf-8'>
        <link rel='stylesheet' href='masterserver.css'>
    </head>
    <body>
		<?php readfile($_SERVER['DOCUMENT_ROOT'].'../www/header/header.html'); ?>
        <div id="masterserver">
            <h1>Masterserver</h1>
            <?php
            if($link && $db) {
				echo GetGamesList();				
				echo "<p>";
				echo GetGamesCountText();
				echo "</p>";
                echo '<p>Server address <strong>'.GetServerLink().'</strong>';
            }
            else {
                echo '<p class="error">Error: Could not connect to database specified in config.</p>';
            }
            ?>
            <div class="footer">
                <p>Powered by C4Masterserver v<?php echo C4Masterserver::GetVersion(); ?> &raquo; by Benedict Etzel</p>
            </div>
        </div>
    </body>
</html>