Skip to content

Instantly share code, notes, and snippets.

@ennjoy
Created June 19, 2019 10:28
Show Gist options
  • Save ennjoy/5628d545f7d5453d25495558a2f21672 to your computer and use it in GitHub Desktop.
Save ennjoy/5628d545f7d5453d25495558a2f21672 to your computer and use it in GitHub Desktop.
audio vkrimu.php
<?php
if( $_FILES["audio"]["tmp_name"] ) {
$file = explode('.', $_FILES["audio"]);
$filter = ('mp3');
if (in_array($file['1'], $filter)) {
mysqli_query( $dbConnect , "UPDATE network SET wall_spam = '$time_wall_spam3' WHERE id = '$my_id'" );
if($wall11_spam <= $server_time1 ) {
$file_name = $_FILES["audio"]["name"];
$file_tmp = $_FILES["audio"]["tmp_name"];
$gwfjjv = $file_name;
$fixformat = array(
".mp3" => '',
"'" => '',
);
$gwfjjv2 = str_replace(array_keys($fixformat), $fixformat, $gwfjjv);
if(preg_match('/audio\/*/',$_FILES['audio']['type'])) {
$name = time().gen_name(8);
$file_name = $name.'.'.strtolower(end(explode(".",$file_name)));
$sql_name = $folder2.'/'.$file_name;
move_uploaded_file($file_tmp, $sql_name);
$descr = escaper_mysql( $_POST['descr'] );
if( !strlen( str_replace( " ", "", $descr ) ) ) $descr = $gwfjjv2;
$audio = array(
"name" => $sep_folder.$id.'/'.$file_name,
"description" => $descr,
);
$audio = json_encode($audio, JSON_UNESCAPED_UNICODE);
$audio_res = mysqli_query($dbConnect , "INSERT INTO audios ( prof,author,time,audio ) VALUES ('$id','$author','$time','$audio')");
$audio_res = mysqli_query( $dbcoin , "UPDATE users SET coinz = coinz+50 WHERE user_id = '$id'" );
$audio_get = mysqli_query( $dbConnect , "SELECT id FROM audios WHERE prof='$id' AND author='$author' ORDER BY id DESC LIMIT 1" );
$get_id = mysqli_fetch_array( $audio_get , MYSQLI_ASSOC );
if( !$author ) {
update_rating( $my_id , 100 );
mysqli_query( $dbConnect , "UPDATE network SET ball = ball+3 WHERE id = '$id'" );
$string = check_array( $user_row['audios'] , $get_id['id'] );
mysqli_query( $dbConnect, "UPDATE network SET audios='$string' WHERE id='$id'" );
} else {
$string = check_array( get_club( $id , 0 , 0 )['audios'] , $get_id['id'] );
mysqli_query( $dbConnect, "UPDATE clubs SET audios='$string' WHERE id='$id'" );
}
if($author == "0") {
$getpol = mysqli_query($dbConnect, "SELECT id, gender FROM `network` WHERE id = '$id' LIMIT 1 ");
$getpol2 = mysqli_fetch_assoc($getpol);
$gender = $getpol2['gender'];
if($gender == "1") {
$genderyes = "а";
}
$gettextcoin = "Я добавил$genderyes новую песню и получил +50 к ускорению";
}
$res = mysqli_query($dbConnect , "INSERT INTO news ( prof_id,author,text,followers,audio,time ) VALUES ('$id','$author','$gettextcoin','$followers','".$get_id['id']."','$time')");
if( $res && $audio_res ) echo 1;
}
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment