Page 1 of 1

[MOD] Remote avatar resize

PostPosted: Wed Apr 26, 2006 2:20 pm
Author: evolver
Avatars...nice...

But we have to put restrictions to their size, or they can ruin the layout...

Those restrictions work for uploading, that's OK... :P
But for pictures from other sites (remote), there's no restriction at all... :wink:

So this time, I didn't just follow instructions to integrate a MOD...
This is the first time that I've gone this far in PHP-coding... <img>
Never thought I could do this, but I really did it !!!!

Here it is:
[size=99px] ) ? '<img>' ]
REPLACE
Code: Select all
case USER_AVATAR_REMOTE] )                                 {                                 list($width, $height) = @getimagesize($user_avatar);                                 $percentage = ($height / $width * 100);                                 $newheight = round($board_config['avatar_max_width'] * $percentage / 100);                     if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height'])                     {                         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                                         else  // No width/height in the user's profile                     {                         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                 }                 else  // remote avatars not allowed                 $avatar_img = '';                                 break;



[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
Code: Select all
case USER_AVATAR_REMOTE] )                                 {                                 list($width, $height) = @getimagesize($view_userdata[$field_name]);                                 $percentage = ($height / $width * 100);                                 $newheight = round($board_config['avatar_max_width'] * $percentage / 100);                     if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height'])                     {                         $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                                         else  // No width/height in the user's profile                     {                         $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                 }                 else  // remote avatars not allowed                 $img = '';                                 break;



[size=99px]
[size=99px] ) ? '<img>' ]
REPLACE
Code: Select all
case USER_AVATAR_REMOTE] )                                 {                                 list($width, $height) = @getimagesize($userdata['user_avatar']);                                 $percentage = ($height / $width * 100);                                 $newheight = round($board_config['avatar_max_width'] * $percentage / 100);                                         if ( ($width > $board_config['avatar_max_width']) && ($newheight <board_config> $board_config['avatar_max_height'])                     {                         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                                         else  // No width/height in the user's profile                     {                         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';                     }                 }                 else  // remote avatars not allowed                 $avatar_img = '';                                 break;

or even better:
See [url=http][MOD] Better avatar restriction on blocks[/url] for improvements on blocks for avatar display...

Re: [MOD] Remote avatar resize

PostPosted: Wed Apr 26, 2006 2:45 pm
Author: evolver
I've tested this on Firefox & Explorer
And it should work fine for all templates (no modification on templates) <img>

I'm also planning to improve the 'top10 posters'-block with the same method:
Look what happends to a long avatar (large width, like a banner): it's stretching the column.
That's because it's only resizing avatar's to a certain height, it doesn't even check the width...

Re: [MOD] Remote avatar resize

PostPosted: Wed Apr 26, 2006 2:59 pm
Author: found it
Very nice work...well done

:mrgreen:

PostPosted: Wed Apr 26, 2006 3:29 pm
Author: Jason Sanborn
Awesome! My 2-cents. We should include this in 1.4.1 if possible. This is something I think is desperately needed.

PostPosted: Thu Apr 27, 2006 5:55 am
Author: MrDSL
You may also want to consider an easier way..


Just open up functions_profile.php and find
Code: Select all
      function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)     {         global $lang;                 if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )         {             $error = true;             $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];             return;         }           return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;       }


and replace with
Code: Select all
     function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)    {       global $board_config, $lang;         if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )       {          $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];          return;       }       list($width, $height) = @getimagesize($avatar_filename);           if ( ($width > $board_config['avatar_max_width']) || ($height > $board_config['avatar_max_height']) )       {          $l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);            $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $l_avatar_size : $l_avatar_size;          return;       }       return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;      }



Done..

PostPosted: Thu Apr 27, 2006 8:31 am
Author: found it
"MrDSL";p="3238" wrote:You may also want to consider an easier way..


Just open up functions_profile.php and find
Code: Select all
      function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)     {         global $lang;                 if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )         {             $error = true;             $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];             return;         }           return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;       }


and replace with
Code: Select all
     function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)    {       global $board_config, $lang;         if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )       {          $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];          return;       }       list($width, $height) = @getimagesize($avatar_filename);           if ( ($width > $board_config['avatar_max_width']) || ($height > $board_config['avatar_max_height']) )       {          $l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);            $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $l_avatar_size : $l_avatar_size;          return;       }       return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;      }



