-
Notifications
You must be signed in to change notification settings - Fork 0
/
loggedin.php
188 lines (163 loc) · 5.96 KB
/
loggedin.php
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
//REDIRECT TO LOGIN / SIGNUP PAGE
session_start();
$usern=$_SESSION['un'];
if(!$_SESSION['loggedin'])
{
header('location:login_page.php');
}
//PROCESS THE UPLOAD
$fileName="";
if(isset($_POST['done']))
{
include('process_upload.php');
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Taled-It</title>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="fixed.css">
<link rel="stylesheet" href="styles_in.css">
</head>
<body>
<!--Navbar-->
<?php
include('navbar.php');
?>
<!-- DIVIDES THE PAGE INTO THREE COLUMNS -->
<div class="container-fluid" style="margin-top:5em;">
<div class="row mb-3">
<!-- PLAYLIST -->
<div class="col-3 playlist" >
<div style="margin-top:10vh;position:fixed;text-align:center;background-color:rgb(25,255,81);width:22%;border-radius:20px;"><span class="lead" style="font-size:1.5em;">Playlist</span></div><br>
<div class="playlists" style="overflow:auto;padding:1em;position:fixed;margin-top:12vh;border-radius:20px;background-color:rgb(25,255,81);height:70vh;width:22%;">
<?php include('playlist.php'); ?>
</div>
</div>
<!-- POSTS TO FEED -->
<div class="col-5 important">
<!--Add file-->
<?php
//include('upload.html');
//Added File
//include('tales.php');
//Posts
include('AllPosts.php');
?>
</div>
<!-- HITS -->
<div class="col-4 status">
<div style="margin-top:10vh;position:fixed;text-align:center;background-color:rgb(25,255,81);width:29%;border-radius:20px;"><span class="lead" style="font-size:1.5em;">Hits</span></div><br>
<div class="playlists" style="padding:1em;overflow:auto;position:fixed;margin-top:12vh;border-radius:20px;background-color:rgb(25,255,81);height:70vh;width:30%;">
<?php include('hits.php'); ?>
</div>
</div>
</div>
</div>
<script src="jquery3.1.4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="bootstrap.min.js"></script>
<!-- TO HIDE THE SEARCH RESULTS -->
<script>
$(function(){
$(".cross").click(function(e){
$(".list").css('display','none');
e.preventDefault();
});
});
</script>
<!-- TO SHOW EXTENDED FORM FOR UPLOADING THE FILE -->
<script>
$(function(){
$(".uplbtn").click(function(e){
$(".uplbtn").css('display','none');
$(".uplform").css('display','inline');
e.preventDefault();
});
});
</script>
<!-- HANDLING COMMENT DISPLAY AND NEW COMMENTS -->
<script>
$(".comment").click(function(){
var id=$(this).val();
var $element=$(this);
$(".comments").css('display','none');
$(".commenthere").css('display','none');
$(".newcomment").css('display','none');
$(".comments"+id).css('display','inline');
$(".commenthere"+id).css('display','inline');
$(".postcomment"+id).click(function(){
var cmt=$(".iscomment"+id).val();
var un="<?php echo $usern; ?>"
if(cmt != ''){
$(".iscomment"+id).val();
$.post(
"commentajax.php",
{cmt: cmt,
id: id,
un:un},
function(data){
$(".newcomment"+id).children("span").text(data);
$(".newcomment"+id).css('display','inline');
}
);
}
$(".commenthere"+id).css('display','none');
});
});
</script>
<!-- ADDING AUDIOS TO PLAYLIST -->
<script>
$(".playlist").click(function(){
var id=$(this).val();
var ele=$(this);
var un="<?php echo $usern; ?>"
$.post(
"playlistajax.php",
{id: id,
un: un},
function(data){
$(ele).text(data);
}
);
});
</script>
<!-- HANDLING LIKES ON A POST -->
<script type="text/javascript">
$(".like").click(function(){
var id=$(this).val();
var $element=$(this);
var uname="<?php echo $usern; ?>";
$.post(
"likeajax.php",
{id: id,
uname: uname},
function(data){
$($element).children(".result").text(data);
}
);
});
</script>
<!-- FOLLOW SOMEONE -->
<script>
$(".join").click(function(){
var follow=$(this).val();
var element=$(this);
var follower="<?php echo $usern; ?>";
$.post(
"follow.php",
{follow: follow,
follower: follower},
function(data){
$(element).text(data);
}
);
});
</script>
</body>
</html>