View Full Version : Remote avatar?
I just wonder why remote avatar is disabled on these forums? For ppl like me who change them avatar a lot remote avatar is blessing :p Also it would save some ammount of bandwidth
Well allowing a remote avatar would allow people to use avatars
that well exceed allowed filesize limits for example.
Well allowing a remote avatar would allow people to use avatars
that well exceed allowed filesize limits for example.
Hmm...I don't think that is true or atleast not for IPB forum software, but then again this is vBulletin :o
NightWish
2003-12-13, 11:49
The only way IPB could enforce the size limits would be to download the avatar periodically and check it. Even then there is nothing stopping a user from circumventing the system by changing the avatar after the check. Also those checks would use up any bandwidth saving you might have gleaned from keeping them remotely. All in all it seems like wasted effort?
The only way IPB could enforce the size limits would be to download the avatar periodically and check it. Even then there is nothing stopping a user from circumventing the system by changing the avatar after the check. Also those checks would use up any bandwidth saving you might have gleaned from keeping them remotely. All in all it seems like wasted effort?
// Remote URL avatar size check
$url = parse_url( $ibforums->input['url_avatar'] );
$host = $url['host'];
$path = $url['path'];
if( $fp = fsockopen($host, 80, &$errno, &$errstr, 1) )
{
fputs($fp,"HEAD $path HTTP/1.1\r\nHOST: $host\r\nConnection: close\r\n\r\n");
while (!feof($fp))
{
if (preg_match("/\bContent-Length:/", $header = fgets($fp, 128)))
{
if ( substr($header, 16, -2) > ($ibforums->vars['avup_size_max']*1024) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'upload_to_big' ) );
}
}
/*
} elseif ( $fp = fopen( $ibforums->input['url_avatar'], 'r') ) {
$img = '';
$img = fread( $fp, (($ibforums->vars['avup_size_max']*1024) + 1) );
fclose( $fp );
if ( strlen($img) > ($ibforums->vars['avup_size_max']*1024) )
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'upload_to_big' ) );
}
} else {
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'avatar_invalid_url' ) );
}
*/
}
fclose ($fp);
} else {
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'avatar_invalid_url' ) );
}
//-- EoM
JustAnotherFan
2003-12-13, 12:12
Maybe that code would prevent 95% or more users from using avatars that are too big, but it's nothing to prevent the other 5% of using avatars of any filesize they like :p (not going into details about the method, I don't want to give ideas to people :innocent: )
JAF
Maybe that code would prevent 95% or more users from using avatars that are too big, but it's nothing to prevent the other 5% of using avatars of any filesize they like :p (not going into details about the method, I don't want to give ideas to people :innocent: )
JAF
Hmm...I wonder how that could be done? Could you PM me so I can code some solution for it?
The only way IPB could enforce the size limits would be to download the avatar periodically and check it. Even then there is nothing stopping a user from circumventing the system by changing the avatar after the check. Also those checks would use up any bandwidth saving you might have gleaned from keeping them remotely. All in all it seems like wasted effort?
HTTP protocol supports filecheck without downloading file if you didn't know
Maybe you should ask yourself, why you change your avatar so often? The avatar should be a picture which represents you to the other users, so you shouldn't really change it this often IMHO.
I think it's up to me...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.