diff --git a/index.php b/index.php index d027640..f722d0c 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,9 @@ require_once '_config.php'; use Bramus\Router\Router; - + + $curl = new anlutro\cURL\cURL; + $router = new Router(); session_start(); @@ -20,6 +22,12 @@ if(isset($_SESSION['user'])) $twig->addGlobal('user', $_SESSION['user']); + $res = $curl->get('https://crss.blurryface.xyz/api/v1/players'); + + $json = json_decode($res->body, true); + + $twig->addGlobal('playerCount', count($json)); + $router->get('/', function() { global $twig; diff --git a/template/includes/hero.twig b/template/includes/hero.twig new file mode 100644 index 0000000..7b7675a --- /dev/null +++ b/template/includes/hero.twig @@ -0,0 +1,11 @@ +
+
+
+

Clyde's Real Survival SMP

+ +
+ Online: / +
+
+
+
\ No newline at end of file diff --git a/template/index.twig b/template/index.twig index 8ad0c6a..1c14e15 100644 --- a/template/index.twig +++ b/template/index.twig @@ -1,16 +1,6 @@ {% include 'includes/head.twig' with {'pageTitle': 'Home'} %} -
-
-
-

Clyde's Real Survival SMP

- -
- Online: / -
-
-
-
+{% include 'includes/hero.twig' %} {% include 'includes/nav.twig' with {'page': 'home',} %} diff --git a/template/nations.twig b/template/nations.twig index 518e3ac..b14f93c 100644 --- a/template/nations.twig +++ b/template/nations.twig @@ -1,16 +1,6 @@ {% include 'includes/head.twig' with {'pageTitle': 'Nations'} %} -
-
-
-

Clyde's Real Survival SMP

- -
- Online: / -
-
-
-
+{% include 'includes/hero.twig' %} {% include 'includes/nav.twig' with {'page': 'nations'} %} diff --git a/template/profile.twig b/template/profile.twig index 018908f..90f1160 100644 --- a/template/profile.twig +++ b/template/profile.twig @@ -1,16 +1,6 @@ {% include 'includes/head.twig' with {'pageTitle': 'Profile'} %} -
-
-
-

Clyde's Real Survival SMP

- -
- Online: / -
-
-
-
+{% include 'includes/hero.twig' %} {% include 'includes/nav.twig' with {'page': 'profile',} %} diff --git a/template/rules.twig b/template/rules.twig index a560b85..e4bdfcf 100644 --- a/template/rules.twig +++ b/template/rules.twig @@ -1,16 +1,6 @@ {% include 'includes/head.twig' with {'pageTitle': 'Rules'} %} -
-
-
-

Clyde's Real Survival SMP

- -
- Online: / -
-
-
-
+{% include 'includes/hero.twig' %} {% include 'includes/nav.twig' with {'page': 'rules',} %} diff --git a/template/user.twig b/template/user.twig index 087d053..5f2d8cd 100644 --- a/template/user.twig +++ b/template/user.twig @@ -1,16 +1,6 @@ {% include 'includes/head.twig' with {'pageTitle': username} %} -
-
-
-

Clyde's Real Survival SMP

- -
- Online: / -
-
-
-
+{% include 'includes/hero.twig' %} {% include 'includes/nav.twig' with {'page': 'user',} %}