mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
merge backed and material
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<p class="grey-text text-lighten-4">The shared youtube radio</p>
|
||||
<p class="grey-text text-lighten-4">
|
||||
Being built around the youtube search and video API
|
||||
it enables the creation of collaboratiive and shared live playlists,
|
||||
it enables the creation of collaboratiive and shared live playlists,
|
||||
with billions of videos and songs to choose from, all for free and without registration.
|
||||
<br>
|
||||
Enjoy!
|
||||
@@ -29,19 +29,20 @@
|
||||
<div class="footer-copyright">
|
||||
<div class="container">
|
||||
© <?php echo date("Y"); ?>
|
||||
<a href="//nixo.no">Nixo</a> &
|
||||
<a href="//kasperrt.no">KasperRT</a>
|
||||
<a href="//nixo.no">Nixo</a> &
|
||||
<a href="//kasperrt.no">KasperRT</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/iscroll-min.js"></script>
|
||||
<script type="text/javascript" src="static/js/list.js"></script>
|
||||
<script src="//cdn.socket.io/socket.io-1.2.0.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/iscroll-min.js"></script>
|
||||
<script type="text/javascript" src="static/js/list.js"></script>
|
||||
<script type="text/javascript" src="static/js/searchlist.js"></script>
|
||||
<script type="text/javascript" src="static/js/playercontrols.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/search.js"></script>
|
||||
<script type="text/javascript" src="static/js/admin.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/color-thief.min.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/materialize.js"></script>
|
||||
@@ -59,4 +60,4 @@
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="//zoff.no/analyse/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
<!-- End Piwik Code -->
|
||||
|
||||
127
php/nochan.php
127
php/nochan.php
@@ -5,50 +5,10 @@ if(isset($_GET['chan'])){
|
||||
header('Location: '.$chan);
|
||||
}
|
||||
|
||||
$dir = scandir('./lists');
|
||||
$channels = array();
|
||||
$all_channels = array();
|
||||
$chan_data = array(); //for all chan data
|
||||
$time = 60*60*24*4; //4 dager
|
||||
$to = 60*60*24*2;
|
||||
$i = 0;
|
||||
$v = 0;
|
||||
$tooMany = false;
|
||||
|
||||
$dir = "./lists";
|
||||
chdir($dir);
|
||||
array_multisort(array_map('filemtime', ($fil = glob("*.json"))), SORT_DESC, $fil);
|
||||
$viewers = array();
|
||||
|
||||
foreach($fil as $files){
|
||||
if(strpos($files, '.json') !== FALSE){
|
||||
$time_lasted = time() - filemtime($files);
|
||||
if($time_lasted > $to)
|
||||
{
|
||||
$file = file_get_contents($files);
|
||||
$data = json_decode($file, TRUE);
|
||||
if(isset($data["nowPlaying"])){
|
||||
$q = array_values($data["nowPlaying"]);
|
||||
}
|
||||
}
|
||||
if($time_lasted < $time){
|
||||
$file = file_get_contents($files); //Checking if the channel has the setting for showing on the frontpage set to true.
|
||||
$data = json_decode($file, TRUE);
|
||||
if($i <= 40 && (!array_key_exists("frontpage", $data['conf']) || $data['conf']['frontpage'] == "true")){ //If it is true, the channelname will be shown on the frontpage
|
||||
array_push($channels, ucfirst(str_replace(".json", "", $files)));
|
||||
array_push($viewers, sizeof($data["conf"]["views"]));
|
||||
array_push($chan_data, $data);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
array_push($all_channels, ucfirst(str_replace(".json", "", $files)));
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
|
||||
<head>
|
||||
<?php include("header.php"); ?>
|
||||
<?php include("header.php"); ?>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
@@ -71,65 +31,51 @@ foreach($fil as $files){
|
||||
<div class="section">
|
||||
<form class="row" id="base" method="get">
|
||||
<div class="input-field col s12">
|
||||
<input
|
||||
<input
|
||||
class="input-field"
|
||||
type="text"
|
||||
id="search"
|
||||
name="chan"
|
||||
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
|
||||
autocomplete="off"
|
||||
list="searches"
|
||||
required pattern="[a-zA-Z0-9]+"
|
||||
spellcheck="false"
|
||||
maxlength="18"
|
||||
type="text"
|
||||
id="search"
|
||||
name="chan"
|
||||
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
|
||||
autocomplete="off"
|
||||
list="searches"
|
||||
required pattern="[a-zA-Z0-9]+"
|
||||
spellcheck="false"
|
||||
maxlength="18"
|
||||
autofocus
|
||||
/>
|
||||
<label for="search">Find or create radio channel</label>
|
||||
<datalist id="searches">
|
||||
<?php foreach($all_channels as $channel){echo "<option value='".htmlspecialchars($channel)."'> ";} ?>
|
||||
</datalist>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="section">
|
||||
<ul class="row" id="channels">
|
||||
<?php
|
||||
foreach ($chan_data as $v => $d)
|
||||
{
|
||||
if(count($d["songs"])>0)
|
||||
{
|
||||
$ch=htmlspecialchars($channels[$v]);
|
||||
$views=$viewers[$v];
|
||||
$now=reset($d["nowPlaying"]);
|
||||
$img="http://img.youtube.com/vi/".$now["id"]."/hqdefault.jpg";
|
||||
//echo "<a class='channel' href='./".$ch."' title='Viewers: ~".$viewers[$v]."'>".$ch."</a>";
|
||||
?>
|
||||
<li class="col s12 m4 l3">
|
||||
<div id="chan-html">
|
||||
<li id="chan-card" class="col s12 m4 l3">
|
||||
<div class="card">
|
||||
<a href="<?php echo $ch; ?>">
|
||||
<div class="card-image cardbg" style="background-image:url('<?php echo $img; ?>')">
|
||||
<img class="invisible" src="<?php echo $img; ?>">
|
||||
</div>
|
||||
<a class="chan-link">
|
||||
<div class="chan-bg card-image cardbg"></div>
|
||||
</a>
|
||||
<div class="card-content">
|
||||
<p class="left-align">
|
||||
<span class="flow-text truncate"><?php echo $ch; ?></span>
|
||||
<span class="chan-name flow-text truncate"></span>
|
||||
<br>
|
||||
<span class="highlighted">Viewers: </span><?php echo $views; ?>
|
||||
<span class="highlighted">Viewers: </span>
|
||||
<span class="chan-views"></span>
|
||||
<br>
|
||||
<span class="highlighted">Songs: </span><?php echo(count($d["songs"])+1); ?>
|
||||
<span class="highlighted">Songs: </span>
|
||||
<span class="chan-songs"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<a href="<?php echo $ch; ?>" class="waves-effect waves-orange btn-flat">Listen</a>
|
||||
<a class="chan-link waves-effect waves-orange btn-flat">Listen</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
@@ -142,7 +88,7 @@ foreach($fil as $files){
|
||||
<p class="grey-text text-lighten-4">The shared youtube radio</p>
|
||||
<p class="grey-text text-lighten-4">
|
||||
Being built around the youtube search and video API
|
||||
it enables the creation of collaboratiive and shared live playlists,
|
||||
it enables the creation of collaboratiive and shared live playlists,
|
||||
with billions of videos and songs to choose from, all for free and without registration.
|
||||
<br>
|
||||
Enjoy!
|
||||
@@ -165,31 +111,16 @@ foreach($fil as $files){
|
||||
<div class="footer-copyright">
|
||||
<div class="container">
|
||||
© <?php echo date("Y"); ?>
|
||||
<a href="//nixo.no">Nixo</a> &
|
||||
<a href="//kasperrt.no">KasperRT</a>
|
||||
<a href="//nixo.no">Nixo</a> &
|
||||
<a href="//kasperrt.no">KasperRT</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/materialize.js"></script>
|
||||
<script type="text/javascript" src="static/js/nochan.js"></script>
|
||||
|
||||
<!-- Piwik tracking -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//zoff.no/analyse/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 1]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="//zoff.no/analyse/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
|
||||
</body>
|
||||
<noscript><p><img src="//zoff.no/analyse/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user