Procházet zdrojové kódy

maj ok pour les musiques

(faire attention au upload max files size du php ini)
master
heuzef před 10 roky
rodič
revize
586f465e20
7 změnil soubory, kde provedl 195 přidání a 11 odebrání
  1. +26
    -0
      change_music_dark.php
  2. +26
    -0
      change_music_hard.php
  3. +26
    -0
      change_music_light.php
  4. +26
    -0
      change_music_tonic.php
  5. +91
    -11
      index.php
  6. binární
      medias/c0f08ae603e364cb554fe71c9fc94ffd/dark.mp3
  7. binární
      medias/c0f08ae603e364cb554fe71c9fc94ffd/light.mp3

+ 26
- 0
change_music_dark.php Zobrazit soubor

@@ -0,0 +1,26 @@
<?php
include "header.php";
$nom = "dark.mp3";

$uploaddir = './medias/'.$hash.'/';
$uploadfile = $uploaddir . basename($nom);

$extensions_valides = array( 'mp3' );
$extension_upload = strtolower( substr( strrchr($_FILES['userfile']['name'], '.') ,1) );

if ( in_array($extension_upload,$extensions_valides) ) {

$resultat = move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile);

if ($resultat) header("location:index.php?msg=9");
else {
header("location:index.php?msg=10");
}

}

else {
header("location:index.php?msg=10");
}

?>

+ 26
- 0
change_music_hard.php Zobrazit soubor

@@ -0,0 +1,26 @@
<?php
include "header.php";
$nom = "hard.mp3";

$uploaddir = './medias/'.$hash.'/';
$uploadfile = $uploaddir . basename($nom);

$extensions_valides = array( 'mp3' );
$extension_upload = strtolower( substr( strrchr($_FILES['userfile']['name'], '.') ,1) );

if ( in_array($extension_upload,$extensions_valides) ) {

$resultat = move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile);

if ($resultat) header("location:index.php?msg=9");
else {
header("location:index.php?msg=10");
}

}

else {
header("location:index.php?msg=10");
}

?>

+ 26
- 0
change_music_light.php Zobrazit soubor

@@ -0,0 +1,26 @@
<?php
include "header.php";
$nom = "light.mp3";

$uploaddir = './medias/'.$hash.'/';
$uploadfile = $uploaddir . basename($nom);

$extensions_valides = array( 'mp3' );
$extension_upload = strtolower( substr( strrchr($_FILES['userfile']['name'], '.') ,1) );

if ( in_array($extension_upload,$extensions_valides) ) {

$resultat = move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile);

if ($resultat) header("location:index.php?msg=9");
else {
header("location:index.php?msg=10");
}

}

else {
header("location:index.php?msg=10");
}

?>

+ 26
- 0
change_music_tonic.php Zobrazit soubor

@@ -0,0 +1,26 @@
<?php
include "header.php";
$nom = "tonic.mp3";

$uploaddir = './medias/'.$hash.'/';
$uploadfile = $uploaddir . basename($nom);

$extensions_valides = array( 'mp3' );
$extension_upload = strtolower( substr( strrchr($_FILES['userfile']['name'], '.') ,1) );

if ( in_array($extension_upload,$extensions_valides) ) {

$resultat = move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile);

if ($resultat) header("location:index.php?msg=9");
else {
header("location:index.php?msg=10");
}

}

else {
header("location:index.php?msg=10");
}

?>

+ 91
- 11
index.php Zobrazit soubor

