so, sorry, ich habs total verpennt, scheinbar funktioniert die mail benachrichtigung hier nicht so wie sie sollte
Code: Alles auswählen
<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$gal_id = ( isset($HTTP_GET_VARS['gal_id']) ) ? intval($HTTP_GET_VARS['gal_id']) : 0;
//Session auslesen und Benutzer-Informationen laden
$userdata = session_pagestart($user_ip, PAGE_GALLERY);
init_userprefs($userdata);
$page_title = 'Gallery';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'gallery_album' => 'gallery_album.tpl',
));
/*
if ( $userdata['session_logged_in'] )
{
// Code, wenn ein Benutzer angemeldet ist
}
else
{
// Code, wenn kein Benutzer angemeldet ist
}
// User die zugriff haben: es sind gruppen_ids, gruppennamen und user_ids erlaubt wobei bei den gruppen namen und ids ein g am anfang angehängt werden muss.
$allowed_u = array();
$allowed_u[] = 'g3'; //gruppe
$access_allowed = false;
if( in_array($userdata['user_id'],$allowed_u))
{
$access_allowed = true;
}
else
{
$sql = "SELECT g.group_id, g.group_name
FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE ug.user_id = '" . $userdata['user_id'] . "'
AND g.group_id = ug.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get user group.', '', __LINE__, __FILE__, $sql);
}
$access_allowed = false;
while( list($group_id, $group_name) = $db->sql_fetchrow($result) )
{
if( in_array('g' . $group_id[group_id],$allowed_u ))
{
$access_allowed = true;
break;
}
if( in_array('g' . $group_name[group_name],$allowed_u))
{
$access_allowed = true;
break;
}
}
if( !$access_allowed )
{
message_die(GENERAL_MESSAGE, 'Sie haben keinen Zugriff auf diese Seite.');
}
}
*/
$bildarray = array();
$alb_sql = 'SELECT * FROM `gallery_pix` WHERE `album_id` = ' . $gal_id . ' ORDER BY `id` ASC LIMIT ' . $start . ', 24';
if(!$alb_result = $db->sql_query($alb_sql)) {
message_die(GENERAL_ERROR, 'Fehler beim Auslesen der Album-Informationen', '', __LINE__, __FILE__, $alb_sql);
}
while($alb_row = $db->sql_fetchrow($alb_result))
{ /* beginn while */
$cnt_alb = mysql_query("SELECT * FROM `gallery_pix` WHERE `album_id` = '" . $alb_row['album_id'] . "'");
$cnt_alb = mysql_num_rows($cnt_alb);
$cnt_cmt = mysql_query("SELECT * FROM `gallery_comments` WHERE `pic_id` = '" . $alb_row['id'] . "'");
$cnt_cmt = mysql_num_rows($cnt_cmt);
$akt_ptid = $alb_row['id'];
$albpl_sql = mysql_query('SELECT * FROM `gallery_albums` WHERE `id` = ' . $gal_id);
$gal_ord = mysql_fetch_row($albpl_sql);
$rd_datum = $gal_ord['3'];
$day = date("w", $rd_datum);
$days = array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
$date = date("j", $rd_datum);
$month = date("n", $rd_datum);
$months = array(1=>"Januar", 2=>"Februar", 3=>"März", 4=>"April", 5=>"Mai", 6=>"Juni", 7=>"Juli", 8=>"August", 9=>"September", 10=>"Oktober", 11=>"November", 12=>"Dezember");
$year = date("Y", $rd_datum);
$clc_datum = $days[$day] . ", " . $date . ". " . $months[$month] . " " . $year;
$template->assign_vars(array(
'ALBID' => $gal_ord['0'],
'ALBTITLE' => $gal_ord['1'],
'ALBAUTHOR' => $gal_ord['2'],
'ALBADD_DATE' => $clc_datum
));
$bildarray[]['index'] = $alb_row['id'];
$x = count($bildarray) - 1;
$bildarray[$x]['feldx'] = "<a href=gallery_pic.php?pic_id=" . $akt_ptid . "><img src=\"gallery/" . $alb_row['ordner'] . "/_thm/" . $alb_row['dateiname'] . "\"></a><br>";
$zeilen = count($cnt_alb);
$end = $x + 4;
for ($x = 1; $x <= $zeilen; $x++)
{ /* start for1 */
$template->assign_block_vars('zeile', array(
));
$start = $x;
for ($y = $start; $y <= $end; $y++)
{ /* start for2 */
$template->assign_block_vars('zeile.bild', array(
'THMIMG' => $bildarray[$x]['feldx'],
'CNT_CMTS' => $cnt_cmt
));
$x++;
if(!isset($cnt_alb[$x]))
{
$template->assign_block_vars('zeile.bild', array('ABBRUCH' => '<!-- Abbruch -->'));
break;
}
else
{
$template->assign_block_vars('zeile.bild', array('ABBRUCH' => '<!-- ok, zählt hoch -->'));
}
} /* ende for2 */
} /* ende for1 */
} /* ende der while schleife */
/* start pagination, keine schleife mehr offen */
$board_config['topics_per_page'] = 24;
if ( $board_config['topics_per_page'] > 10 )
{
$sql = "SELECT count(*) AS total
FROM gallery_albums";
$result = $db->sql_query($sql);
if ( $total = $db->sql_fetchrow($result) )
{
$total_members = $total['total'];
$pagination = generate_pagination("gallery_dir.$phpEx?gal_id=" . $gal_id . "", $total_members, $board_config['topics_per_page'], $start). ' ';
}
$db->sql_freeresult($result);
}
else
{
$pagination = ' ';
$total_members = 24;
}
$template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
'L_GOTO_PAGE' => $lang['Goto_page'])
);
/* end pagination */
$template->pparse('gallery_album');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
der code ist jetzt ein bißchen mehr strukturiert, ich habe auch durch kommentare kenntlich gemacht, von wo bis wo eine schleife geht.