Inzeráty jsou řazeny od nejnovějších po nejstarší 1) { print "|\n"; } $next=$pos+$pocet-1; if ($next>$count) { $next=$count; } if ($od<$pos || $od>$next) { print "$pos-$next"; } else { print "$pos-$next"; } $pos+=$pocet; } } if ($From=="") { $From=1; } if ($From<1) { $From=1;} if ($Count=="") { $Count=10; } if ($Count<2) { $Count=2; } $fname="inzerce/inzeraty.$r"; $fcon=file($fname); $To=$From+$Count-1; $linecount=count($fcon); $sline=$linecount- (($From-1) *4) - ($Count*4) ; $eline=$sline + ($Count * 4)-4; if ($sline<0) { $sline=0; } if ($eline>$linecount) { $eline = $linecount-4; } $records=$linecount / 4 ; $line=0; # Generuj seznam print "
"; GeneratePrevNext($From,$Count,$records); print "
"; print "\n"; $line=$eline; while ($line>=$sline) { $kont = trim(urldecode($fcon[$line+1])); if ($kont=="pes@veteran.dhs.org") $kont = "veteran@pascom.cz"; if (ereg("@",$kont)) { $kont = "$kont"; } print ""; $text=urldecode($fcon[$line+2]); print ""; $line=$line-4; } print "
$kont"; $datum=$fcon[$line]; $lx=$records -$line / 4; print "$datum$lx
$text
 
"; # Generuj seznam print "
"; GeneratePrevNext($From,$Count,$records); print "
"; if ($error) { print "
$error
"; } ?>