\n"; echo"\n"; echo"\n"; echo"

$p

\n"; echo"

$last_rep

\n"; echo"

$a

\n"; echo"\n"; echo"\n"; // elenco messaggi $np=0; /////////contatore pagine $filarray=array(); $handle=opendir('messaggi'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $filarray[]=$file; } } //ordina i messaggi per numero natsort($filarray); $output = array_reverse ($filarray); $total=count($output); $page=array(); for($r=$pgc; $r<($pgc+$pgp);$r++){ if($output[$r]==0){} else{$page[]=$output[$r]; } } ////////fine contatore while (list ($chiave, $valore) = each ($page)) { $messread = fopen("messaggi/$valore", "r"); $messaggio = fread($messread, filesize("messaggi/$valore")); fclose($messread); $dati = explode("|", $messaggio); $nm=$dati[0]; $nome=$dati[1]; $mail=$dati[2]; $oggetto=$dati[3]; $testo=$dati[4]; $data=$dati[5]; $ora=$dati[6]; $min=$dati[7]; if ($mail != "") { $aut = "$sg $nome $dt $data $tm $ora:$min"; } else { $aut = "$sg $nome $dt $data $tm $ora:$min"; } //calcolo numero della risposta $namerisp=array(); $handle=opendir('risposte'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $rispread = fopen("risposte/$file", "r"); $risposte = fread($rispread, filesize("risposte/$file")); fclose($rispread); $datir = explode("|", $risposte); $cl=$datir[0]; if($cl==$nm){ $namerisp[]=$file; } else{ } } } //se esiste almeno una risposta if ($namerisp[0]<>0) { $nr=count($namerisp); natsort($namerisp); $outr = array_reverse ($namerisp); while (list ($chiave, $valore) = each ($outr)) { } $ulr=$outr[0]; $rispread = fopen("risposte/$ulr", "r"); $numr = fread($rispread, filesize("risposte/$ulr")); fclose($rispread); $datirisp = explode("|", $numr); //$nr=$datirisp[1]; $name_last_risp="$datirisp[2]"; $date_last_rep="$dt $datirisp[6]"; $hour_last_rep="$tm $datirisp[7]:$datirisp[8]"; } // altrimenti assegna 1 else{ $nr=0; $name_last_risp=""; $date_last_rep=""; $hour_last_rep=""; $min_last_rep=""; } /////////////////////////////// if($nr<$midr){ $ico=""; } else { if($nr>=$midr && $nr<$maxr){$ico="";} elseif($nr>=$maxr){$ico="";} } if($np==0){ echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"
\n"; echo"

$ico $oggetto

\n"; echo"$aut\n"; echo"
\n"; echo"$name_last_risp
$date_last_rep $hour_last_rep
\n"; echo"

$nr\n"; echo"

\n"; $np++; } else{ echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"
\n"; echo"

$ico $oggetto

\n"; echo"$aut\n"; echo"
\n"; echo"$name_last_risp
$date_last_rep $hour_last_rep
\n"; echo"

$nr\n"; echo"

\n"; $np--; } } closedir($handle); ////////elenco pagine $pagarray=array(); $han_dle=opendir('messaggi'); while (false !== ($fi_le = readdir($han_dle))) { if ($fi_le != "." && $fi_le != "..") { $pagarray[]=$file; } } closedir($han_dle); //ordina i messaggi per numero natsort($pagarray); $out_put = array_reverse ($pagarray); $to_tal=count($out_put); $pg_p=$pgp; $e=($to_tal/$pg_p)+1; $pg_c=0; $pa_ge=array(); echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"

page\n"; for($s=1;$s<=$e;$s++){ for($r1=$pg_c; $r1<($pg_c+$pg_p);$r1++){ if($out_put[$r1]==0){} else{$pa_ge[]=$out_put[$r1]; } } $o=$s-1; $per=($o*$pg_p); if(($pg_c+$pg_p)<=($to_tal+$pgp-1)){ if ($per == $myper) { echo":$s:"; } else { echo":$s:";} } else{ } $pg_c=$s*$pg_p; } echo"

\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"
\n"; echo"
\n"; include ("footer.php"); break; } ?>