mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed template for the frontpage
This commit is contained in:
59
index.php
59
index.php
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
<html>
|
||||
<head>
|
||||
<?php include("php/header.php"); ?>
|
||||
@@ -44,3 +45,61 @@
|
||||
<script type="text/javascript" src="/js/visualize.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
=======
|
||||
<?php
|
||||
/*
|
||||
* Herpa derp
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// Require the autoloader
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
// New instance of smarty
|
||||
$template = new Smarty();
|
||||
|
||||
// Set smarty options
|
||||
$template->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 .= '<option value="' . htmlspecialchars(urldecode($channel)) . '">';
|
||||
}
|
||||
|
||||
// Build string for displaying active rooms
|
||||
$display_string = '';
|
||||
foreach ($channels as $channel) {
|
||||
$display_string .= '<a class="channel" href="' . htmlspecialchars($channel) . '">' . htmlspecialchars(urldecode($channel)) . '</a>';
|
||||
}
|
||||
|
||||
// Assign to Smarty
|
||||
$template->assign('SEARCH_STRING', $search_string);
|
||||
$template->assign('DISPLAY_STRING', $display_string);
|
||||
|
||||
// Display template
|
||||
$template->display('index.tpl');
|
||||
}
|
||||
else {
|
||||
// In a room, check if it is a valid room or not
|
||||
$template->display('chan.tpl');
|
||||
}
|
||||
>>>>>>> Fixed template for the frontpage
|
||||
|
||||
54
templates/chan.tpl
Executable file
54
templates/chan.tpl
Executable file
@@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
[[+include file="header.tpl"]]
|
||||
</head>
|
||||
<body>
|
||||
<div class="top vcent centered">
|
||||
<div id="change" class="small">
|
||||
<div class="bigchan nomargin">Zöff</div>
|
||||
<form name="ufo" action="" class="daform nomargin" id="base" method="get" onsubmit="null;" >
|
||||
<input list="searches" id="search" name="chan" type="text" class="search_input innbox" spellcheck="false" maxlength="15" placeholder="Type Channel Name" autofocus/>
|
||||
<datalist id="searches">
|
||||
<?php foreach($channels as $channel){echo "<option value='".htmlspecialchars(urldecode($channel))."'> ";} ?>
|
||||
</datalist>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<center>
|
||||
<div class="channels" id="channels">Active Channels<br>
|
||||
<?php foreach($channels as $channel){echo "<a class='channel' href='/".htmlspecialchars($channel)."'>".htmlspecialchars(urldecode($channel))."</a>";} ?>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
<a id="toptitle" href="/">Zöff</a>
|
||||
<div id="chan" class="chan" title="Show big URL" onclick="show()">
|
||||
<?php echo(ucfirst($list));?>
|
||||
</div>
|
||||
<input id="search" name="v" type="text" class="search_input innbox" spellcheck="false" placeholder="Search" onsubmit="null;" autocomplete="off"/>
|
||||
<div id="results"></div>
|
||||
<div class="main">
|
||||
<div id="player" class="ytplayer"></div>
|
||||
<div class="playlist" >
|
||||
<div id="buttons" class="result">
|
||||
<!--<a href="/php/admin.php?list=<?php echo $list; ?>" title="Channel settings" ><img src="static/settings2.png" class="skip middle" alt="Settings"/></a>-->
|
||||
<img src="static/settings2.png" class="skip middle" alt="Settings" title="Settings" onclick="admin();"/>
|
||||
<img src="static/skip.png" class="skip" alt="Skip" title="Skip" onclick="skip();">
|
||||
</div>
|
||||
<div id="adminPanel"></div>
|
||||
<div id="playlist">
|
||||
<div id="wrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer small centered top anim">
|
||||
© 2014 <a class="anim" href="//nixo.no">Nixo</a> & <a class="anim" href="//kasperrt.no">KasperRT </a>& David
|
||||
</div>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="static/js/iscroll.js"></script>
|
||||
<script type="text/javascript" src="static/js/list.js"></script>
|
||||
<script type="text/javascript" src="static/js/youtube.js"></script>
|
||||
<script type="text/javascript" src="static/js/search.js"></script>
|
||||
<script type="text/javascript" src="static/js/admin.js"></script>
|
||||
<script type="text/javascript" src="static/js/visualize.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,6 +3,7 @@
|
||||
[[+include file="header.tpl]]
|
||||
</head>
|
||||
<body>
|
||||
<<<<<<< HEAD
|
||||
<div class="top vcent centered">
|
||||
<div id="change" class="small">
|
||||
<?php
|
||||
@@ -42,5 +43,34 @@
|
||||
<script type="text/javascript" src="static/js/search.js"></script>
|
||||
<script type="text/javascript" src="static/js/admin.js"></script>
|
||||
<script type="text/javascript" src="static/js/visualize.js"></script>
|
||||
=======
|
||||
<div class="top vcent centered">
|
||||
<div id="change" class="small">
|
||||
<div class="bigchan nomargin">Zöff</div>
|
||||
<form name="ufo" action="" class="daform nomargin" id="base" method="get" onsubmit="null;" >
|
||||
<input list="searches" id="search" name="chan" type="text" class="search_input innbox" spellcheck="false" maxlength="15" placeholder="Type Channel Name" autofocus/>
|
||||
<datalist id="searches">
|
||||
[[+$SEARCH_STRING]]
|
||||
</datalist>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<center>
|
||||
<div class="channels" id="channels">Active Channels<br>
|
||||
[[+$DISPLAY_STRING]]
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
<div class="footer small centered top anim">
|
||||
© 2014 <a class="anim" href="//nixo.no">Nixo</a> & <a class="anim" href="//kasperrt.no">KasperRT </a>& David
|
||||
</div>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="static/js/iscroll.js"></script>
|
||||
<script type="text/javascript" src="static/js/list.js"></script>
|
||||
<script type="text/javascript" src="static/js/youtube.js"></script>
|
||||
<script type="text/javascript" src="static/js/search.js"></script>
|
||||
<script type="text/javascript" src="static/js/admin.js"></script>
|
||||
<script type="text/javascript" src="static/js/visualize.js"></script>
|
||||
>>>>>>> Fixed template for the frontpage
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user