@@ -140,15 +140,11 @@ $message[10]='
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a data-toggle="modal" data-target="#modal_change_music_soft" style="color:#CCC;"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;SOFT</a></li>
<li class="divider"></li>
<li><a href="#" style="color:#AAA;"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;TONIC</a></li>
<li class="divider"></li>
<li><a href="#" style="color:#000;"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;HARD</a></li>
<li class="divider"></li>
<li><a href="#" style="color:#ADDFFF;"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;LIGHT</a></li>
<li class="divider"></li>
<li><a href="#" style="color:#8128B5;"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;DARK</a></li>
<li><a data-toggle="modal" data-target="#modal_change_music_soft" style="color:#CCC;" class="btn btn-default"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;SOFT</a></li>
<li><a data-toggle="modal" data-target="#modal_change_music_tonic" style="color:#AAA;" class="btn btn-default"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;TONIC</a></li>
<li><a data-toggle="modal" data-target="#modal_change_music_hard" style="color:#000;" class="btn btn-default"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;HARD</a></li>
<li><a data-toggle="modal" data-target="#modal_change_music_light" style="color:#ADDFFF;" class="btn btn-default"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;LIGHT</a></li>
<li><a data-toggle="modal" data-target="#modal_change_music_dark" style="color:#8128B5;" class="btn btn-default"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;DARK</a></li>
</ul>
</div>
</p>
@@ -301,7 +297,7 @@ $message[10]='
<form class="form-horizontal well" role="form" method="post" action="import_player.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-map"></i>&nbsp;&nbsp;IMPORTER UN JOUEUR</h4>
<h4 class="modal-title"><i class="glyphicon glyphicon-import"></i>&nbsp;&nbsp;IMPORTER UN JOUEUR</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="1004857" />
@@ -322,7 +318,7 @@ $message[10]='
<form class="form-horizontal well" role="form" method="post" action="change_music_soft.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-map"></i>&nbsp;&nbsp;Changer la musique SOFT</h4>
<h4 class="modal-title"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;Changer la musique SOFT</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="100485766" />
@@ -337,6 +333,90 @@ $message[10]='
</div>
</div>

<div class="modal fade" id="modal_change_music_tonic">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="change_music_tonic.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;Changer la musique TONIC</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="100485766" />
<label class="control-label" for="focusedInput">Seul les fichiers <strong>.mp3</strong> (100 Mo max) sont autorisés.</label>
<input class="form-control" id="focusedInput" type="file" name="userfile">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">Changer la musique TONIC</button>
</div>
</form>
</div>
</div>
</div>

<div class="modal fade" id="modal_change_music_hard">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="change_music_hard.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;Changer la musique HARD</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="100485766" />
<label class="control-label" for="focusedInput">Seul les fichiers <strong>.mp3</strong> (100 Mo max) sont autorisés.</label>
<input class="form-control" id="focusedInput" type="file" name="userfile">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">Changer la musique HARD</button>
</div>
</form>
</div>
</div>
</div>

<div class="modal fade" id="modal_change_music_light">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="change_music_light.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;Changer la musique LIGHT</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="100485766" />
<label class="control-label" for="focusedInput">Seul les fichiers <strong>.mp3</strong> (100 Mo max) sont autorisés.</label>
<input class="form-control" id="focusedInput" type="file" name="userfile">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">Changer la musique LIGHT</button>
</div>
</form>
</div>
</div>
</div>

<div class="modal fade" id="modal_change_music_dark">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="change_music_dark.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="ionicons ion-music-note"></i>&nbsp;&nbsp;Changer la musique DARK</h4>
</div>
<div class="modal-body">
<input type="hidden" name="MAX_FILE_SIZE" value="100485766" />
<label class="control-label" for="focusedInput">Seul les fichiers <strong>.mp3</strong> (100 Mo max) sont autorisés.</label>
<input class="form-control" id="focusedInput" type="file" name="userfile">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">Changer la musique DARK</button>
</div>
</form>
</div>
</div>
</div>

<?php elseif($status == 0): ?>

<div class="container-fluid">


binární
medias/c0f08ae603e364cb554fe71c9fc94ffd/dark.mp3 Zobrazit soubor


binární
medias/c0f08ae603e364cb554fe71c9fc94ffd/light.mp3 Zobrazit soubor


Načítá se…
Zrušit
Uložit