-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresentacion.php
261 lines (201 loc) · 6.72 KB
/
presentacion.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<? session_start(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?
include ('include/meta.php');
include ("include/functions.php");
include ("include/menu.php");
require_once ('include/conexion.php');
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8447274-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>Presentación de imágenes</title>
<style type="text/css">
#foto {
filter: alpha(opacity=100)
}
</style>
<?
$album = $_GET['album'];
$autor = $_GET['autor'];
$directorio = "albums/$album/$autor";
$componentes = explode ("_", $album);
$nombre_bonito = substr_replace ($album, '', -9);
$titulo = $nombre_bonito." (".$componentes[count($componentes)-2]." ".$componentes[count($componentes)-1].") by ".$autor;
$ssql = "SELECT id_foto FROM foto WHERE album = '$album' AND autor = '$autor'";
$result = mysql_query($ssql, $conexion);
$i=0;
while ($fotos = mysql_fetch_array($result))
{
$componentes = explode ("/", $fotos["id_foto"]);
$imagenes[$i] = $componentes[4];
$i++;
}
?>
<script type="text/javascript">
<!--
/*****************************************************************************
Presentación de Imágenes2 (SlideShow) por Tunait! 6/agosto/03
Actualizado el 28/12/2003
Si quieres usar este script en tu sitio eres libre de hacerlo con la condición de que permanezcan intactas estas líneas, osea, los créditos.
http://javascript.tunait.com
******************************************************************************/
var segundos = 5 //cada cuantos segundos cambia la imagen
var dire = <? echo "\"$directorio\""; //directorio o ruta donde están las imágenes ?>
<?
$i=0;
echo "var imagenes=new Array()\n";
foreach ($imagenes as $imag)
{
echo "imagenes[$i]=\"$imag\";\n";
$i++;
}
?>
if(dire != "" && dire.charAt(dire.length-1) != "/")
{dire = dire + "/"}
var preImagenes = new Array()
for (pre = 0; pre < imagenes.length; pre++){
preImagenes[pre] = new Image();
preImagenes[pre].src = dire + imagenes[pre];
}
cont=0
function presImagen(){
document.foto.src= dire + imagenes[cont];
document.getElementById("nfoto").value = cont+1;
subeOpacidad();
if (cont < imagenes.length-1)
{cont = cont+1;}
else
{cont=0;}
tiempo=window.setTimeout('bajaOpacidad()',segundos*1000);
}
var iex = navigator.appName=="Microsoft Internet Explorer" ? true : false;
var fi = iex?'filters.alpha.opacity':'style.MozOpacity';
var opa = iex ? 100 : 1;
function bajaOpacidad(){
opa = 0;
cambia();
presImagen();
}
function subeOpacidad(){
opaci = iex?100:1;
if(opa <= opaci){
cambia();
opa += iex?10: 0.1;
setTimeout('subeOpacidad()',10);
}
}
function cambia(){
eval('document.foto.' + fi + ' = opa');
}
var tiempo
function inicio(){
clearTimeout(tiempo);
bajaOpacidad();
}
function anterior(){
clearTimeout(tiempo)
if (cont > 1)
{
cont = cont-1;
cont = cont-1;
}
else
cont = 0;
bajaOpacidad()
}
function pausa(){
clearTimeout(tiempo);
}
function menos_tiempo()
{
if (segundos > 1)
segundos = segundos-1;
else
segundos = 1;
document.getElementById("segundos").value = segundos;
}
function mas_tiempo()
{
if (segundos < 30)
segundos = segundos+1;
else
segundos = 30;
document.getElementById("segundos").value = segundos;
}
-->
</script>
</head>
<body>
<div id="wrapper" align="center">
<?
if (isset($_SESSION['user_name']))
{
if (mysql_num_rows($result) == 0) // No hay fotos
{
echo "<h1>¡Error!</h1>\n";
echo "<h2>El directorio no existe o la presentación aún no está disponible</h2>\n";
echo "</div></body></html>\n";
exit -3;
}
?>
<br/>
<div id="cabecera">
<?
echo $titulo;
$ssql = "SELECT distinct autor FROM foto WHERE album = '$album';";
$result = mysql_query($ssql, $conexion);
if (mysql_num_rows($result) > 1) // Si hay mas de un autor ponemos todos
{
while ($autor_bucle = mysql_fetch_array($result))
{
if ($autor_bucle["autor"] != $_GET["autor"])
{
?>
♠ <a href="?album=<? echo $album; ?>&autor=<? echo $autor_bucle["autor"]; ?>&pag=1" title="Fotos de <? echo $autor_bucle["autor"]; ?>">Presentación (<? echo $autor_bucle["autor"]; ?>)</a>
<?
}
}
}
?>
<br/><a class="enlace_normal" href="album.php?album=<? echo $album; ?>&autor=<? echo $autor; ?>&pag=1"> Volver al álbum (<? echo $autor; ?>) </a>
</div>
<img src="<? echo "$directorio/$imagenes[0]"; ?>" name="foto" id="foto" alt="Fotos de la presentacion"/>
<table class="presentacion">
<tr>
<td align="center">
<a href="javascript:anterior();" style="border:none"> <img style="border:none;" src="img/btn_retroceso.gif" alt="Botón retroceso"/></a>
<a class="enlace_normal" href="javascript:inicio();" style="border:none"> <img style="border:none;" src="img/btn_play.gif" alt="Botón play"/></a>
<a class="enlace_normal" href="javascript:pausa();" style="border:none"> <img style="border:none;" src="img/btn_pausa.gif" alt="Botón pausa"/></a>
<a class="enlace_normal" href="javascript:inicio();" style="border:none"> <img style="border:none;" src="img/btn_avance.gif" alt="Botón avance"/></a>
<a class="enlace_normal" href="javascript:mas_tiempo();" style="border:none"><img style="border:none;" src="img/btn_mas.gif" alt="Botón mas"/></a>
<a class="enlace_normal" href="javascript:menos_tiempo();" style="border:none"><img style="border:none;" src="img/btn_menos.gif" alt="Botón menos"/></a>
<br/>
<input class="input_presentacion" type="text" name="nfoto" id="nfoto" size="3" value="1" disabled> de <input class="input_presentacion" type="text" name="nfoto" id="nfoto" size="3" value="<?echo "$i";?>" disabled />
<br/><br/>
Transición cada
<input class="input_presentacion" type="text" name="segundos" id="segundos" size="1" value="5" disabled>
segundos
</td>
</tr>
</table>
<?
} // Fin del hay sesión
else
{
echo "<b>Debes iniciar sesión para ver esta presentación.<br/> Ve a <a href=\"fotos.php\" class=\"enlace_normal\">fotos</a> e introduce la password o escribe a <a class=\"enlace_normal\" href=\"mailto:[email protected]\">[email protected]</a> si no la tienes</b>";
}
?>
</div>
<? include ('include/firma.html')?>
</body>
</html>