################################################## ################################################## ############################# Display thumbnails
function thumbnails($album, $start_side_pic) {
global $config, $logged_in;
global $lng_text;
global $start_side_pic;
$thbn = $thbn . "";
if(!isset($album)) { // Wann kommt das ?? NIE ??
$thbn = $thbn . "$lng_text[116]<br><br>\n"; // Album aussuchen
$thbn = $thbn . "<b>- <a href='$config[ppa_web_path]index.php'>$lng_text[117]</a></b>"; // Albumlisten
return $thbn;
}
// DB verbinden Funktion aufrufen
$conn = db_connect();
// Alles aus DB holen was zum Album X gehört
$result = mysql_query("SELECT * from $config[TABLE_PICTURES] WHERE aid='$album'");
$query_picture = "SELECT * FROM ppa_pictures ORDER BY pid";
$result_picture = mysql_query($query_picture, $conn);
$row_picture = mysql_fetch_array($result_picture);
// Album Beschreibung auslesen
$result_album = mysql_query("SELECT description from $config[TABLE_ALBUMS] WHERE aid='$album'");
$query_album_data = mysql_fetch_row($result_album);
$album_desc = $query_album_data[0];
// Zähle wieviele Zeilen (Bilder) dann entgülltig da sind
$count = mysql_num_rows($result);
$Pics_per_side = $config['thumbcols'] * $config['thumbrows'];
$thbn = $thbn . "<tr><td colspan='$config[thumbcols]'><div style='thumbnails' align='right'>$lng_text[118] [ <b>$album_desc</b> ]<hr></div></td></tr>\n"; //Topic
$thbn = $thbn . "<tr>\n";
if($logged_in == $config['admin_password']) $thbn = $thbn . js_confirms();
$pic_in_the_cols = 1; // Vertikaler Counter auf 1 Setzen (Bild oben Links)
if ($start_side_pic==false) $start_side_pic = 0; // Horiontaler Counter auf 1 Setzen (Seite 1)
// Bilder anzeigen die im $result stecken
if($count > 0) {
$fpath_to_pic = array();
$apath_to_pic = array();
$save_pid = array();
$for_counter = 0;
while($row = mysql_fetch_array($result)) // solange Schleifen bis alle Bilder ausgegeben sind
{
$fpath_to_pic[$for_counter] = $config['ppa_root_path'] . $config['ppa_album_dir'] . $row["filepath"] . "thumb_" . $row["filename"];
$apath_to_pic[$for_counter] = $config['ppa_web_path'] . $config['ppa_album_dir'] . $row["filepath"] . "thumb_" . $row["filename"];
$save_pid[$for_counter] = $row["pid"];
$for_counter++;
}
$side_end = $Pics_per_side + $start_side_pic;
if ($side_end > sizeof($fpath_to_pic)) $side_end = sizeof($fpath_to_pic);
for ($for_counter2 = $start_side_pic; $for_counter2 < $side_end; $for_counter2++) {
$ant_cmts = count(get_comments($save_pid[$for_counter2])); // Kommentare zum Bild auslesen und durchzählen
$imagesize = getImageSize($fpath_to_pic[$for_counter2]); // Bild Größe des Thumbnick feststellen und als (width="??" height="??) speichern
$thbn = $thbn . "<td valign='top' class='thumbnails' align='center' width='" . ceil($config['thumbcols']/100) . "%'>"; // Horizontale Tabelle beginnen
$thbn = $thbn . "<a href='$config[ppa_web_path]screens/displayimage.php?pid=" . $save_pid[$for_counter2] . "' class='thumbnails'>";// Link zum grossen Bild
$thbn = $thbn . "<img src='$apath_to_pic[$for_counter2]' $imagesize[3] border='1' alt='$row[pic_desc]'> $nomefile"; // Thumbnail anzeigen
$thbn = $thbn . "</a>";
$thbn = $thbn . "Nome File : $row_picture[filename] <br>";
$thbn = $thbn . "Dimensioni : $row_picture[filesize] <br>";
$thbn = $thbn . "Descrizione : $row_picture[pic_desc] <br>";
if($ant_cmts > 0)
{
$thbn = $thbn . "<br><div class='small'>$ant_cmts $lng_text[119]</div>"; // Wenn Kommentare da unter dem Thumbnail anzeigen wie viele es sind
}
if($logged_in == $config['admin_password']) // Wenn Admin dann Löschen text drunter anzeigen
{
$thbn = $thbn . show_picturemenu_small($save_pid[$for_counter2]);
$thbn = $thbn . "</td>\n";
}
if($pic_in_the_cols==$config['thumbcols']) // Wenn genug Bilder in der Breite vorhanden, nächste Zeile anwählen
{
$thbn = $thbn . "</tr>\n";
$thbn = $thbn . "<tr>\n";
$pic_in_the_cols = 1;
} else {
$pic_in_the_cols++;
}
}
} else { // Wenn keine Bilder da zeige den Text zum Album erstellen, ec. ...
if (strlen($album_desc) < 1 ) {
$thbn = $thbn . "<td valign='top' class='thumbnails'>";
$thbn = $thbn . "<center><br><br><b><fo nt color=red>$lng_text[243]</font></b><br><br></center>";
$thbn = $thbn . "</td>\n";
} else {
$thbn = $thbn . "<td valign='top' class='thumbnails'>";
$thbn = $thbn . "<b>$lng_text[120] $album $lng_text[121]<br>\n";
$thbn = $thbn . "<li><a href='$config[ppa_web_path]screens/admin.php?album=$album'>$lng_text[122]</a><br>\n";
$thbn = $thbn . "<li><a href='$config[ppa_web_path]index.php'>$lng_text[123]</a><br>\n";
$thbn = $thbn . "</td>\n";
}
}
$thbn = $thbn . thumbnails_menu($album, $start_side_pic);
return $thbn;
}