Done..


[size=99px]Very nice[/font][/size]

you should open a PCP class and teach people how to code it....

Ill sign up...

:mrgreen:

PostPosted: Thu Apr 27, 2006 9:05 am
Author: ayasha
"Jason Sanborn";p="3208" wrote:Awesome! My 2-cents. We should include this in 1.4.1 if possible. This is something I think is desperately needed.


is this possible? <img> please?

Re: [MOD] Remote avatar resize

PostPosted: Sat Apr 29, 2006 5:14 pm
Author: evolver
I've also been thinking about an improvement for the avatar-upload.

As I have seen with the attachment mod:
http://integramod.com/forum/viewtopic.php?p=3545#3545
Images bigger than permitted can be resized on upload directly...
Wouldn't it be better to make it so for avatar-uploads as well, in stead of blocking them out with a warning?
That would make it a lot more user-friendly, don't you think?

Always keep in mind that not all forums are for computerfreaks only...
I have a forum where many members don't even know how to resize a picture... When they dear to try and it doesn't work, they just leave it...

Re: [MOD] Remote avatar resize

PostPosted: Wed May 03, 2006 4:41 pm
Author: Threat009
These all sound like very good ideas. Not sure why, but my avatar control doesn't seem to work at all. It's set to max 100x100, but I had one guy using one like 200x200 and one guy using one that was 50x50. I would like them to all be the same size, as I feel it keeps the boards looking cleaner. Did I set it wrong? Is there a global control that would resize everything to 100x100 including remote, uploaded, etc. etc.?

Re: [MOD] Remote avatar resize

PostPosted: Thu May 04, 2006 1:25 am
Author: evolver
"Threat009";p="4452" wrote:These all sound like very good ideas. Not sure why, but my avatar control doesn't seem to work at all. It's set to max 100x100, but I had one guy using one like 200x200 and one guy using one that was 50x50. I would like them to all be the same size, as I feel it keeps the boards looking cleaner. Did I set it wrong? Is there a global control that would resize everything to 100x100 including remote, uploaded, etc. etc.?

Without the resize avatar MOD, remote avatar's (images from other sites) aren't restricted at all... There was no avatar control on that...

You have set your max to 100x100, OK.
The word used here is maximum!!
So, images 50x50 are permited and not resized.
That's the way I (and most users) like it to be.
By resizing those smaller images, quality will be lost anyway...
But if that's really what you want, it can be done by tweaking the code a little bit more...
Then the next question would be:
Do you want all images displayed at 100x100, without keeping aspect ratio?

Re: [MOD] Remote avatar resize

PostPosted: Sun May 07, 2006 6:25 am
Author: evolver
I've been working on a better way for the avatar display on the portal-blocks.
Because as the way it is now, avatar's can still stretch out those blocks and ruin the portal-page layout...

Using the same avatar restrictions in width and height as for viewtopic won't solve that, by the way...
I've worked out a better way to get this right... :)
See [url=http][MOD] Better avatar restriction on blocks[/url]

PostPosted: Fri May 12, 2006 10:38 am
Author: Kat
"MrDSL";p="3238" wrote:You may also want to consider an easier way..


Just open up functions_profile.php and find
Code: Select all
      function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)     {         global $lang;                 if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )         {             $error = true;             $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];             return;         }           return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;       }


