From ab1bdb4bf80294ae7e3de05b351af307bb833631 Mon Sep 17 00:00:00 2001 From: OptimusCrime Date: Thu, 16 Oct 2014 19:05:22 +0200 Subject: [PATCH] Fixed template for the frontpage --- index.php | 59 +++++++++++++++++++++++++++++++++++++++++++++ templates/chan.tpl | 54 +++++++++++++++++++++++++++++++++++++++++ templates/index.tpl | 30 +++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100755 templates/chan.tpl diff --git a/index.php b/index.php index a2e0d4a7..7908f5be 100755 --- a/index.php +++ b/index.php @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -44,3 +45,61 @@ +======= +left_delimiter = '[[+'; +$template->right_delimiter = ']]'; + +// Check if we are in a room or not +if (!isset($_GET['q'])) { + // Not in a room, fetch active rooms + + $dir = scandir('./lists'); + $channels = []; + $time = 60 * 60 * 24 * 3; + + foreach ($dir as $files) { + if (strpos($files, '.json') !== false) { + if (time() - filemtime('./lists/' . $files) < $time) { + $channels[] = ucfirst(str_replace('.json', '', $files)); + } + } + } + + // Build string for search + $search_string = ''; + foreach ($channels as $channel) { + $search_string .= '