-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
199 lines (154 loc) · 4.7 KB
/
index.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
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html>
<head>
<title>77Digital</title>
<meta charset="utf-8" />
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="css/style.css" TYPE="text/css" MEDIA=screen>
<link rel="stylesheet" href="css/jquery.mobile-1.0rc2.min.css" />
<link rel="stylesheet" href="css/main.css" />
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.0rc2.min.js"></script>
<!-- notificaciones -->
<script type="text/javascript" src="js/noty/jquery.noty.js"></script>
<script type="text/javascript" src="js/noty/layouts/topCenter.js"></script>
<script type="text/javascript" src="js/noty/themes/default.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<!-- para publicar en facebook -->
<script type="text/javascript" src="js/simpleFacebookGraph.js"></script>
</head>
<body>
<?php
require_once ('sdk/facebook.php'); // FACEBOOK PHP SDK v3.2.0-0-g98f2be1
require_once ('music.php'); //base de datos app
//parametro de la app paa facebook
$facebook = new Facebook(array(
'appId' => '369466053131869',
'secret' => '75715a48ec6547da5477fb9ef6ada8ce',
));
// Obtener el ID del Usuario
$user = $facebook->getUser();
if ($user) {
try {
// errores se guardan en un archivo de texto (error_log)
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
//toma datos del logueo
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
}
//no logueado -> pagina de logueo\
$loginpage = "http://www.laquesigue.com/login.php";
if (!$user) {
echo "<script type='text/javascript'>top.location.href = '$loginpage';</script>";
exit;
}else{
//loqueado
//mensaje de bienvenida
if( !isset($_SESSION['bienvenida']) ){
echo '<script type="text/javascript">notifica("Bienvenido '.$_SESSION['nombre'].'")</script>';
$_SESSION['bienvenida'] = true; //ha sido notificado
}
//status 0 -> libre, 1 -> voto, 2-> artista, 3 -> busqueda
$status = 0;
$like = '';
$artista = '';
$search = '';
//envio
if (isset($_POST['like']) || isset($_POST['search'])){
if(isset($_POST['like'])){
$like = $_POST['like'];
$status = 1;
//echo '<SCRIPT TYPE="text/javascript">alert (\'Voto ha '.$_POST['like'].'\');</SCRIPT>';
}
if(isset($_POST['search']) && $_POST['search'] != '' ){
$search = $_POST['search'];
$status = 2;
//echo '<SCRIPT TYPE="text/javascript">alert (\'Buscando '.$_POST['search'].'\');</SCRIPT>';
}
//echo '<SCRIPT TYPE="text/javascript">alert (\'Status '.$status.'\');</SCRIPT>';
}
?>
<form id="index" action="index.php" method="post">
<div data-role="page" class="page right" id="home">
<div class="app">
<!-- boton del menu -->
<div class="menuicon" >
<!-- id -> 1 activo, id -> 0 no activo -->
<img src="images/appmenu.png" class="showMenu" onClick="move()" id="menu0">
</div>
<!-- logo -->
<a href="http://77digital.com/" target="_blank">
<img class="logo" src="images/logo.png" onClick="redireccionar('')">
</a>
</div>
<div class="sidebar">
<?php
//presenta los albums, resultados o canciones de un artista
switch ($status) {
case 0:
album();
$status = 0;
echo '<div class="limpiar" onClick="sube(\'\')">Subir</div>';
break;
case 1:
voto($like);
album();
$status = 0;
break;
case 2:
$status = 0;
buscar($search);
echo '<div class="limpiar" onClick="redireccionar(\'\')">Limpiar</div>';
break;
}
?>
<!-- fin sidebar -->
</div>
<!-- fin page and home -->
</div>
<div class="left" id="menu">
<div class="topbar">
<div class="search">
<input type="text" value="" name="search" autocomplete="on" placeholder="buscar...">
<img src="images/search.png" id="searchimg">
<!-- <input type="bottom" src="images/search.png" id="searchimg" value="search" > -->
</div>
</div>
<div class="content">
<div class="vote">
<img src="images/like.png">
<h1>vote</h1>
</div>
<div class="list">
<div class="populares" onClick="redireccionar('')" >
<img src="images/populares.png">
<h1> mas populares </h1>
</div>
<div class="songs">
<div id="songs">
<img src="images/dropdown.png" id="dropdown">
<h1>artistas..</h1>
</div>
<div id="songslist" action="index.php">
<?php
artistas();
?>
</div>
</div>
</div>
</div>
</div>
<!-- fin formulario -->
</form>
<?
}
?>
</body>
</html>