2012-02-27 16:59:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
define("MAIN_DIR", __dir__."/..");
|
|
|
|
|
|
|
|
header("Content-type: text/html;charset=utf-8");
|
|
|
|
|
2012-05-20 08:22:37 +00:00
|
|
|
require(MAIN_DIR."/common.php");
|
2012-02-27 16:59:03 +00:00
|
|
|
?>
|
2012-03-05 21:46:25 +00:00
|
|
|
<!doctype html>
|
2012-02-27 16:59:03 +00:00
|
|
|
<html>
|
2012-03-05 21:46:25 +00:00
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>.: Pommultimédia - Online Converter :.</title>
|
|
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
|
|
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
|
|
|
|
<meta http-equiv="refresh" content="42">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="blk">
|
|
|
|
<h2>Chansons prêtes à être téléchargées</h2>
|
2012-05-20 08:22:37 +00:00
|
|
|
<div class="dled"><?php
|
|
|
|
$list_ready = get_user_ready($user);
|
|
|
|
if (count($list_ready))
|
2012-03-05 21:46:25 +00:00
|
|
|
{
|
2012-05-20 08:22:37 +00:00
|
|
|
foreach ($list_ready as $m)
|
|
|
|
format_clip($user, $m);
|
2012-03-05 21:46:25 +00:00
|
|
|
}
|
2012-05-20 08:22:37 +00:00
|
|
|
else
|
|
|
|
echo "<h3>Pas de nouvelle chanson à télécharger</h3>";
|
|
|
|
?> </div>
|
2012-03-05 21:46:25 +00:00
|
|
|
</div>
|
|
|
|
<div class="blk">
|
|
|
|
<h2>Ajouter une chanson</h2>
|
2012-02-27 16:59:03 +00:00
|
|
|
<?php
|
2012-05-20 08:22:37 +00:00
|
|
|
if ((!empty($_GET["a"]) && $_GET["a"] == "add"
|
|
|
|
&& (!empty($_POST["url"]) || !empty($_SERVER["HTTP_REFERER"])))
|
|
|
|
|| !empty($_GET["url"]))
|
2012-02-27 16:59:03 +00:00
|
|
|
{
|
|
|
|
if (!empty($_GET["url"]))
|
|
|
|
$url = $_GET["url"];
|
|
|
|
elseif (!empty($_POST["url"]))
|
|
|
|
$url = $_POST["url"];
|
|
|
|
else
|
|
|
|
$url = $_SERVER["HTTP_REFERER"];
|
2012-05-20 08:22:37 +00:00
|
|
|
add_url($user, $url);
|
2012-02-27 16:59:03 +00:00
|
|
|
}
|
|
|
|
?>
|
2012-03-05 21:46:25 +00:00
|
|
|
<form method="post" action="?a=add&<?php echo $user; ?>">
|
|
|
|
<label for="url">Adresse :</label> <input type="text" name="url" size="50">
|
|
|
|
<input type="submit" value="Ajouter">
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="blk">
|
|
|
|
<h2>Chansons en file d'attente</h2>
|
|
|
|
<form method="post" action="?a=del">
|
|
|
|
<ul><?php
|
2012-05-20 08:22:37 +00:00
|
|
|
$ecdl = get_ecdl($user);
|
|
|
|
foreach($ecdl as $lign)
|
2012-03-05 21:46:25 +00:00
|
|
|
{
|
2012-05-20 08:22:37 +00:00
|
|
|
echo '<li>'.$lign.' <input type="submit" name="del'.
|
|
|
|
sha1($lign).'" value="Retirer de la liste"></li>';
|
2012-03-05 21:46:25 +00:00
|
|
|
}
|
2012-05-20 08:22:37 +00:00
|
|
|
if (empty($ecdl))
|
|
|
|
echo "<h3>Aucun élément dans cette liste</h3>";
|
|
|
|
?></ul>
|
|
|
|
</form>
|
|
|
|
</div><?php
|
|
|
|
$list_archives = get_user_archives($user);
|
|
|
|
if (count($list_archives))
|
2012-03-05 21:46:25 +00:00
|
|
|
{
|
2012-05-20 08:22:37 +00:00
|
|
|
print '<div class="blk"><h2>Chansons déjà téléchargées</h2><div class="dled">';
|
|
|
|
$last = 0;
|
|
|
|
foreach ($list_archives as $m)
|
2012-02-27 16:59:03 +00:00
|
|
|
{
|
2012-05-20 08:22:37 +00:00
|
|
|
$ths = intval($m["dled"] / 21600);
|
|
|
|
if ($last < $ths)
|
|
|
|
{
|
|
|
|
$last = $ths;
|
|
|
|
echo "<h4>".strftime("%a. %d %b %G - %H:%M", $m["dled"])."</h4>";
|
|
|
|
}
|
|
|
|
format_clip($user, $m);
|
2012-02-27 16:59:03 +00:00
|
|
|
}
|
2012-05-20 08:22:37 +00:00
|
|
|
print '</div></div>';
|
2012-03-05 21:46:25 +00:00
|
|
|
}
|
2012-05-20 08:22:37 +00:00
|
|
|
?></body>
|
2012-03-05 21:46:25 +00:00
|
|
|
</html>
|