Ciao avrei un problemino vorrei dividere i risultati della gallery in pagine .
Perche e troppo pesante caricare tutto su una pagina
il file e lungo , lo posto e spero che qualcuno possa aiutarmi perche non riesco .
questo e il codice che stampa a video tutti i risultati
Perche e troppo pesante caricare tutto su una pagina
il file e lungo , lo posto e spero che qualcuno possa aiutarmi perche non riesco .
PHP:
<?php
session_start();
header ("cache-control: no-cache, must-revalidate");
header("Cache-control: private");
header ("pragma: no-cache");
error_reporting(0);
if(!isset($_SESSION['login']))
{Header('Location:index.php'); exit; }
$login=$_SESSION["login"];
@require_once("setting.inc.php");
@require_once("detect.inc.php");
if(@file_exists($suff."_deletenick/$login.txt"))
{Header('Location:chat.php'); exit; }
//controllo BANN NICK
@require_once("bann.inc.php");
if(bannnick($login,"ipnondefinito","proxynondefinito",$suff))
{header("location: chat.php");exit;}
$level=0;
//controllo se membro STAFF
if(@file_exists($suff."_staff/$login.txt"))
{
$level=@file($suff."_staff/$login.txt");
$level=trim($level[0]);
}
$var66=@file("database/".$suff."_settingchat.txt");
$rigass=trim($var66[0]);
$arrdat=explode("||",$rigass);
//NEWMP
$nonletto=0;
if(@file_exists($suff."_mp/$login.txt"))
{
$mp=@file($suff."_mp/$login.txt");
$totmp=count($mp);
for($a=($totmp-1); $a>=0; $a--){
$esplodo=explode("||",$mp[$a]);
if($esplodo[2]==0)
{$nonletto=1; break;}
}//end for
}
if($nonletto==1){$newmp="newmail";}else{$newmp="mail";}
if(!@file_exists($suff."_hid/$login.txt"))
{//aggiorno time online
$string=time();
if (@file_exists($suff."_room/$login.txt"))
{$a = @fopen($suff."_online2/$login.txt", "w+");
@fwrite($a, $string);
@fclose($a);}
else{$a = @fopen($suff."_online1/$login.txt", "w+");
@fwrite($a, $string);
@fclose($a);}
//memorizzo azione
$var34=@fopen($suff."_azione/$login.txt","w+");
@fwrite($var34,"GALLERY");
@fclose($var34);
}
if(isset($_GET['user'])){
$user=trim($_GET['user']);
$user = ereg_replace("[^a-zA-Z0-9]+","",$user);}else{$user=$login;}
$page="list";
if(isset($_GET['page'])) {$page=trim($_GET['page']);}
//SE DA PC lo rimando a gallery2
if(isset($_GET['r']) OR isset($_GET['q']) OR isset($_GET['k']))
{}
elseif($dispositivo=="PC" AND $page=="view")
{header("location:gallery2.php?page=view&user=".$user); exit;}
if($page=="avatar")
{
if(!isset($_GET['img']) OR empty($_GET['img'])){Header('Location:gallery.php?page=view'); exit;}
if(isset($_GET['inizio'])){$inizio=trim($_GET['inizio']); $inizio = ereg_replace("[^0-9]+","",$inizio);}else{$inizio=0;}
//verifico se esiste quella data img per login
$img=trim($_GET['img']);
$img = ereg_replace("[^0-9]+","",$img);
$trovato=0;
if(@file_exists("gallery/$login/l_lista.txt"))
{
$fp=@file("gallery/$login/l_lista.txt");
$totfoto=count($fp);
for($m=0; $m<$totfoto; $m++)
{
$dati=explode("||",$fp[$m]);
if(trim($dati[0])==$img)
{ $trovato=1; break;}}//end for
}
if($trovato==0){Header('Location:gallery.php?page=view'); exit;}
//imposto quella IMG come AVATAR
$var=@fopen($suff."_avatar/$login.txt","w+");
@fwrite($var,$img);
@fclose($var);
if($dispositivo=="PC"){Header("Location:gallery.php?page=view&k=&user=".$login."&img=".$img."&inizio=".$inizio); exit;}
else{Header("Location:gallery.php?page=view&k=&user=".$login."&img=".$img."&inizio=".$inizio); exit;}
}
if($page=="voto")
{
if(!isset($_GET['img']) OR empty($_GET['img']) OR !isset($_GET['user']) OR empty($_GET['user'])){Header('Location:gallery.php?page=view'); exit;}
if(isset($_GET['inizio'])){$inizio=trim($_GET['inizio']); $inizio = ereg_replace("[^0-9]+","",$inizio);}else{$inizio=0;}
$user=trim($_GET['user']);
$user = ereg_replace("[^a-zA-Z0-9]+","",$user);
//verifico se esiste quell USER
$trovato=0;
$fp=@file("database/".$suff."_regnick.txt");
for($j=0; $j<(count($fp)); $j++)
{
$dati=explode("||",$fp[$j]);
if($dati[0]==$user)
{$trovato=1; break;}
}//end for
if($trovato==0 OR $user==$login OR !@is_dir("gallery/".$user)){Header('Location:gallery.php?page=view'); exit;}
//verifico se esiste quella data img
$img=trim($_GET['img']);
$img = ereg_replace("[^0-9]+","",$img);
$trovato=0;
if(@file_exists("gallery/$user/l_lista.txt"))
{
$fp=@file("gallery/$user/l_lista.txt");
$totfoto=count($fp);
for($m=0; $m<$totfoto; $m++)
{
$dati=explode("||",$fp[$m]);
if(trim($dati[0])==$img)
{ $trovato=1; break;}}//end for
}
if($trovato==0){Header('Location:gallery.php?page=view'); exit;}
//prelevo impostazioni user per verificare se accetta voti sulle FOTO
$var=@file($suff."_impostaz/$user.txt");
$dati=explode("||",$var[0]);
$valida=trim($dati[3]);
if($valida==0){Header("Location:gallery.php?page=view&user=".$user."&img=".$img."&inizio=".$inizio."&q="); exit;}
if(isset($_POST['voto'])){$voto=trim($_POST['voto']);}
if(isset($_GET['voto'])){$voto=trim($_GET['voto']);}
$voto = ereg_replace("[^0-9]+","",$voto);
if($voto!=2 AND $voto!=4 AND $voto!=6 AND $voto!=8 AND $voto!=10)
{Header('Location:gallery.php?page=view'); exit;}
$giavotato=0;
//verifico se gia' ho votato
if(@file_exists("gallery/$user/t_".$img.".txt"))
{
$fp=@file("gallery/$user/t_".$img.".txt");
$contauser=count($fp);
for($t=0; $t<$contauser; $t++)
{
if(trim($fp[$t])==$login){$giavotato=1;}
}//end for
}
if($giavotato==1){Header("Location:gallery.php?page=view&user=".$user."&img=".$img."&inizio=".$inizio); exit;}
//CONTROLLO SE SONO NELLA LISTA NERA DELLA CHAT DI USER
if(@file_exists($suff."_listanera/$user.txt"))
{ $nera=@file($suff."_listanera/$user.txt");
$contanera=count($nera);
for($h=0; $h<$contanera; $h++)
{ if(trim($nera[$h])==$login){Header("Location:gallery.php?page=view&user=".$user."&img=".$img."&inizio=".$inizio."&r="); exit; }
}
}
$votonuovo=$voto;
if(@file_exists("gallery/$user/v_".$img.".txt"))
{
$fr=@file("gallery/$user/v_".$img.".txt");
$sommavoti=trim($fr[0]);
$votonuovo=($sommavoti+$voto);
}
$var=@fopen("gallery/$user/v_".$img.".txt","w+");
@fwrite($var,$votonuovo);
@fclose($var);
$var=@fopen("gallery/$user/t_".$img.".txt","a+");
@fwrite($var,"$login\n");
@fclose($var);
//INVIO MP A USER
function genera($numero)
{
//stringa alfanumerica
$lunghezza_password = $numero;
for ( $k=1; $k<=$lunghezza_password; $k++ )
{
// $k multiplo di 3
if ( $k % 3 )
{
// Scegliamo se maiuscola o minuscola
if ( rand( 0,200 ) <= 100 )
{
// Maiuscola
// Nella tabella ASCII da 65 a 90 ci sono le lettere dell'alfabeto Maiuscole
$newpass .= chr( rand ( 65,90 ) );
}
else
{
// Minuscola
// Nella tabella ASCII da 97 a 122 ci sono le lettere dell'alfabeto Minuscole
$newpass .= chr( rand ( 97,122 ) );
}
}
// $k non è multiplo di 3
else
{
// Inseriamo un numero
$newpass .= rand( 0,9 );
}
} return $newpass;}
$msg="<a href='profilo.php?user=$login&page=ricerca'>$login</a> ha assegnato il voto di $voto/10 per una tua foto <a href='gallery.php?page=view&user=$user&img=$img&inizio=$inizio'>CLICCA QUI</a>";
$insert=time();
$id=genera(10);
$riga="INFO-CHAT||".$msg."||0||".$id."||".$insert;
$var=@fopen($suff."_mp/$user.txt","a+");
@fwrite($var,"$riga\n");
@fclose($var);
if($dispositivo!="PC"){Header("Location:gallery.php?page=view&user=".$user."&img=".$img."&inizio=".$inizio); exit;}
else{Header("Location:gallery2.php?page=view&user=".$user); exit;}
}//fine PAGE VOTO
if($page=="delete")
{
if(!isset($_GET['img']) OR empty($_GET['img'])){Header('Location:gallery.php?page=view'); exit;}
$gallnick=$login;
if(isset($_GET['gall']) AND $level>=$arrdat[4])
{
$gallnick=trim($_GET['gall']);
$gallnick = ereg_replace("[^a-zA-Z0-9]+","",$gallnick);}
//verifico se esiste quell USER
$trovato=0;
$fp=@file("database/".$suff."_regnick.txt");
for($j=0; $j<(count($fp)); $j++)
{
$dati=explode("||",$fp[$j]);
if($dati[0]==$gallnick)
{$trovato=1; break;}
}//end for
if($trovato==0 OR !@is_dir("gallery/".$gallnick)){Header('Location:gallery.php?page=view'); exit;}
//rimuovo quella data img (se esiste)
$img=trim($_GET['img']);
$img = ereg_replace("[^0-9]+","",$img);
$trovato=0;
if(@file_exists("gallery/$gallnick/l_lista.txt"))
{
$fp=@file("gallery/$gallnick/l_lista.txt");
$totfoto=count($fp);
for($m=0; $m<$totfoto; $m++)
{
$dati=explode("||",$fp[$m]);
if(trim($dati[0])==$img)
{ $trovato=1;
if($totfoto>1)
{
unset($fp[$m]);
$var8787=@fopen("gallery/$gallnick/l_lista.txt","w+");
foreach ($fp as $chiave => $value)
{@fputs($var8787,$value);}
@fclose($var8787);}else{unlink("gallery/$gallnick/l_lista.txt");}
break;}}//end for
}
if(@file_exists("gallery/$gallnick/$img.jpg")){@unlink("gallery/$gallnick/$img.jpg");}
if(@file_exists("gallery/$gallnick/c_".$img.".txt")){@unlink("gallery/$gallnick/c_".$img.".txt");}
if(@file_exists("gallery/$gallnick/v_".$img.".txt")){@unlink("gallery/$gallnick/v_".$img.".txt");}
if(@file_exists("gallery/$gallnick/t_".$img.".txt")){@unlink("gallery/$gallnick/t_".$img.".txt");}
function elimina($dirname){
if(@is_dir($dirname)){
$handle = opendir($dirname);
while (false !== ($file = readdir($handle))) {
if(is_file($dirname.$file)){
unlink($dirname.$file);
}
}
$handle = closedir($handle);
rmdir($dirname);
}
}
$conta=0;
$results = array();
$handler = opendir("gallery/".$gallnick);
while ($file = readdir($handler)) {
if ($file != '.' && $file != '..' && substr($file, 0, 2) != "l_" && substr($file, 0, 2) != "c_" && substr($file, 0, 2) != "v_" && substr($file, 0, 2) != "t_")
{$conta++;}
}
closedir($handler);
//rimuovo quella data IMG anche da LASTFOTO se esiste
if(@file_exists("database/".$suff."_lastfoto.txt"))
{
$fp=@file("database/".$suff."_lastfoto.txt");
$totfoto=count($fp);
for($m=0; $m<$totfoto; $m++)
{
$dati=explode("||",$fp[$m]);
if(trim($dati[1])==$img)
{
if($totfoto>1)
{
unset($fp[$m]);
$var8787=@fopen("database/".$suff."_lastfoto.txt","w+");
foreach ($fp as $chiave => $value)
{@fputs($var8787,$value);}
@fclose($var8787);}else{unlink("database/".$suff."_lastfoto.txt");}
break;}}//end for
}
if($conta==0) {$vai=elimina("gallery/".$gallnick."/");}
if($gallnick!=$login AND $trovato==1)
{//SCRIVO LOG in azioni user txt
function ipCheck() {
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
}
elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
elseif (getenv('HTTP_X_FORWARDED')) {
$ip = getenv('HTTP_X_FORWARDED');
}
elseif (getenv('HTTP_FORWARDED_FOR')) {
$ip = getenv('HTTP_FORWARDED_FOR');
}
elseif (getenv('HTTP_FORWARDED')) {
$ip = getenv('HTTP_FORWARDED');
}
else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
$ip= htmlspecialchars(ipCheck());
$ipproxy = $_SERVER["REMOTE_ADDR"];
$cell="nondefinito";
if(!empty($subno))
{$cell=$subno;}
if(!empty($h3g))
{$cell=md5($h3g);}
$data=@time();
$modcell="";
if(isset($_SERVER["HTTP_X_DEVICE_USER_AGENT"]))
{$modcell=htmlentities($_SERVER["HTTP_X_DEVICE_USER_AGENT"]);
$modcell = str_replace(array("\r\n", "\r", "\n"), "", $modcell);
$modcell = str_replace("|","", $modcell);}
if($cell=="nondefinito" AND !empty($opera))
{$cell=$opera;}
$isp=gethostbyaddr($_SERVER['REMOTE_ADDR']);
if($ip==$ipproxy)
{$ipproxy="no proxy";}
//avviso in azioni user
$msg="$login ha eliminato una foto di $gallnick";
$variabile="0||<img boder=0 alt='INFO' src='info.gif'>||avatar||FOTO RIMOSSA||".$msg."||#CC0077||".$ipproxy."||".$ip."||".$modcell."||".$browser."||".$isp."||".$cell."||".$data;
$var=@fopen("database/".$suff."_azioniuser.txt","a+");
@fwrite($var,"$variabile\n");
@fclose($var);}
if($dispositivo=="PC")
{if($gallnick!=$login)
{Header("Location:gallery2.php?page=view&user=".$gallnick); exit;}
else{Header("Location:gallery2.php?page=view"); exit;}}
if($gallnick!=$login)
{Header("Location:gallery.php?page=view&user=".$gallnick); exit;}
else{Header("Location:gallery.php?page=view"); exit;}
}//fine page DELETE
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="shortcut icon" href="favicon.ico" >
<link rel="icon" href="favicon.ico" >
<META http-equiv="Content-Type" content="text/html; charset=utf-8" >
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META NAME="KEYWORDS" CONTENT="chat,cellulari,mobile,telefonia,wap,chat gratuita,incontri,amicizia">
<META NAME="DESCRIPTION" CONTENT="Chat gratuita accessibile anche da cellulare">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<META NAME="REVISIT-AFTER" CONTENT="1 DAYS">
<META NAME="RATING" CONTENT="GENERAL">
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="jquery-dd.js"></script>
<link rel="stylesheet" type="text/css" href="stylechatcell.css">
<div id="border_radius_background" class="border_radius_css3">
<div id="border_radius_groove" class="border_radius_css3">
<ul id="nav">
<li>
<a href="chat.php" title="Chat">Chat</a>
</li>
<li>
<a href="#" menu messaggeria>Messaggi</a>
<ul>
<li class="icon invia"><a href="mp.php?page=send">Invia Mp</a></li>
<li class="icon inviati"><a href="outbox.php">Mp Inviati</a></li>
<li class="icon cancell"><a href="mp.php?page=deleteconf&idmail=all">Canc MP ricevuti</a>
<li class="icon cancell"><a href="outbox.php?page=deleteconf">Canc MP inviati</a>
</ul>
</li>
<li><a href='mp.php'><img src='<?php echo $newmp;?>.png' border='0' title='MP'></a></li>
<li><a href='admin.php'>Admin</li>
<li><a href='listamici.php'><img src="cartamici/red<?
if(@file_exists($suff."_richiestamicizia/$login.txt"))
{
$open = @file($suff."_richiestamicizia/$login.txt");
$i=count($open);
echo "$i";
}
?>.png" border="0" title="Richiesta d amicizia"></a></li>
<li>
<?
/// CONTROLLO PVT //////
if(@file_exists("richiesta/$login.txt"))
{
$open = @file("richiesta/$login.txt");
$i=count($open);
echo "<a href='listapvt.php'>Hai $i Richiesta/e di PVT</a>";
}
if(@file_exists("accettato/$login.txt"))
{
$open = @file("accettato/$login.txt");
$j=count($open);
echo "<a href='listapvt.php'>Hai $j PVT in corso</a>";
}
?></li>
</ul></div>
<div id="border_radius_inset" class="border_radius_css3"><br>
<title><?php $titolo= utf8_encode ($title); echo $titolo; ?></title>
<link rel="stylesheet" type="text/css" href="stylechatcell.css"></head>
<body>
<?php
/// CONTROLLO PVT //////
if(@file_exists("richiesta/$login.txt"))
{
$open = @file("richiesta/$login.txt");
$i=count($open);
echo "<br/>";
}
if(@file_exists("accettato/$login.txt"))
{
$open = @file("accettato/$login.txt");
$j=count($open);
echo "<br/>";
}
if($page=="list")
{
$handler = @opendir("gallery");
$list=array();
$number=array();
while ($file = @readdir($handler)) {
if($file != '.' AND $file != '..' AND @is_dir("gallery/".$file))
{
$handle = @opendir("gallery/".$file);
$count = 0;
while ($file1 = @readdir($handle)) {
if ($file1 !== '.' && $file1 !== '..' && @is_file("gallery/".$file."/".$file1) && substr($file1, 0, 2) != "l_" && substr($file1, 0, 2) != "c_" && substr($file1, 0, 2) != "v_" && substr($file1, 0, 2) != "t_") {$count++;}
}
closedir($handle);
if ($count > 0 ) {$name= $file; $list[$name] = strtolower($name); $number[$name] = $count;}
}}
@closedir($handler);
asort($list);
echo "<img border=0 src='image.png'> GALLERY";
if(count($list)==0) echo "Nessuna foto presente...";
if(count($list)>0) echo "<center><div id=\"border_radius_groove\" class=\"border_radius_css3\">
<a href='?page=lastfoto'>ULTIME FOTO</a><br>";
echo "<a href='galleryupload.php'>INSERISCI FOTO</a></div></center>";
foreach($list as $chiave => $valore)
{
//colore personale
$var25=@file($suff."_impostaz/$chiave.txt");
$im=explode("||",$var25[0]);
$color=trim($im[0]);
//prelevo SESSo user DAL PROFILO
if(@file_exists($suff."_profili/$chiave.txt"))
{$var2=@file($suff."_profili/$chiave.txt");
$testo=explode("||",$var2[0]);
$sesso=$testo[1];}else{$sesso="";}
if($sesso=="f") {$iconasesso="<img border=0 src=female.png>"; }
elseif($sesso=="m") {$iconasesso="<img border=0 src=male.png>";}else{$iconasesso="";}
if($dispositivo=="PC")
{echo $iconasesso." <a href='gallery2.php?page=view&user=$chiave'><font color='$color'>".$chiave."(</font><font color='#FFCC00'>".$number[$chiave]."</font><font color='#38ACEC'></a>)</font><br>\n";}
else{echo "<a href='?page=view&user=$chiave'><font color='#38ACEC'>".$chiave."(</font><font color='#FFCC00'>".$number[$chiave]."</font><font color='#38ACEC'></a>)</font><br>\n";}
}//end foreach
}//end PAGE LIST
elseif($page=="view")
{
if(!isset($_GET['user']))
{$user=$login;}else{$user=trim($_GET['user']);}
$user = ereg_replace("[^a-zA-Z0-9]+","",$user);
if(isset($_GET['r'])) echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\"><strong>Sei nella SUA LISTA NERA, NON PUOI VOTARE LE SUE FOTO</strong></div>";
if(isset($_GET['q'])) echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\"><strong>L UTENTE NON ACCETTA VOTI/COMMENTI SULLE SUE FOTO</strong></div>";
if(isset($_GET['k'])) echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\"><strong>AVATAR IMPOSTATO</strong></div>";
if($dispositivo=="PC")
{
if(isset($_GET['r']) OR isset($_GET['q']) OR isset($_GET['k']))
{ echo "<br><a href='gallery2.php?user=$user;'>TORNA</a>";exit;}
}
//verifico se esiste quell USER
$trovato=0;
$fp=@file("database/".$suff."_regnick.txt");
for($j=0; $j<(count($fp)); $j++)
{
$dati=explode("||",$fp[$j]);
if($dati[0]==$user)
{$trovato=1; break;}
}//end for
if($trovato==0){echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\">NICK INESISTENTE</div>"; exit;}
if(!@is_dir("gallery/".$user)){{echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\">
Nessuna gallery per questo NICK</div>";} exit;}
echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\">
<img border=0 src='image.png'> <a href='gallery.php'><font color='#FFCC00'>GALLERY</font></a></div>";
echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\"><strong><a href='profilo.php?page=gallery&user=$user'>$user</a></strong></div>";
$results = array();
$handler = opendir("gallery/".$user);
while ($file = readdir($handler)) {
if ($file != '.' && $file != '..' && !@is_dir("gallery/".$user."/".$file) && @is_file("gallery/".$user."/".$file) && substr($file, 0, 2) != "l_" && substr($file, 0, 2) != "c_" && substr($file, 0, 2) != "v_" && substr($file, 0, 2) != "t_")
$results[] = $file;
}
// tidy up: close the handler
closedir($handler);
sort($results);
if(count($results)==0) {echo "Gallery vuota..."; exit;}
$conta=count($results);
if(isset($_GET['start']) AND is_numeric($_GET['start']))
{$start = trim($_GET['start']);}
else{$start=($conta-1);}
if($start>($conta-1) OR $start<0){$start=($conta-1);}
if($conta==2) {$num=2;}
if($conta==3){$num=3;}
if($conta>3){$num=4;}
$limite=($start-$num);
?>
<table border="0" width="100%" id="table1" cellpadding="2">
<tr>
<td width="55">
<table border="0" width="100%" id="table2" cellpadding="2">
<?php
if ($conta>1) {
$nomefile = explode(".", $results[$start]);
$tmp=array();
$p=1;
for($a=($start-1); $a>=$limite; $a--)
{
$k=$a;
$tmp[]=$results[$start];
if($a<0){$k=($conta+$a);}
if(in_array($results[$k],$tmp)){continue;}
elseif($p<4)
{echo "<tr><td><div class='pic'><a href='?page=view&user=$user&start=$k'><img src='size.php?x=40&y=40&src=gallery/$user/$results[$k]' ALT=''></a></div></td></tr>"; $p++;}
else
{echo "<tr><td><div class='pic'><a href='?page=view&user=$user&start=$k'><img src='size.php?x=30&y=30&src=gallery/$user/$results[$k]' ALT=''></a></div></td></tr>"; $p++;}
}//end for
}
?>
</table>
</td>
<td><?php echo "<p align='left'><div class='pic'><img src='size.php?x=100&y=100&src=gallery/$user/$results[$start]'></div>";
$names=str_replace(".jpg","",$results[$start]); echo "<font color='yellow'>".date('d/m/y H:i:s',$names)."</font><br></p>";
?>
<?php
if(($start+1)<=($conta-1)){$prec=($start+1); echo "<a href='gallery.php?page=view&user=$user&start=$prec'>«</a> ";}
echo "<a href='gallery/$user/$results[$start]'><img src='search.png' ALT='[SCARICA]' border=0></a> ";
$name=str_replace(".jpg","",$results[$start]);
if($user==$login) {echo "<a href='?page=delete&img=$name'><img src='delete.png' ALT='[X]' border=0></a> ";}
if($user!=$login AND $level>=$arrdat[4]) {echo "<a href='?page=delete&img=$name&gall=$user'><img src='delete.png' ALT='[X]' border=0></a> ";}
echo "<a href='commentfoto.php?user=$user&img=$name&inizio=$start'><img src='comment.png' ALT='[COMMENTI]' border=0></a>";
$contacom=0;
if(@file_exists("gallery/$user/c_".$name.".txt"))
{$f=@file("gallery/$user/c_".$name.".txt"); $contacom=count($f);} echo "(".$contacom.") ";
if(@file_exists("gallery/$user/t_".$name.".txt") AND @file_exists("gallery/$user/v_".$name.".txt") )
{$f=@file("gallery/$user/t_".$name.".txt"); $contauser=count($f);
$fr=@file("gallery/$user/v_".$name.".txt"); $sommavoti=trim($fr[0]); $votomedio=($sommavoti/$contauser);
echo "<br>VOTO (".number_format($votomedio,2).") ";
}
if(($start-1)>=0){$succ=($start-1); echo "<a href='gallery.php?page=view&user=$user&start=$succ'>»</a>";}
echo "<br>";
$didascalia="";
if(@file_exists("gallery/$user/l_lista.txt"))
{
$id=str_replace(".jpg","",$results[$start]);
$fp=@file("gallery/$user/l_lista.txt");
$totfoto=count($fp);
for($m=0; $m<$totfoto; $m++)
{
$dati=explode("||",$fp[$m]);
if(trim($dati[0])==$id){$didascalia=trim($dati[1]); break;}
}//end for
}
//prelevo impostazioni login
$var=@file($suff."_impostaz/$login.txt");
$dati=explode("||",$var[0]);
$smile=$dati[1];
if($smile==1) {
@require_once("smile.inc.php");
$$didascaliaorig=$didascalia;
$percorso=$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
$percorso=str_replace("gallery.php","smile/",$percorso);
$percorso="http://".$percorso;
for ($k=0; $k < count($arrsmile); $k+=2) {
if(empty($arrsmile[$k])) continue;
$contat += substr_count($didascalia, $arrsmile[$k]);
$didascalia = str_replace($arrsmile[$k], "<img src=\"" . $percorso . $arrsmile[$k+1] . "\">", $didascalia);
}
if ($contat > 5) $didascalia = $didascaliaorig;}
echo stripslashes($didascalia);
if($user==$login) echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\"><a href='gallery.php?page=avatar&user=$user&img=$name&inzio=$start'><font color='#FFCC00'>[IMPOSTA COME AVATAR]</font></a></div>";
//form ver votare
$giavotato=0;
//verifico se gia' ho votato
if(@file_exists("gallery/$user/t_".$name.".txt"))
{
$fp=@file("gallery/$user/t_".$name.".txt");
$contauser=count($fp);
for($t=0; $t<$contauser; $t++)
{
if(trim($fp[$t])==$login){$giavotato=1;}
}//end for
}
//prelevo impostazioni user per verificare se accetta voti sulle FOTO
$var=@file($suff."_impostaz/$user.txt");
$dati=explode("||",$var[0]);
$valida=trim($dati[3]);
if($user!=$login AND $giavotato==0 AND $valida==1){?>
<div id="border_radius_groove" class="border_radius_css3"><center>
<form name="form1" method="POST" action="gallery.php?page=voto&user=<?php echo $user; ?>&img=<?php echo $name; ?>&inizio=<?php echo $start; ?>">
<select name="voto">
<option select value='2'>2</option>
<option value='4'>4</option>
<option value='6'>6</option>
<option value='8'>8</option>
<option value='10'>10</option>
</select>
<input type="submit" id="input" name="Submit" value="VOTA" ><br>
</form>
</div></center> <?php } ?>
<div align="left">
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<?php
}elseif($page=="lastfoto")
{
echo "<div id=\"border_radius_groove\" class=\"border_radius_css3\">ULTIME FOTO</a></div>";
if(@file_exists("database/".$suff."_lastfoto.txt"))
{
$f=@file("database/".$suff."_lastfoto.txt");
$contalast=count($f);
for($a=0; $a<$contalast; $a++){
$dati=explode("||",$f[$a]);
$img=trim($dati[1]);
echo "<a href='profilo.php?page=lastfoto&user=$dati[0]'>$dati[0]</a><br><img src='size.php?x=50&y=50&src=gallery/$dati[0]/$img.jpg'><br><br>\n";
}//end for
}
echo "<center><br><a href='?page=list'>TORNA</a></center>";
}else{echo "Pagina non trovata";}
?></div><center><a href="chat.php">Chat</a> | <a href="opzioni.php">Opzioni Chat</a>
</div><br></center></body></html>
questo e il codice che stampa a video tutti i risultati
PHP:
if($dispositivo=="PC")
{echo $iconasesso." <a href='gallery2.php?page=view&user=$chiave'><font color='$color'>".$chiave."(</font><font color='#FFCC00'>".$number[$chiave]."</font><font color='#38ACEC'></a>)</font><br>\n";}
else{echo "<a href='?page=view&user=$chiave'><font color='#38ACEC'>".$chiave."(</font><font color='#FFCC00'>".$number[$chiave]."</font><font color='#38ACEC'></a>)</font><br>\n";}
}//end foreach
Ultima modifica di un moderatore: