Habe es versucht, aber ohne Erfolg. Ich glaube, dass weiter unter imCode noch was zu ändern ist. Deshalb habe ich den Code erweitert und hier gepost.
Bitte um Ergänzung.
Code: Alles auswählen
<?
// config variable
$col =2; // number of column
$maxrow = 1; // max row for table
$picdir = ".";
$dpic = opendir($picdir);
while($folder = readdir($dpic))
{
if($folder!="." && $folder!=".." && is_dir($folder) )
{
if(substr($folder,-3)!="jpg")
$seldir[] = $folder;
}
}
/////////////////////////////////////////////////////////
// natural alphabetical sort of directory available
// if you have problem or error, comment the line below
natsort($seldir);
/////////////////////////////////////////////////////////
foreach($seldir as $value)
{
$dirname = strtoupper(str_replace(" ","_ ",$value));
$alldir[] = "$value";
}
// $alldir = array("auto","car","caravan","truck"); // the directory where your images are
// print the category list
print "<table width=\"570\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
print "<tr><td width=\"160\" valign=\"top\"><div style=\"height:100%\">";
print "<div class=\"titsmall\">Wähle den Bildordner :</div>";
foreach($alldir as $key)
{
$dirname = strtoupper(str_replace("_"," ",$key));
print "<a href=\"deutsch.php?hm=akt&um=bild&dir=$key\" class=\"cat\">$dirname »</a> ";
}
print "</div></td>";
print "<td width=\"390\" align=\"center\"><br />";
if(isset($dir))
{
// open the directory
$dh = opendir("$picdir/$dir");
while($file = readdir($dh))
{
if( (substr($file,-3)=="gif") || (substr($file,-3)=="jpg") || (substr($file,-3)=="JPG") )
{
// insert all images in array
$a_img[] = $file;
}
}
$totimg = count($a_img); // total images number
$totxpage = $col*$maxrow; // images x page
$totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage):((int)($totimg/$totxpage)+1); // number of total pages
Wäre froh,wenn das irgendwie zu machen wäre.
<?
// config variable
$col =2; // number of column
$maxrow = 1; // max row for table
$picdir = ".";
$dpic = opendir($picdir);
while($folder = readdir($dpic))
{
if($folder!="." && $folder!=".." && is_dir($folder) )
{
if(substr($folder,-3)!="jpg")
$seldir[] = $folder;
}
}
/////////////////////////////////////////////////////////
// natural alphabetical sort of directory available
// if you have problem or error, comment the line below
natsort($seldir);
/////////////////////////////////////////////////////////
foreach($seldir as $value)
{
$dirname = strtoupper(str_replace(" ","_ ",$value));
$alldir[] = "$value";
}
// $alldir = array("auto","car","caravan","truck"); // the directory where your images are
// print the category list
print "<table width=\"570\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
print "<tr><td width=\"160\" valign=\"top\"><div style=\"height:100%\">";
print "<div class=\"titsmall\">Wähle den Bildordner :</div>";
foreach($alldir as $key)
{
$dirname = strtoupper(str_replace("_"," ",$key));
print "<a href=\"deutsch.php?hm=akt&um=bild&dir=$key\" class=\"cat\">$dirname »</a> ";
}
print "</div></td>";
print "<td width=\"390\" align=\"center\"><br />";
if(isset($dir))
{
// open the directory
$dh = opendir("$picdir/$dir");
while($file = readdir($dh))
{
if( (substr($file,-3)=="gif") || (substr($file,-3)=="jpg") || (substr($file,-3)=="JPG") )
{
// insert all images in array
$a_img[] = $file;
}
}
$totimg = count($a_img); // total images number
$totxpage = $col*$maxrow; // images x page
$totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage):((int)($totimg/$totxpage)+1); // number of total pages
Vielen, vielen Dank und noch einen schönen Sonntagsabend
Seni