2021-09-18 23:57:50 +02:00
|
|
|
<?php
|
|
|
|
require_once('conf.php');
|
|
|
|
|
2021-09-21 18:40:55 +02:00
|
|
|
$bodyClasses = isset($bodyClasses) ? $bodyClasses : '';
|
|
|
|
$bodyClasses .= $home ? 'home' : '';
|
2021-09-18 23:57:50 +02:00
|
|
|
|
|
|
|
?><!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2021-09-21 18:40:55 +02:00
|
|
|
<title>Astroport "<?php echo STATION_NAME; ?>"</title>
|
2021-09-18 23:57:50 +02:00
|
|
|
<link rel="stylesheet" href="styles/<?php echo THEME; ?>/style.css" type="text/css" />
|
|
|
|
<link rel="icon" type="image/png" href="./styles/<?php echo THEME; ?>/logo.png" />
|
|
|
|
</head>
|
2021-09-21 18:40:55 +02:00
|
|
|
<body class="<?php echo $bodyClasses; ?>">
|
2021-09-18 23:57:50 +02:00
|
|
|
|
|
|
|
<header>
|
|
|
|
<?php $elt = isset($home) ? 'h1' : 'h6'; ?>
|
|
|
|
|
|
|
|
<<?php echo $elt; ?>>
|
|
|
|
<a href="youtube.php">Astroport "<span><?php echo STATION_NAME; ?></span>"</a>
|
|
|
|
</<?php echo $elt; ?>>
|
|
|
|
|
|
|
|
<p class="usp">
|
|
|
|
<?php echo TAGLINE; ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<form method="post" action="" class="add-video">
|
|
|
|
<label for="youtube_url">Sauvegarder une vidéo Youtube :</label>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if (!isset($_POST['youtube_url'])) {
|
|
|
|
|
|
|
|
$out = '';
|
|
|
|
$placeholder = 'https://www.youtube.com/watch?v=ASywAfBAVrQ';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$out = '
|
|
|
|
<p class="confirmation">Votre vidéo est en cours de téléchargement…</p>
|
|
|
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
|
|
<script>
|
|
|
|
$.ajax({
|
|
|
|
method: "POST",
|
|
|
|
url: "youtube_add_video_aux.php",
|
|
|
|
data: { youtube_url: "'. $_POST['youtube_url'] .'" }
|
|
|
|
})
|
|
|
|
.done(function( response ) {
|
|
|
|
console.log(response);
|
|
|
|
});
|
|
|
|
</script>';
|
|
|
|
|
|
|
|
$placeholder = htmlspecialchars($_POST['youtube_url']);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<input type="text" name="youtube_url" placeholder="<?php echo $placeholder; ?>" size="45" />
|
|
|
|
<input type="submit" value="Mon précieux !" />
|
|
|
|
|
|
|
|
<?php
|
|
|
|
echo $out;
|
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<main>
|