nomepagina.php
.Ovviamente in accoppiata con il file template personale della pagina da visualizzare. :/>
Codice: Seleziona tutto
<?
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);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//first we get the users avatar that is viewing this page but only if they are logged in and have one?
if ($user->data['is_registered'] && !$user->data['is_bot'])
{
$user_avatar_img = !empty($user->data['user_avatar']) ? get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']) : '';
if(!empty($user_avatar_img))
{
echo 'Your avatar:' . $user_avatar_img . '<br />';
}
}
//now we get everyone's avatar other than guest and bots and the user viewing the page I guess
$sql = 'SELECT user_id, user_avatar, user_avatar_type, user_avatar_height, user_avatar_width
FROM ' . USERS_TABLE . '
WHERE user_type <> ' . USER_IGNORE . '
AND ' . $db->sql_in_set('user_id', $user->data['user_id'], true);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if (!empty($row['user_avatar']))
{
$users_avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);
echo $row['user_id'] . ' ' . $users_avatar_img . '<br />';
}
}
$db->sql_freeresult($result);
// clean up our stuffs as we aren't calling page_footer
exit_handler();
?>