[MOD] Remote avatar resize

Support for IntegraMOD 140

Moderator: Integra Moderator

[MOD] Remote avatar resize

PostAuthor: evolver » Wed Apr 26, 2006 2:20 pm

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...
Last edited by evolver on Sun May 07, 2006 6:36 am, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Wed Apr 26, 2006 2:45 pm

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...
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: found it » Wed Apr 26, 2006 2:59 pm

Very nice work...well done

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Wed Apr 26, 2006 3:29 pm

Awesome! My 2-cents. We should include this in 1.4.1 if possible. This is something I think is desperately needed.
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: MrDSL » Thu Apr 27, 2006 5:55 am

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..
Last edited by MrDSL on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
MrDSL
PCP Master
PCP Master
 
Posts: 41
Likes: 0 post
Liked in: 0 post
Joined: Thu Apr 27, 2006 5:34 am
Cash on hand: 0.00

PostAuthor: found it » Thu Apr 27, 2006 8:31 am

"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:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00

PostAuthor: ayasha » Thu Apr 27, 2006 9:05 am

"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?
Last edited by ayasha on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 6:10 pm
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Sat Apr 29, 2006 5:14 pm

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...
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: Threat009 » Wed May 03, 2006 4:41 pm

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.?
Last edited by Threat009 on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://i63.photobucket.com/albums/h129/Threat009/donate.gif[/img][/url]
User avatar
Threat009
Sr Integra Member
Sr Integra Member
 
Posts: 220
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 12:48 am
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Thu May 04, 2006 1:25 am

"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?
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Sun May 07, 2006 6:25 am

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]
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: Kat » Fri May 12, 2006 10:38 am

"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?
Last edited by Kat on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Kat
Members
Members
 
Posts: 49
Likes: 0 post
Liked in: 0 post
Joined: Fri May 05, 2006 9:44 am
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Mon May 22, 2006 2:49 am

I've still found one very small bug in this avatar resizer code :wink:
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Tue May 23, 2006 10:43 am

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>
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Wed May 24, 2006 2:55 pm

Last edited by evolver on Sun May 28, 2006 12:18 am, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Thu May 25, 2006 12:15 pm

profilcp_profil_avatar.php and
profilcp/def/userfuncs_std.php

updated on previous post...
(some important differences I looked over while copy&paste <img> )
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Sun May 28, 2006 12:45 am

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...
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: doswald » Sun Jun 04, 2006 6:57 pm

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
Last edited by doswald on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
One of the best ways to educate our hearts is to look at our interaction with other people, because our relationships with others are fundamentally a reflection of our relationship with ourselves.
--Stephen R. Covey First Things First--
User avatar
doswald
Integra Member
Integra Member
 
Posts: 165
Likes: 0 post
Liked in: 0 post
Joined: Tue May 09, 2006 9:33 pm
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Mon Jun 05, 2006 12:55 am

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>
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: doswald » Mon Jun 05, 2006 1:12 am

Thank you friend. <img>

Cheerio
Last edited by doswald on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
One of the best ways to educate our hearts is to look at our interaction with other people, because our relationships with others are fundamentally a reflection of our relationship with ourselves.
--Stephen R. Covey First Things First--
User avatar
doswald
Integra Member
Integra Member
 
Posts: 165
Likes: 0 post
Liked in: 0 post
Joined: Tue May 09, 2006 9:33 pm
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: MadUser » Wed Jul 26, 2006 12:06 pm

"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?
Last edited by MadUser on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]My hebrew web site[/url]
User avatar
MadUser
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Tue Jul 11, 2006 12:26 am
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Wed Jul 26, 2006 12:46 pm

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...
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Wed Jul 26, 2006 1:13 pm

"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>
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: MadUser » Wed Jul 26, 2006 11:52 pm

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
Last edited by MadUser on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]My hebrew web site[/url]
User avatar
MadUser
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Tue Jul 11, 2006 12:26 am
Cash on hand: 0.00

PostAuthor: doswald » Mon Jul 31, 2006 12:30 am

"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
Last edited by doswald on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
One of the best ways to educate our hearts is to look at our interaction with other people, because our relationships with others are fundamentally a reflection of our relationship with ourselves.
--Stephen R. Covey First Things First--
User avatar
doswald
Integra Member
Integra Member
 
Posts: 165
Likes: 0 post
Liked in: 0 post
Joined: Tue May 09, 2006 9:33 pm
Cash on hand: 0.00

PostAuthor: MadUser » Mon Jul 31, 2006 4:33 am

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
Last edited by MadUser on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]My hebrew web site[/url]
User avatar
MadUser
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Tue Jul 11, 2006 12:26 am
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: MadUser » Mon Jul 31, 2006 7:57 am

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
Last edited by MadUser on Tue Aug 08, 2006 1:14 pm, edited 1 time in total.
[url=http]My hebrew web site[/url]
User avatar
MadUser
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Tue Jul 11, 2006 12:26 am
Cash on hand: 0.00

Re: [MOD] Remote avatar resize

PostAuthor: evolver » Mon Jul 31, 2006 9:07 am

"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...
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [MOD] Remote avatar resize

PostAuthor: MadUser » Mon Jul 31, 2006 11:53 am

"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.
Last edited by MadUser on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]My hebrew web site[/url]
User avatar
MadUser
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Tue Jul 11, 2006 12:26 am
Cash on hand: 0.00

PostAuthor: ayasha » Mon Aug 07, 2006 7:30 am

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?
Last edited by ayasha on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 6:10 pm
Cash on hand: 0.00

PostAuthor: evolver » Mon Aug 07, 2006 8:07 am

"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.
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: ayasha » Mon Aug 07, 2006 12:43 pm

good, it has a .jpg extension <img> so do you have a text file with all the edits in it?
Last edited by ayasha on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 6:10 pm
Cash on hand: 0.00

PostAuthor: evolver » Mon Aug 07, 2006 1:31 pm

"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>
Last edited by evolver on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: ayasha » Mon Aug 07, 2006 6:37 pm

that is all good, was just checking on the status of it, thanks for letting me know <img>
Last edited by ayasha on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 6:10 pm
Cash on hand: 0.00


Return to IntegraMOD 140

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]