mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Merge branch 'organized_files'
This commit is contained in:
21
index.php
21
index.php
@@ -1,11 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Zöff</title>
|
<?php include("php/header.php"); ?>
|
||||||
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne & Kasper 'KasperRT' Rynning-Tønnesen">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/style.css" title="Default" />
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<link rel="icon" type="image/png" href="/static/favicon.png"/>
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="top vcent centered">
|
<div class="top vcent centered">
|
||||||
@@ -13,7 +8,7 @@
|
|||||||
<?php
|
<?php
|
||||||
if(isset($_GET['chan'])) header('Location: '.$_GET['chan']);
|
if(isset($_GET['chan'])) header('Location: '.$_GET['chan']);
|
||||||
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||||
if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('nochan.php');die();}
|
if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('php/nochan.php');die();}
|
||||||
else $list=$list[1];
|
else $list=$list[1];
|
||||||
?>
|
?>
|
||||||
<a id="toptitle" href="/">Zöff</a>
|
<a id="toptitle" href="/">Zöff</a>
|
||||||
@@ -39,11 +34,11 @@
|
|||||||
<div class="footer small centered top anim">© 2014 <a class="anim" href="//nixo.no">Nixo</a> & <a class="anim" href="//kasperrt.no">KasperRT</a> </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> </div>
|
||||||
|
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="/swfobject.js"></script>
|
<script type="text/javascript" src="/js/swfobject.js"></script>
|
||||||
<script type="text/javascript" src="/iscroll.js"></script>
|
<script type="text/javascript" src="/js/iscroll.js"></script>
|
||||||
<script type="text/javascript" src="/list.js"></script>
|
<script type="text/javascript" src="/js/list.js"></script>
|
||||||
<script type="text/javascript" src="/youtube.js"></script>
|
<script type="text/javascript" src="/js/youtube.js"></script>
|
||||||
<script type="text/javascript" src="/search.js"></script>
|
<script type="text/javascript" src="/js/search.js"></script>
|
||||||
<script type="text/javascript" src="/visualize.js"></script>
|
<script type="text/javascript" src="/js/visualize.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -10,7 +10,7 @@ function updateList()
|
|||||||
{
|
{
|
||||||
console.log("updating list");
|
console.log("updating list");
|
||||||
list = $.ajax({ type: "GET",
|
list = $.ajax({ type: "GET",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false
|
async: false
|
||||||
}).responseText;
|
}).responseText;
|
||||||
list = $.parseJSON(list);
|
list = $.parseJSON(list);
|
||||||
@@ -68,7 +68,7 @@ function updateList()
|
|||||||
function vote(id, vote){
|
function vote(id, vote){
|
||||||
console.log($.ajax({
|
console.log($.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "vote="+vote+"&id="+id,
|
data: "vote="+vote+"&id="+id,
|
||||||
success: function() {
|
success: function() {
|
||||||
@@ -86,7 +86,7 @@ function vote(id, vote){
|
|||||||
function skip(){
|
function skip(){
|
||||||
console.log($.ajax({
|
console.log($.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "skip",
|
data: "skip",
|
||||||
success: function() {
|
success: function() {
|
||||||
@@ -67,7 +67,7 @@ $(document).ready(function()
|
|||||||
function submit(id,title){
|
function submit(id,title){
|
||||||
console.log($.ajax({
|
console.log($.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "v="+id+"&n="+title,
|
data: "v="+id+"&n="+title,
|
||||||
success: function() {
|
success: function() {
|
||||||
@@ -36,7 +36,7 @@ $(document).ready(function()
|
|||||||
diffVideo = false;
|
diffVideo = false;
|
||||||
interval = false;
|
interval = false;
|
||||||
response = $.ajax({ type: "GET",
|
response = $.ajax({ type: "GET",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false
|
async: false
|
||||||
}).responseText;
|
}).responseText;
|
||||||
//console.log(response);
|
//console.log(response);
|
||||||
@@ -45,7 +45,7 @@ $(document).ready(function()
|
|||||||
console.log(first);
|
console.log(first);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'get',
|
type: 'get',
|
||||||
url: 'timedifference.php',
|
url: 'php/timedifference.php',
|
||||||
data: "abcde",
|
data: "abcde",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -128,7 +128,7 @@ function checkEnd()
|
|||||||
console.log("sjekker om brukeren spolte");
|
console.log("sjekker om brukeren spolte");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'get',
|
type: 'get',
|
||||||
url: 'timedifference.php',
|
url: 'php/timedifference.php',
|
||||||
data: "abcde",
|
data: "abcde",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -151,7 +151,7 @@ function startNextSong()
|
|||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
response = $.ajax({
|
response = $.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "thisUrl="+response+"&act=save",
|
data: "thisUrl="+response+"&act=save",
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ function getTime()
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'get',
|
type: 'get',
|
||||||
url: 'timedifference.php',
|
url: 'php/timedifference.php',
|
||||||
data: "abcde",
|
data: "abcde",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -225,7 +225,7 @@ function getTime()
|
|||||||
beginning = true;
|
beginning = true;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "thisUrl=123abcprompeprompe&act=save",
|
data: "thisUrl=123abcprompeprompe&act=save",
|
||||||
success: function(data)
|
success: function(data)
|
||||||
@@ -243,7 +243,7 @@ function getTime()
|
|||||||
function getTitle()
|
function getTitle()
|
||||||
{
|
{
|
||||||
$.ajax({ type: "GET",
|
$.ajax({ type: "GET",
|
||||||
url: "timedifference.php",
|
url: "php/timedifference.php",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
viewers = $.parseJSON(data);
|
viewers = $.parseJSON(data);
|
||||||
@@ -261,7 +261,7 @@ function errorHandler(newState)
|
|||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
response = $.ajax({
|
response = $.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "change.php",
|
url: "php/change.php",
|
||||||
async: false,
|
async: false,
|
||||||
data: "thisUrl="+response+"&act=delete",
|
data: "thisUrl="+response+"&act=delete",
|
||||||
|
|
||||||
@@ -1 +1 @@
|
|||||||
{"nowPlaying":{"Sb3XfrCtjVU":{"id":"Sb3XfrCtjVU","title":"The Notorious BIG ft. Ja Rule - Old Thing Back (Matoma Remix)","votes":0,"added":1412940931,"guids":[]}},"songs":{"b24ALjuvR3M":{"id":"b24ALjuvR3M","title":"Philter - Revolver (OFFICIAL MUSIC VIDEO)","votes":1,"added":1412941390,"guids":["MTYwMjcx"]},"jEgX64n3T7g":{"id":"jEgX64n3T7g","title":"Massive Attack - Paradise Circus","votes":1,"added":1412942005,"guids":["MTYwMjcx"]},"u7K72X4eo_s":{"id":"u7K72X4eo_s","title":"Massive Attack - Teardrop","votes":1,"added":1412942256,"guids":["MTYwMjcx"]},"V40EjCjP3VU":{"id":"V40EjCjP3VU","title":"Philter - The Seven Seas","votes":0,"added":1412941171,"guids":[]}},"conf":{"startTime":1412942005,"views":1,"skips":[]}}
|
{"nowPlaying":{"Sb1XfrCtjVU":{"id":"Sb3XfrCtjVU","title":"The Notorious BIG ft. Ja Rule - Old Thing Back (Matoma Remix)","votes":0,"added":1412940931,"guids":[]}},"songs":{"b24ALjuvR3M":{"id":"b24ALjuvR3M","title":"Philter - Revolver (OFFICIAL MUSIC VIDEO)","votes":1,"added":1412941390,"guids":["MTYwMjcx"]},"jEgX64n3T7g":{"id":"jEgX64n3T7g","title":"Massive Attack - Paradise Circus","votes":1,"added":1412942005,"guids":["MTYwMjcx"]},"u7K72X4eo_s":{"id":"u7K72X4eo_s","title":"Massive Attack - Teardrop","votes":1,"added":1412942256,"guids":["MTYwMjcx"]},"V40EjCjP3VU":{"id":"V40EjCjP3VU","title":"Philter - The Seven Seas","votes":0,"added":1412941171,"guids":[]}},"conf":{"startTime":1412942005,"views":1,"skips":[]}}
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Zöff</title>
|
<?php include("header.php"); ?>
|
||||||
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne & Kasper 'KasperRT' Rynning-Tønnesen">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/style.css" title="Default" />
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<link rel="icon" type="image/png" href="/static/favicon.png"/>
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="top vcent centered">
|
<div class="top vcent centered">
|
||||||
@@ -11,7 +11,8 @@ if(isset($_REQUEST['test'])){
|
|||||||
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||||
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
|
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
|
||||||
else $list=$list[1];
|
else $list=$list[1];
|
||||||
$list="lists/".$list.".json";
|
|
||||||
|
$list="../lists/".$list.".json";
|
||||||
$array = array("nowPlaying" => array(), "songs" => array(), "conf" => array("startTime" => time(), "views" => 0, "skips" => array()));
|
$array = array("nowPlaying" => array(), "songs" => array(), "conf" => array("startTime" => time(), "views" => 0, "skips" => array()));
|
||||||
$f = @fopen($list,"x");
|
$f = @fopen($list,"x");
|
||||||
if($f){ fwrite($f,$array); fclose($f); }
|
if($f){ fwrite($f,$array); fclose($f); }
|
||||||
@@ -169,4 +170,4 @@ function nextSong(){
|
|||||||
$data[5]=array();
|
$data[5]=array();
|
||||||
$data[1][0] = time();
|
$data[1][0] = time();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
30
php/convert_lists.php
Executable file
30
php/convert_lists.php
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if(isset($_GET["pass"]) && $_GET["pass"]=="bæsj"){
|
||||||
|
|
||||||
|
include("change.php");
|
||||||
|
|
||||||
|
$dir = scandir('../lists');
|
||||||
|
$channels = array();
|
||||||
|
foreach($dir as $file){
|
||||||
|
if(strpos($file, '.json') !== FALSE){
|
||||||
|
$name='./lists/'.$file;
|
||||||
|
$data = json_decode(file_get_contents($name));
|
||||||
|
unlink($name);
|
||||||
|
checkFile($name); //should create a new file with correct stuff, in change
|
||||||
|
processList($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
echo("kek");
|
||||||
|
}
|
||||||
|
|
||||||
|
function processList($list, $name){
|
||||||
|
foreach($list as $item){
|
||||||
|
//get id and title
|
||||||
|
addSong($name, $id, $title); //in change
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
6
php/header.php
Executable file
6
php/header.php
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
<title>Zöff</title>
|
||||||
|
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne & Kasper 'KasperRT' Rynning-Tønnesen">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/style.css" title="Default" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="icon" type="image/png" href="/static/favicon.png"/>
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
|
||||||
0
php/index.html
Executable file
0
php/index.html
Executable file
@@ -2,7 +2,7 @@
|
|||||||
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||||
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
|
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
|
||||||
else $list=$list[1];
|
else $list=$list[1];
|
||||||
$list="lists/".$list.".json";
|
$list="..lists/".$list.".json";
|
||||||
$data = json_decode(file_get_contents($list), true);
|
$data = json_decode(file_get_contents($list), true);
|
||||||
$songs = $data["nowPlaying"];
|
$songs = $data["nowPlaying"];
|
||||||
$id = array_values($songs);
|
$id = array_values($songs);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$list = htmlspecialchars($_REQUEST['list']);
|
$list = htmlspecialchars($_REQUEST['list']);
|
||||||
if(!isset($_REQUEST['list']))$list="videos";
|
if(!isset($_REQUEST['list']))$list="videos";
|
||||||
$filename = "lists/".$list.'.json';
|
$filename = "../lists/".$list.'.json';
|
||||||
if(!file_exists($filename)){ $f=fopen($filename, "a+"); fwrite($f,"[]"); fclose($f);}
|
if(!file_exists($filename)){ $f=fopen($filename, "a+"); fwrite($f,"[]"); fclose($f);}
|
||||||
$file = file_get_contents($filename);
|
$file = file_get_contents($filename);
|
||||||
print($file);
|
print($file);
|
||||||
1
setperms.sh
Executable file
1
setperms.sh
Executable file
@@ -0,0 +1 @@
|
|||||||
|
sudo chmod -R ugo+rwx .
|
||||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
0
static/settings2.png
Normal file → Executable file
0
static/settings2.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user