and replace with
Code: Select all
     function pcp_user_avatar_url(&$error, &$error_msg, $avatar_filename)    {       global $board_config, $lang;         if ( !preg_match('#^(http)|(ftp)]*?(.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )       {          $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];          return;       }       list($width, $height) = @getimagesize($avatar_filename);           if ( ($width > $board_config['avatar_max_width']) || ($height > $board_config['avatar_max_height']) )       {          $l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);            $error = true;          $error_msg = ( !empty($error_msg) ) ? $error_msg . '<br>' . $l_avatar_size : $l_avatar_size;          return;       }       return " user_avatar = '" . str_replace("'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE;      }



Done..



I would love to use this...will it work with 2.0.20?

Re: [MOD] Remote avatar resize

PostPosted: Mon May 22, 2006 2:49 am
Author: evolver
I've still found one very small bug in this avatar resizer code :wink:

Re: [MOD] Remote avatar resize

PostPosted: Tue May 23, 2006 10:43 am
Author: evolver
It's taking some time, but am still working on this...
I have managed to fix the possible bug,
but I am using the occasion to bring up an extra feature:

I have the code ready, but I'm working on some default-avatars to occur:
[list type=decimal][*]when no avatar selected
[*]when avatar unavailable (one for upload, remote and gallery)[*]when avatar selection mode not allowed (one for upload, remote and gallery)[/list]

For (2) different default avatar when avatar unavailable for user-block and for top-posters block...

DEFAULT AVATAR
- On viewtopic:
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/images/avatars/default/default_avatar.gif[/flash:14sny6s5]
default_avatar.gif
- On avatar select (profilcp_profil_avatar.php) and user-block:
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_noavatar_user.gif[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_noavatar_user.gif[/flash:14sny6s5]
avatar_noavatar_user.gif
- On topuser-block:
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_noavatar_block.gif[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_noavatar_block.gif[/flash:14sny6s5]
avatar_noavatar_block.gif

UNAVAILABLE
avatar_upload_unavailable.jpg
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_remote_unavailable.jpg[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_remote_unavailable.jpg[/flash:14sny6s5]
avatar_remote_unavailable.jpg
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_gallery_unavailable.jpg[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_gallery_unavailable.jpg[/flash:14sny6s5]
avatar_gallery_unavailable.jpg

UNAVAILABLE ON BLOCK (different because smaller)
(for all)
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_unavailable_block.gif[/flash:14sny6s5]
avatar_unavailable_block.gif

NOT ALLOWED (only for the avatar selection page)
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_upload_unallowed.jpg[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_upload_unallowed.jpg[/flash:14sny6s5]
avatar_upload_unallowed.jpg
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_remote_unallowed.jpg[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_remote_unallowed.jpg[/flash:14sny6s5]
avatar_remote_unallowed.jpg
[flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_english/avatar_gallery_unallowed.jpg[/flash:14sny6s5] [flash=,:14sny6s5]http://www.stelplaats.be/Brugge/templates/fisubice/images/lang_nederlands/avatar_gallery_unallowed.jpg[/flash:14sny6s5]
avatar_gallery_unallowed.jpg

The default avatar will go in images/avatars/default/
to be used on all templates and languages
Like this:[code]$avatar_img = <img>' ]
All others will go in templates/<anytemplate>/<anylanguage>/
to keep the possibilty open for using different default-avatars for each template and language... :D
At the moment, I'm working on those images... <img>

Re: [MOD] Remote avatar resize

PostPosted: Wed May 24, 2006 2:55 pm
Author: evolver

Re: [MOD] Remote avatar resize

PostPosted: Thu May 25, 2006 12:15 pm
Author: evolver
profilcp_profil_avatar.php and
profilcp/def/userfuncs_std.php

updated on previous post...
(some important differences I looked over while copy&paste <img> )

Re: [MOD] Remote avatar resize

PostPosted: Sun May 28, 2006 12:45 am
Author: evolver
There are more files to be modified...
I will be working on those right now.

I did a quick search for 'case USER_AVATAR_REMOTE'
Here are the results, without the files already modified] album_showpage.php  -  31.781 bytes  -  di, 21.06.05 at 17:25  -  FORUMROOT14.885   case USER_AVATAR_REMOTE:    memberlist.php  -  12.207 bytes  -  vr, 17.02.06 at 17:31  -  FORUMROOT5.753    case USER_AVATAR_REMOTE:    shoutbox_max.php  -  29.679 bytes  -  di, 21.06.05 at 17:25  -  FORUMROOT20.200   case USER_AVATAR_REMOTE:    show_post.php  -  18.626 bytes  -  za, 22.04.06 at 23:30  -  FORUMROOT7.434    case USER_AVATAR_REMOTE:    admin_approve.php  -  101.625 bytes  -  za, 22.04.06 at 23:25  -  FORUMROOTAdmin21.737   case USER_AVATAR_REMOTE:35.729   case USER_AVATAR_REMOTE:    admin_userlist.php  -  31.432 bytes  -  do, 28.07.05 at 19:46  -  FORUMROOTAdmin25.105   case USER_AVATAR_REMOTE:    admin_users.php  -  60.220 bytes  -  vr, 17.02.06 at 17:17  -  FORUMROOTAdmin32.593   $avatar_sql = ", user_avatar = '" . str_replace("'", "''", $user_avatar_remoteurl) . "', user_avatar_type = " . USER_AVATAR_REMOTE;49.673   case USER_AVATAR_REMOTE:    functions_calendar.php  -  57.794 bytes  -  do, 30.06.05 at 00:49  -  FORUMROOTIncludes24.306   case USER_AVATAR_REMOTE:    functions_comment.php  -  10.118 bytes  -  di, 21.06.05 at 17:25  -  FORUMROOTPafiledbIncludes4.331    case USER_AVATAR_REMOTE:    admin_userlist.php  -  29.418 bytes  -  zo, 11.07.04 at 06:00  -  FORUMROOTtemplatesintegrastyleAdmin23.091   case USER_AVATAR_REMOTE:  Searching finished (118,69 seconds).[/code]
Work to do... <img>
...10 more files...

Re: [MOD] Remote avatar resize

PostPosted: Sun Jun 04, 2006 6:57 pm
Author: doswald
This is nice evolver, I'll wait for the final release. I have some extra favor, while reading all the post I don't know where am I going to follow, which one from those posts.

A favor please when you finish doing this great stuff, give us a link of FULL procedure how to implement and the files needed (if there are needed). I would like to ask also if possible, those files such as profilcp/profilcp_profil_avatar.php, profilcp/def/userfuncs_std.php, and other with your instructions to completely change, please just give us an idea where to put your codes, because I believe I have made changes in some of those files to avoid any problem.

Thanks once again evolver, great MOD.

Regards,
Doswald

Re: [MOD] Remote avatar resize

PostPosted: Mon Jun 05, 2006 12:55 am
Author: evolver
Thanks doswald,

I will work further on this and let you know every change.
But it might take some weeks because I've been very busy on other things as well. I have fixed some bugs for 1.4.1 and there are busy days at work too at the moment...

And OK, I will make a 'Find' an 'Add after' in stead of a complete replace... <img>

Re: [MOD] Remote avatar resize

PostPosted: Mon Jun 05, 2006 1:12 am
Author: doswald
Thank you friend. <img>

Cheerio

Re: [MOD] Remote avatar resize

PostPosted: Wed Jul 26, 2006 12:06 pm
Author: MadUser
"evolver";p="6850" wrote:I've still found one very small bug in this avatar resizer code :wink:


hello my friend
you did a very nice work
but there is a problem for me with this mod
it seems that the code does not get the width and height of the remote avatar picture, because it always throw me the divide by zero exception
do you know why it happen?

Re: [MOD] Remote avatar resize

PostPosted: Wed Jul 26, 2006 12:46 pm
Author: evolver
I'm sorry, haven't worked on this MOD for quite a while...
Haven't forgotten about it, just other priorities at the moment...

I'm working on improvements (bug fixes) for integraMOD 1.4.1 at the moment...
But I do plan to continue this MOD after that...

Re: [MOD] Remote avatar resize

PostPosted: Wed Jul 26, 2006 1:13 pm
Author: evolver
"MadUser";p="12458" wrote:because it always throw me the divide by zero exception
do you know why it happen?

I do know why and where it happends:
$percentage = ($height / $width * 100);
When width doesn't exist it will give that error...
It can be avoided by putting everything inside a
if ($width != 0) {}
And I did fix it in this post http://integramod.com/forum/viewtopic.php?p=7207#7207
but not on the top post... :-?

This MOD is not finished, there are more files to be modified...
...and quite many of them...
Like for comments and shoutbox,... because it won't work there yet...
I will continue this later... <img>

PostPosted: Wed Jul 26, 2006 11:52 pm
Author: MadUser
well i have to admit, it is not hard to get lost around all this posts
well i will wait for you get this over with
meanwhile i did my own little resize avatar, the phpbb style

thank you for the help

PostPosted: Mon Jul 31, 2006 12:30 am
Author: doswald
"MadUser";p="12487" wrote:well i have to admit, it is not hard to get lost around all this posts
well i will wait for you get this over with
meanwhile i did my own little resize avatar, the phpbb style

thank you for the help


Hi MadUser,

Do u have a success resizing remote avatar using phpbb MOD? If yes, please share it. And what's difference of that with revolvers MOD?

Thanks,
doswald

PostPosted: Mon Jul 31, 2006 4:33 am
Author: MadUser
Hi doswald
as a matter of fact, none of the above worked for me.
not evolver nor MrDSL
so i used phpbb mod on integramod
of course its not identical, some minor changes
i am at work right now but i promise i will do it after.

this mod is very simple
it gets the global avatar width from where you configured it at the admin panel, and it defines the width of the picture with this variable
thats all

for me it works just fine and very simple

Re: [MOD] Remote avatar resize

PostPosted: Mon Jul 31, 2006 7:57 am
Author: MadUser
well this is my simple version on resize remote avatar
there are 3 file to change

In profilcpprofilcp_profil_avatar.php

FIND: case USER_AVATAR_REMOTE:
replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In profilcpdefdef_userfuncs_std.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In blocksblocks_imp_user_block.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';    break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     //BEFORE MOD     //   $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


THE END

Re: [MOD] Remote avatar resize

PostPosted: Mon Jul 31, 2006 9:07 am
Author: evolver
"MadUser";p="12767" wrote:well this is my simple version on resize remote avatar
there are 3 file to change

In profilcpprofilcp_profil_avatar.php

FIND: case USER_AVATAR_REMOTE:
replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In profilcpdefdef_userfuncs_std.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In blocksblocks_imp_user_block.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';    break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     //BEFORE MOD     //   $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


THE END

This will work :-?

I'm busy with to many things at the time, for the moment...

Re: [MOD] Remote avatar resize

PostPosted: Mon Jul 31, 2006 11:53 am
Author: MadUser
"evolver";p="12778" wrote:
"MadUser";p="12767" wrote:well this is my simple version on resize remote avatar
there are 3 file to change

In profilcpprofilcp_profil_avatar.php

FIND: case USER_AVATAR_REMOTE:
replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In profilcpdefdef_userfuncs_std.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';     break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     // BEFORE MOD///////////////     //$img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


In blocksblocks_imp_user_block.php

FIND: case USER_AVATAR_REMOTE:

replace:

Code: Select all
case USER_AVATAR_REMOTE] ) ? '<img>' : '';    break;


with this:

Code: Select all
case USER_AVATAR_REMOTE];     $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     //BEFORE MOD     //   $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break;


THE END

This will work :-?

I'm busy with to many things at the time, for the moment...


everything you say is true.
but its a lot better then nothing.
it covers most cases.
what you have done was a try to get the remote picture width and height.
i dont know why, but for me it always give zero, meaning it is not working.
i am sure that there is a better solution than what i have done.
but i like this one because it's very easy and it works.

PostPosted: Mon Aug 07, 2006 7:30 am
Author: ayasha
evolver

has all the edits been put together in a text file yet?

and i have one question myself, the ladies on my forum are using a rotating off sight avatar, since it shows avatars like normal, would it be a problem with the resizer?

and i do hope this gets into the 1.4.1, would be a great addition, does anyone know yet?

PostPosted: Mon Aug 07, 2006 8:07 am
Author: evolver
"cleo";p="13204" wrote:... the ladies on my forum are using a rotating off sight avatar, since it shows avatars like normal, would it be a problem with the resizer?

What kind of extension do those rotating images have?
.gif?
Then it wouldn't be a problem...

The getimagesize() function is used to determine the size of pictures in this MOD...

[url=http]http://be2.php.net/manual/en/function.getimagesize.php[/url]
The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML <IMG> tag.

PostPosted: Mon Aug 07, 2006 12:43 pm
Author: ayasha
good, it has a .jpg extension <img> so do you have a text file with all the edits in it?

PostPosted: Mon Aug 07, 2006 1:31 pm
Author: evolver
"cleo";p="13221" wrote:...so do you have a text file with all the edits in it?

Not yet, this MOD isn't finished...more files need to be modified as I stated in this message:

http://integramod.com/forum/viewtopic.php?p=7607#7607

It's a lot of work and I am working on other modifications at the moment...
Well, euhm, fixes is a better word...
That's why this modification isn't my first priority at the moment...
But it will be, after the fixes... <img>

PostPosted: Mon Aug 07, 2006 6:37 pm
Author: ayasha
that is all good, was just checking on the status of it, thanks for letting me know <img>