-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistenphpmainfile
138 lines (123 loc) · 5.82 KB
/
listenphpmainfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
if(isset($_COOKIE['user']) && isset($_GET['mid'])){
require 'db.php';
include_once 'loginheader.php';
$songid=base64_decode($_GET['mid']);
$sqlstream="SELECT * FROM user_post WHERE image='$songid'";
$resultstream=mysqli_query($conn,$sqlstream);
if($rowstream=mysqli_fetch_assoc($resultstream)){
$username=$rowstream['username'];
$hitid=$rowstream['audio'];
$sql="INSERT INTO streamcount(username,postid) VALUES('$username','$hitid')";
$result=mysqli_query($conn,$sql);
}
}elseif (!isset($_COOKIE['user']) && isset($_GET['mid'])) {
require 'db.php';
$songid=base64_decode($_GET['mid']);
$sqlstream="SELECT * FROM user_post WHERE image='$songid'";
$resultstream=mysqli_query($conn,$sqlstream);
if($rowstream=mysqli_fetch_assoc($resultstream)){
$username=$rowstream['username'];
$hitid=$rowstream['audio'];
$sql="INSERT INTO streamcount(username,postid) VALUES('$username','$hitid')";
$result=mysqli_query($conn,$sql);
}
echo "<!Doctype html>";
echo "<html>";
require 'db.php';
echo "<head>";
echo "<meta charset='utf-8'>
<meta name='description' content=''>
<meta name='viewport' content='width=device-width,initial-scale=1.0'/> ";
$sid=base64_decode($_GET['mid']);
$sql="SELECT * FROM user_post WHERE image='$sid'";
$result=mysqli_query($conn,$sql);
if($row=mysqli_fetch_assoc($result)){
echo "<title>".$row['caption']."</title>";
}
echo "<link rel='stylesheet' type='text/css' href='fontawesome-free/css/all.css'>
<script src='script/jquery-3.3.1.min.js'></script>
";
echo "<link rel='stylesheet' type='text/css' href='css/login.css'>";
echo "</head>";
echo "<body>";
echo "<div style='position:fixed; background:white; width:100%; height:auto; padding:5px 5px; margin-left:0px; top:0px; bottom:auto; z-index:2; padding:4px 4px;'>
<p style='text-align:center; font-weight:400; word-wrap:break-word; line-height:20px;'>Join Instantsound Community and Listen to beautiful songs by upcoming artists. <a href='index.php'>link</a></p>
</div>";
}elseif (isset($_COOKIE['user']) && is_numeric($_GET['mid'])) {
header('Location:home.php');
}elseif (isset($_COOKIE['user']) && strlen($_GET['mid']) < 3) {
header('Location:home.php');
}
elseif (!isset($_COOKIE['user']) && strlen($_GET['mid']) < 3) {
header('Location:home.php');
}
elseif (!isset($_COOKIE['user']) && is_numeric($_GET['mid'])) {
header('Location:home.php');
}
?>
<style type="text/css">
body{
background:black;
}
</style>
<?php
$sid=base64_decode($_GET['mid']);
$sql="SELECT * FROM user_post WHERE image='$sid'";
$result=mysqli_query($conn,$sql);
if($row=mysqli_fetch_assoc($result)){
echo "<div style='position:fixed; background-image:url(image/".$row['image']."); background-size:cover; background-position:center; margin-top:0px; width:100%; height:100%; padding:5px 5px;'>
<marquee style='margin-top:60px; position:fixed; left:0px; width:100%; background:black; opacity :0.8; border:1px solid white; padding:4px 4px; text-transform:uppercase; color:white; margin-left:0px;'></marquee>
";
$songowner=$row['username'];
$sql2="SELECT count(audio) AS total FROM user_post WHERE username='$songowner' AND audio !=''";
$result2=mysqli_query($conn,$sql2);
while($row2=mysqli_fetch_assoc($result2)){
if($row2['total'] > 2){
echo "<form style='margin-top:150px; float:left;' method='POST' action='prev.php'>
<input type='hidden' name='data' value='".base64_decode($_GET['mid'])."'>
<button type='submit' name='prev' style='border:none; border:2px solid white; background:black; opacity:0.8; cursor:pointer; padding:4px 4px; margin-left:5px;'><i class='fa fa-angle-double-left' style='font-size:25px; color:white;'></i></button>
</form>
<form method='POST' style='float:right; margin-top:150px;' action='next.php'>
<input type='hidden' name='data' value='".base64_decode($_GET['mid'])."'>
<button type='submit' name='next' style='border:none; background:black; opacity:0.8; border:2px solid white; cursor:pointer; padding:4px 4px; margin-right:10px;'><i class='fa fa-angle-double-right' style='font-size:25px; color:white;'></i></button>
</form>";
}else{
echo "";
}
}
echo "
<audio id='songelement' value=".$row['userpostid']." onmouseover='streamcount()' onplay='isplaying()' onpause='ispaused()' onended='isended()' ontimeupdate='updateTrackTime()' style='width:100%;' autoplay loop>
<source src='audio/".$row['audio']."' type='audio/mpeg'>
<source src='audio/".$row['audio']."' type='audio/ogg'>
</audio>
<br />
";
?>
</div>
<div class='audio-controller' style='position:fixed; background:none; box-sizing:border-box; width:100%; bottom:0px; padding-top:4px; padding-bottom:4px; '>
<center><button id='audiocontrol' onclick="document.getElementById('songelement').play()" class='playbtn' style=''><i class='fa fa-play-circle' style='font-size:25px;'></i></button>
<button id='audiocontrol' class='pausebtn' style='display:none;' onclick="document.getElementById('songelement').pause()"><i class='fa fa-pause' style='font-size:25px;'></i></button>
</center>
<?php echo"<center><span style='margin-top:10px; display:block;'><a href='audio/".$row['audio']."' style='color:red; font-size:20px; margin-top:10px;' download><i class='fa fa-download' style='color:white; font-size:20px; margin-left:5px;'></i></span></center></a>";
echo"<input id='songdetail' type='hidden' value=' ".base64_decode($_GET['mid'])." '>";
?>
</div>
<script type="text/javascript">
function isplaying(){
$(".pausebtn").css('display','block');
$(".playbtn").css('display','none');
$("marquee").html("Now playing <?php echo $row['caption']; ?>");
}
function ispaused(){
$(".playbtn").css('display','block');
$(".pausebtn").css('display','none');
$("marquee").html("Paused <?php echo $row['caption']; ?>");
}
</script>
<?php
mysqli_close($conn);
}
?>
</body>
</html>