Merge branch 'organized_files'

This commit is contained in:
Nicolas A. Tonne
2014-10-10 14:24:18 +02:00
19 changed files with 64 additions and 36 deletions

View File

@@ -1,11 +1,6 @@
<html>
<head>
<title>Zöff</title>
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne &amp; 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'>
<?php include("php/header.php"); ?>
</head>
<body>
<div class="top vcent centered">
@@ -13,7 +8,7 @@
<?php
if(isset($_GET['chan'])) header('Location: '.$_GET['chan']);
$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];
?>
<a id="toptitle" href="/">Zöff</a>
@@ -39,11 +34,11 @@
<div class="footer small centered top anim">&copy; 2014 <a class="anim" href="//nixo.no">Nixo</a> &amp; <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 type="text/javascript" src="/swfobject.js"></script>
<script type="text/javascript" src="/iscroll.js"></script>
<script type="text/javascript" src="/list.js"></script>
<script type="text/javascript" src="/youtube.js"></script>
<script type="text/javascript" src="/search.js"></script>
<script type="text/javascript" src="/visualize.js"></script>
<script type="text/javascript" src="/js/swfobject.js"></script>
<script type="text/javascript" src="/js/iscroll.js"></script>
<script type="text/javascript" src="/js/list.js"></script>
<script type="text/javascript" src="/js/youtube.js"></script>
<script type="text/javascript" src="/js/search.js"></script>
<script type="text/javascript" src="/js/visualize.js"></script>
</body>
</html>

View File

@@ -10,7 +10,7 @@ function updateList()
{
console.log("updating list");
list = $.ajax({ type: "GET",
url: "change.php",
url: "php/change.php",
async: false
}).responseText;
list = $.parseJSON(list);
@@ -68,7 +68,7 @@ function updateList()
function vote(id, vote){
console.log($.ajax({
type: "GET",
url: "change.php",
url: "php/change.php",
async: false,
data: "vote="+vote+"&id="+id,
success: function() {
@@ -86,7 +86,7 @@ function vote(id, vote){
function skip(){
console.log($.ajax({
type: "GET",
url: "change.php",
url: "php/change.php",
async: false,
data: "skip",
success: function() {

View File

@@ -67,7 +67,7 @@ $(document).ready(function()
function submit(id,title){
console.log($.ajax({
type: "GET",
url: "change.php",
url: "php/change.php",
async: false,
data: "v="+id+"&n="+title,
success: function() {

View File

@@ -36,7 +36,7 @@ $(document).ready(function()
diffVideo = false;
interval = false;
response = $.ajax({ type: "GET",
url: "change.php",
url: "php/change.php",
async: false
}).responseText;
//console.log(response);
@@ -45,7 +45,7 @@ $(document).ready(function()
console.log(first);
$.ajax({
type: 'get',
url: 'timedifference.php',
url: 'php/timedifference.php',
data: "abcde",
async: false,
success: function(data) {
@@ -128,7 +128,7 @@ function checkEnd()
console.log("sjekker om brukeren spolte");
$.ajax({
type: 'get',
url: 'timedifference.php',
url: 'php/timedifference.php',
data: "abcde",
async: false,
success: function(data) {
@@ -151,7 +151,7 @@ function startNextSong()
setTimeout(function(){
response = $.ajax({
type: "POST",
url: "change.php",
url: "php/change.php",
async: false,
data: "thisUrl="+response+"&act=save",
@@ -187,7 +187,7 @@ function getTime()
$.ajax({
type: 'get',
url: 'timedifference.php',
url: 'php/timedifference.php',
data: "abcde",
async: false,
success: function(data) {
@@ -225,7 +225,7 @@ function getTime()
beginning = true;
$.ajax({
type: "POST",
url: "change.php",
url: "php/change.php",
async: false,
data: "thisUrl=123abcprompeprompe&act=save",
success: function(data)
@@ -243,7 +243,7 @@ function getTime()
function getTitle()
{
$.ajax({ type: "GET",
url: "timedifference.php",
url: "php/timedifference.php",
async: false,
success: function(data) {
viewers = $.parseJSON(data);
@@ -261,7 +261,7 @@ function errorHandler(newState)
setTimeout(function(){
response = $.ajax({
type: "POST",
url: "change.php",
url: "php/change.php",
async: false,
data: "thisUrl="+response+"&act=delete",

View File

@@ -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":[]}}

View File

@@ -1,11 +1,6 @@
<html>
<head>
<title>Zöff</title>
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne &amp; 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'>
<?php include("header.php"); ?>
</head>
<body>
<div class="top vcent centered">

View File

@@ -11,7 +11,8 @@ if(isset($_REQUEST['test'])){
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
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()));
$f = @fopen($list,"x");
if($f){ fwrite($f,$array); fclose($f); }

30
php/convert_lists.php Executable file
View 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
View File

@@ -0,0 +1,6 @@
<title>Zöff</title>
<meta name="author" content="Nicolas 'Nixo' Almagro Tonne &amp; 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
View File

View File

@@ -2,7 +2,7 @@
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
else $list=$list[1];
$list="lists/".$list.".json";
$list="..lists/".$list.".json";
$data = json_decode(file_get_contents($list), true);
$songs = $data["nowPlaying"];
$id = array_values($songs);

View File

@@ -1,7 +1,7 @@
<?php
$list = htmlspecialchars($_REQUEST['list']);
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);}
$file = file_get_contents($filename);
print($file);

1
setperms.sh Executable file
View File

@@ -0,0 +1 @@
sudo chmod -R ugo+rwx .

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
static/settings2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB