Moin! Ich hab folgenden Quellcode für meine Bildergallerie verwendet (is hier ausm forum). Meine Frage, kann man sich die tn's auch von PHP generieren lassen? Also so, dass sie z.b. in einem extra ordner gespeichert werden oder einfach nur mit dem anhang _tn.*
Wenn ja, wie?
danke!
max.
hier nochma der Code:
<html>
<head>
<?
include("std.inc.php");
?>
<a class="menu" href="../">HOME</a> |
<b>FOTOS</b> |
<a class="menu" href="#">HYPERLINK 3</a> |
<a class="menu" href="#">HYPERLINK 4</a> |
<a class="menu" href="#">HYPERLINK 5</a>
</div>
<!-- Inhalt -->
<div id="content">
<center>
<?php
$path="./";
$handle= opendir($path);
$pic_counter = 0;
$width="150";
$height="113";
$col_num=3; // Anzahl der Spalten in der Tabelle
while ($res=readdir($handle))
{
if(is_dir($res))
{
}
else
{
if (preg_match("/.gif/",$res) || preg_match("/.jpg/",$res) || preg_match("/.jpeg/",$res) || preg_match("/.png/",$res))
// if (eregi("jpg", $res))
{
$pic_array[$pic_counter] = $res;
$pic_counter++;
}
}
}
closedir($handle);
sort($pic_array);
// Anzahl der Zeilen in der Gallery:
$row_nummber = ceil($pic_counter/$col_num);
$count=0;
echo "<table border = 0>";
for ($row=0; $row<$row_nummber; $row++)
{
echo "<center><tr>";
for ($col=0; $col<$col_num; $col++)
{
echo "<td align=center><font size=\"2\">";
if ($pic_array[$count] != "")
{
echo '<a href="#" onClick="window.open(\'bild.php?bild_name='.$pic_array[$count].'\', \'fenstername\')"><img src="'.$pic_array[$count].'" width="'.$width.'" height="'.$height.'" alt="'.$pic_array[$count].'" title="'.$pic_array[$count].'"></a>';
$properties = GetImageSize($pic_array[$count]);
echo "<br>Bildname:".$pic_array[$count]."<br>\n";
echo "B:".$properties[0]."\n";
echo "H:".$properties[1]."<br>\n";
$count++;
echo "</font></td>";
}
else
{
echo " ";
}
}
echo "</tr>";
}
echo "</table></center>";
?>
</div>
</div>
</center>
</body>
</html>
Wenn ja, wie?
danke!
max.
hier nochma der Code:
<html>
<head>
<?
include("std.inc.php");
?>
<a class="menu" href="../">HOME</a> |
<b>FOTOS</b> |
<a class="menu" href="#">HYPERLINK 3</a> |
<a class="menu" href="#">HYPERLINK 4</a> |
<a class="menu" href="#">HYPERLINK 5</a>
</div>
<!-- Inhalt -->
<div id="content">
<center>
<?php
$path="./";
$handle= opendir($path);
$pic_counter = 0;
$width="150";
$height="113";
$col_num=3; // Anzahl der Spalten in der Tabelle
while ($res=readdir($handle))
{
if(is_dir($res))
{
}
else
{
if (preg_match("/.gif/",$res) || preg_match("/.jpg/",$res) || preg_match("/.jpeg/",$res) || preg_match("/.png/",$res))
// if (eregi("jpg", $res))
{
$pic_array[$pic_counter] = $res;
$pic_counter++;
}
}
}
closedir($handle);
sort($pic_array);
// Anzahl der Zeilen in der Gallery:
$row_nummber = ceil($pic_counter/$col_num);
$count=0;
echo "<table border = 0>";
for ($row=0; $row<$row_nummber; $row++)
{
echo "<center><tr>";
for ($col=0; $col<$col_num; $col++)
{
echo "<td align=center><font size=\"2\">";
if ($pic_array[$count] != "")
{
echo '<a href="#" onClick="window.open(\'bild.php?bild_name='.$pic_array[$count].'\', \'fenstername\')"><img src="'.$pic_array[$count].'" width="'.$width.'" height="'.$height.'" alt="'.$pic_array[$count].'" title="'.$pic_array[$count].'"></a>';
$properties = GetImageSize($pic_array[$count]);
echo "<br>Bildname:".$pic_array[$count]."<br>\n";
echo "B:".$properties[0]."\n";
echo "H:".$properties[1]."<br>\n";
$count++;
echo "</font></td>";
}
else
{
echo " ";
}
}
echo "</tr>";
}
echo "</table></center>";
?>
</div>
</div>
</center>
</body>
</html>