1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/avatars] Made ACP avatar gallery in Manage Users prettier

Added row/column information so avatars can be displayed nicely in
the ACP

PHPBB3-10018
This commit is contained in:
Cullen Walsh
2011-06-18 23:49:04 -07:00
parent a06380c69a
commit 8416bf3dc9
4 changed files with 68 additions and 27 deletions

View File

@@ -51,7 +51,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
{
$avatar_list = $this->get_avatar_list();
$category = request_var('av_local_cat', '');
$categories = array_keys($avatar_list);
foreach ($categories as $cat)
@@ -67,13 +67,33 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
if (!empty($avatar_list[$category]))
{
foreach ($avatar_list[$category] as $img => $data)
$table_cols = isset($row['av_gallery_cols']) ? $row['av_gallery_cols'] : 4;
$row_count = $col_count = $av_pos = 0;
$av_count = sizeof($avatar_list[$category]);
reset($avatar_list[$category]);
while ($av_pos < $av_count)
{
$template->assign_block_vars('av_local_imgs', array(
'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $data['file'],
'AVATAR_NAME' => $data['name'],
'AVATAR_FILE' => $data['filename'],
$img = current($avatar_list[$category]);
next($avatar_list[$category]);
if ($col_count == 0)
{
++$row_count;
$template->assign_block_vars('av_local_row', array(
));
}
$template->assign_block_vars('av_local_row.av_local_col', array(
'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'],
'AVATAR_NAME' => $img['name'],
'AVATAR_FILE' => $img['filename'],
));
$col_count = ($col_count + 1) % $table_cols;
++$av_pos;
}
}