diff options
| author | moehm | 2014-05-30 11:04:28 +0200 |
|---|---|---|
| committer | moehm | 2014-05-30 11:04:28 +0200 |
| commit | d6997febbdf6d424fcd0702e3324588387dc2cd9 (patch) | |
| tree | 9ebe96433d2ae394e95a78e87e1a7f0831ab85b0 /www/index.php | |
| parent | e5e8ee54e4b404d0cbdf69bebc3d9bdd9bd04855 (diff) | |
| download | random-d6997febbdf6d424fcd0702e3324588387dc2cd9.tar.gz | |
rewrite
Diffstat (limited to 'www/index.php')
| -rw-r--r-- | www/index.php | 80 |
1 files changed, 54 insertions, 26 deletions
diff --git a/www/index.php b/www/index.php index cf851e8..23cc3ff 100644 --- a/www/index.php +++ b/www/index.php @@ -1,28 +1,56 @@ -<? +<!doctype html> +<html> +<head> + <title>A random youtube video!</title> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> + <link rel="stylesheet" href="/static/style.css"> + <link rel="stylesheet" href="/static/content.css"> + <link rel="stylesheet" href="/static/noscript.css"> + <script type='text/javascript'> -include("include.php"); + function get_random_video(){ + r = new XMLHttpRequest(); + r.onreadystatechange=function(){ + if(r.readyState == 4 && r.status == 200){ + if(r.responseText == ""){ + location.reload(); + } else { + document.getElementById('middle').innerHTML=r.responseText; + } + } + } + r.open('GET', '/youtube.php', true); + r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + r.send(); + } + <?php /* + function prep_player(){ + r = new XMLHttpRequest(); + r.onreadystatechange=function(){ + if(r.readyState == 4 && r.status == 200){ + document.getElementById('test1').innerHTML=r.responseText; + } + } + r.open('POST', 'print_video.php', true); + r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + r.send('mime=<?php echo $mime; ?>', 'vname=<?php echo $filename?>'); + <?php /* + r.send('vid=<?php echo $vid; ?>', mime='<?php echo $mime; ?>', 'vname=<?php echo $filename?>'); + r.send('vid=<?php echo $_GET["vid"]; ?>', 'strm=1'); */ ?> + </script> +</head> -if(empty($_GET["task"])){ - $videoID = start($yt); - include("print_index.php"); -} else { -switch($_GET["task"]){ - case("youtube"): - include("youtube.php"); - break; - case("puush"): - include("puush.php"); - break; - case("about"): - include("about.php"); - break; - case("random"): - $array = array("youtube.php", "puush.php", "about.php", "lolrndm.php"); - $site = mt_rand(0, count($array)-1); - include($array[$site]); - break; - default: - include("lolrndm.php"); - break; -} -} +<body onload=get_random_video()> + <?php require_once("static/header.html"); ?> + <?php require_once("static/noscript.html"); ?> + <div align='center'> + <div id='middle'> + <h1>Fetching a random youtube video!</h1> + <br> + <p>One moment please.</p> + <br> + <br> + <img src='/static/ajax-loader.gif'> + </div> + </div> + <?php require_once("static/footer.php"); ?> |
