diff --git a/templates/tibiacom/boxes/gallery.php b/templates/tibiacom/boxes/gallery.php
index 7b46f1b7..87ca0b1b 100644
--- a/templates/tibiacom/boxes/gallery.php
+++ b/templates/tibiacom/boxes/gallery.php
@@ -4,14 +4,10 @@ if(PAGE !== 'news') {
return;
}
-$query = $db->query('SELECT `thumb` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($config['gallery_image']));
-if($query->rowCount() == 1):
+$query = $db->query('SELECT `thumb` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($config['gallery_image_id_from_database']));
+if($query->rowCount() === 1) {
$image = $query->fetch();
-?>
-
-
+ $twig->display('gallery.html.twig', array(
+ 'image' => $image
+ ));
+}
diff --git a/templates/tibiacom/boxes/highscores.php b/templates/tibiacom/boxes/highscores.php
index 7df16c41..e46a3e81 100644
--- a/templates/tibiacom/boxes/highscores.php
+++ b/templates/tibiacom/boxes/highscores.php
@@ -1,68 +1,5 @@
-
-
-
-
-
\ No newline at end of file
+$twig->display('highscores.html.twig', array(
+ 'topPlayers' => getTopPlayers(5)
+));
diff --git a/templates/tibiacom/boxes/networks.php b/templates/tibiacom/boxes/networks.php
index 333eda1c..7f1faee7 100644
--- a/templates/tibiacom/boxes/networks.php
+++ b/templates/tibiacom/boxes/networks.php
@@ -1,31 +1,5 @@
-
\ No newline at end of file
+display('networks.html.twig', array(
+ 'topPlayers' => getTopPlayers(5)
+));
diff --git a/templates/tibiacom/boxes/newcomer.php b/templates/tibiacom/boxes/newcomer.php
index 1aaf02fe..1955f400 100644
--- a/templates/tibiacom/boxes/newcomer.php
+++ b/templates/tibiacom/boxes/newcomer.php
@@ -1,5 +1,3 @@
-
\ No newline at end of file
+display('newcomer.html.twig');
diff --git a/templates/tibiacom/boxes/poll.php b/templates/tibiacom/boxes/poll.php
index dc8b8750..266f3f6c 100644
--- a/templates/tibiacom/boxes/poll.php
+++ b/templates/tibiacom/boxes/poll.php
@@ -7,15 +7,7 @@ if(PAGE !== 'news') {
$poll = $db->query('SELECT `id`, `question` FROM `z_polls` WHERE end > ' . time() . ' ORDER BY `end` LIMIT 1');
if($poll->rowCount() > 0) {
$poll = $poll->fetch();
- ?>
-
- display('poll.html.twig', array(
+ 'poll' => $poll
+ ));
}
-?>
diff --git a/templates/tibiacom/boxes/premium.php b/templates/tibiacom/boxes/premium.php
index 86f8166d..740e8c50 100644
--- a/templates/tibiacom/boxes/premium.php
+++ b/templates/tibiacom/boxes/premium.php
@@ -1,5 +1,3 @@
-
\ No newline at end of file
+display('premium.html.twig');
diff --git a/templates/tibiacom/boxes/templates/gallery.html.twig b/templates/tibiacom/boxes/templates/gallery.html.twig
new file mode 100644
index 00000000..7ef321ed
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/gallery.html.twig
@@ -0,0 +1,6 @@
+
diff --git a/templates/tibiacom/boxes/templates/highscores.html.twig b/templates/tibiacom/boxes/templates/highscores.html.twig
new file mode 100644
index 00000000..50b98c1c
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/highscores.html.twig
@@ -0,0 +1,59 @@
+
+
+
+
+ {% for player in topPlayers %}
+
+ {% endfor %}
+
+
+
+
+
diff --git a/templates/tibiacom/boxes/templates/networks.html.twig b/templates/tibiacom/boxes/templates/networks.html.twig
new file mode 100644
index 00000000..724f27bf
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/networks.html.twig
@@ -0,0 +1,31 @@
+
+ {% if config['network_facebook'] is not empty %}
+
+ {% endif %}
+ {% if config['network_twitter'] is not empty %}
+
+ {% endif %}
+
+
diff --git a/templates/tibiacom/boxes/templates/newcomer.html.twig b/templates/tibiacom/boxes/templates/newcomer.html.twig
new file mode 100644
index 00000000..3cea266e
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/newcomer.html.twig
@@ -0,0 +1,5 @@
+
diff --git a/templates/tibiacom/boxes/templates/poll.html.twig b/templates/tibiacom/boxes/templates/poll.html.twig
new file mode 100644
index 00000000..07d26a33
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/poll.html.twig
@@ -0,0 +1,7 @@
+
+
{{ poll['question'] }}
+
+
+
+
diff --git a/templates/tibiacom/boxes/templates/premium.html.twig b/templates/tibiacom/boxes/templates/premium.html.twig
new file mode 100644
index 00000000..7c6533ec
--- /dev/null
+++ b/templates/tibiacom/boxes/templates/premium.html.twig
@@ -0,0 +1,5 @@
+
diff --git a/templates/tibiacom/config.php b/templates/tibiacom/config.php
index 6467809d..945fa94b 100644
--- a/templates/tibiacom/config.php
+++ b/templates/tibiacom/config.php
@@ -12,7 +12,7 @@ $config['network_twitter'] = 'tibia'; // leave empty to disable
$config['background_image'] = "background-artwork.jpg";
$config['logo_image'] = "tibia-logo-artwork-top.gif";
-$config['gallery_image'] = 1;
+$config['gallery_image_id_from_database'] = 1;
$config['menu_categories'] = array(
MENU_CATEGORY_NEWS => array('id' => 'news', 'name' => 'Latest News'),
MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),
diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php
index fbc9f2aa..9b69eeb5 100644
--- a/templates/tibiacom/index.php
+++ b/templates/tibiacom/index.php
@@ -421,6 +421,8 @@ foreach($config['menu_categories'] as $id => $cat) {
prependPath(__DIR__ . '/boxes/templates');
+
foreach($config['boxes'] as $box) {
/** @var string $template_name */
$file = TEMPLATES . $template_name . '/boxes/' . $box . '.php';