require "/var/www/costantix.php"; require "/var/www/html/bici/gps/gps_funzioni.php"; if (!isset($Album)) $Album = '1914EBOL'; if (!isset($fotoLat)) $fotoLat = 45.5; if (!isset($fotoLon)) $fotoLon = 12.1; if (!isset($fotoZoom)) $fotoZoom = 16; $luogo = '?'; $conn = mysql_connect(HOST, DEFAULT_USER, DEFAULT_PWD) or die ('Connessione rifiutata'); mysql_select_db("famiglia") or die ('Errore su DB'); $contaFoto = 0; $cur = mysql_query("SELECT count(*) FROM album a, foto f WHERE a.sigla = f.album AND a.sigla = '$Album'"); if ($riga = mysql_fetch_row($cur)) $contaFoto = $riga[0]; if (isset($Scelta)) $fotoOrd = $Scelta; else $fotoOrd = 0; if (isset($Prev)) { --$fotoOrd; if ($fotoOrd < 0) $fotoOrd = $contaFoto-1; } else if (isset($Next)) { ++$fotoOrd; if ($fotoOrd >= $contaFoto) $fotoOrd = 0; } $cur = mysql_query(" SELECT f.anno, f.titolo, f.commento, f.Lat, f.Lon, f.Zoom, a.titolo, f.file, a.commento FROM album a, foto f WHERE a.sigla = f.album AND a.sigla = '$Album' AND f.ord = '$fotoOrd' "); if (mysql_error()) echo mysql_error(); if ($riga = mysql_fetch_row($cur)) { $fotoAnno = $riga[0]; $fotoTitolo = $riga[1]; $fotoCommento = decode_utf8($riga[2]); $fotoLat = $riga[3]; $fotoLon = $riga[4]; $fotoZoom = $riga[5]; $albumTitolo = $riga[6]; $fotoFile = $riga[7]; $fotoData = getFotoData($fotoFile); $albumCommento = decode_utf8($riga[8]); if (isset($fotoData)) $fotoCommento .= " (foto del $fotoData)"; if ($fotoZoom < 16) $luogo = 'più o meno qui'; else $luogo = 'qui'; } ?>