nach langer Zeit habe ich mal eine Fachfrage. Derzeit werden auf der Seite http://imkerforum.nordbiene.de/8-letzte-bilder.php alle Fotos aus einem Ordner angezeigt. Nämlich alle Beitragsfotos eines Forums (meines). Gelöst wird dies mit php wie folgt:
Code: Alles auswählen
<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Sammle Haupt Informationen für das Bild
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime, physical_filename
FROM ' . ATTACHMENTS_TABLE . "
WHERE extension = 'jpg' OR extension = 'gif' OR extension = 'png' ORDER BY attach_id DESC ";
$result = $db->sql_query_limit($sql, 1);
$attachment = $db->sql_fetchrow($result);
if(!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query last attachment', '', __LINE__, __FILE__, $sql);
}
while($attach_data = $db->sql_fetchrow($result)) {
$post_id = $attach_data['post_msg_id'];
$filename = $phpbb_root_path.'files/'. "thumb_". $attach_data['physical_filename'];
$fileid = $attach_data['attach_id'];
// Ausgeben
$post_link = append_sid($phpbb_root_path.'viewtopic.'.$phpEx.'?p='.$post_id.'#'.$post_id);
echo '<a href="'.$post_link.' "target="_blank"" "><img src="'.$filename.'" alt="'.$fileid.'" border="0" width="100" height="75" /></a>';
} // Ende der While Schleife
?>
Wie und wo muss ich genau die Änderung
Code: Alles auswählen
LIMIT 0, 8
Vielen Dank im Voraus.
LG
Kai