mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 23:16:13 +02:00
Adding drivers for gallery, uploaded, and remote avatars. These may be used as examples for others to develop their own avatar drivers. PHPBB3-10018
51 lines
902 B
PHP
51 lines
902 B
PHP
<?php
|
|
/**
|
|
*
|
|
* @package avatar
|
|
* @copyright (c) 2005, 2009 phpBB Group
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* @ignore
|
|
*/
|
|
if (!defined('IN_PHPBB'))
|
|
{
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Handles avatars hosted remotely
|
|
* @package avatars
|
|
*/
|
|
class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
|
{
|
|
/**
|
|
* Get the avatar url and dimensions
|
|
*
|
|
* @param $ignore_config Whether $user or global avatar visibility settings
|
|
* should be ignored
|
|
* @return array Avatar data
|
|
*/
|
|
public function get_data($user_row, $ignore_config = false)
|
|
{
|
|
if ($ignore_config || $this->config['allow_avatar_remote'])
|
|
{
|
|
return array(
|
|
'src' => $user_row['user_avatar'],
|
|
'width' => $user_row['user_avatar_width'],
|
|
'height' => $user_row['user_avatar_height'],
|
|
);
|
|
}
|
|
else
|
|
{
|
|
return array(
|
|
'src' => '',
|
|
'width' => 0,
|
|
'height' => 0,
|
|
);
|
|
}
|
|
}
|
|
}
|