hab ein Problem beim Einbau des Uniqe Avatar Mods. Der ist für eine frühe PHPBB2 Version geschrieben, aber ich hoffe ihn auch auf 0.22 zum laufen zu kriegen.
Das Problem: Es werden nur die Bilderrahmen, nicht aber die Bilder geladen nach Einbau des MODs.
Es wird nur eine Stelle ersetzt und eine neue kommt dazu, ist also eigentlich recht übersichtlich aber trotzdem finde ich den Fehler nicht.
Die Anleitung sieht so aus:
Code: Alles auswählen
#-----[ OPEN ]------------------------------------------
#
# includes\usercp_avatar.php
#
#-----[ FIND ]------------------------------------------
#
# $dir = @opendir($board_config['avatar_gallery_path']);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$my_counter = 0;
$my_checker = 0;
$sql = "SELECT user_avatar
FROM " . USERS_TABLE . "
WHERE user_avatar_type=3";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$my_counter++;
$my_used_list[$my_counter] = $row['user_avatar'];
}
$db->sql_freeresult($result);
#
#-----[ FIND ]------------------------------------------
#
while( $sub_file = @readdir($sub_dir) )
{
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
{
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));
$avatar_col_count++;
if( $avatar_col_count == 5 )
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
while( $sub_file = @readdir($sub_dir) )
{
$my_checker = 0;
for ($i = 1; $i<= $my_counter; $i++ )
{
$my_temp = $file . '/' . $sub_file;
if ($my_temp == $my_used_list[$i]) $my_checker=1;
if ($my_checker==1) break;
}
if ($my_checker == 0)
{
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
{
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));
$avatar_col_count++;
if( $avatar_col_count == 5 )
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
Seht ihr den Fehler?
Besten Gruß,
Andreas