Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Proportionally Auto Resize User Avatar Details »»
Proportionally Auto Resize User Avatar
Version: 1.02, by toolblast toolblast is offline
Developer Last Online: Mar 2019 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-17-2006 Last Update: 04-18-2006 Installs: 24
Uses Plugins
Additional Files  
No support by the author.

PROPORTIONALLY AUTO RESIZE USER AVATAR PLUGIN

Last updated: April 18th - newest file is 'PluginFiles.zip'

What does this plugin do?
It will allow you to place the logged in user's avatar in your forum header or navbar and then set a predefined maximum width and height that the user's avatar can go in. Then, using PHP, an automatic resize will occur that will NOT stretch the image.

Update: this hack doesn't work everywhere like previously stated in earlier versions. Some templates in vbulletin do not render global variables making the plugin not show the avatar. One of these templates is the postbit template. If you put '$useravatar' in that template nothing will happen. Why? I'm not sure, and if anyone knows how to make it work please share!

What is the point of this plugin?
If you want the user to be able to upload a large avatar that will appear on the postbit, but in the forum login info part in the header you want to show their avatar, but at a smaller size than the original (without editing the original uploaded file and without stretching it). This is for you.

Installation:
Extremely simple. Simply upload plugin from the plugin manager area of your VBulletin Admin (for those who don't know, go to Plugin System > Download/Upload Plugin > Browse for the file and upload it). Then, you simply upload the imageresize.php file into your main forum folder.

Instructions:
To place the user's avatar in the template, edit one of your vbtemplates (header template preferrably), and then insert this code where you want the image to appear:

Quote:
$useravatar
If you want their avatar to link to their profile insert:
Quote:
<a href="$vboptions[bburl]/profile.php?do=editavatar">$useravatar</a>
To change the max height and width dimentions for the avatar, edit the plugin and change the following line of code:

Quote:
//SET MAX RESTRAINTS
$maxheight=40;
$maxwidth=50;
Note: Upload both photoresize.php and noavatar.gif to your forum HOME directory. You can change the noavatar.gif image to whatever you want. Make sure you have your vbulletin homepage url set in your general vbulletin options area otherwise the script wont know the url of your forum!


Credits:
The "Avatar in Navbar" plugin by sabret00the [click here]
NPL Solution's script from Webmaster-Talk [click here]
DONT FORGET TO CLICK INSTALL!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 04-28-2006, 05:31 PM
toolblast's Avatar
toolblast toolblast is offline
 
Join Date: Mar 2004
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fneumeier
Chad,

I've read such suggestions now many time here in various forums. But this definitely it not a solution but only is a desaster for performance on my server. Imaging users upload a 3-Mpixel image and VB is resizing this EVERY TIME this image is being viewed! Also, think about storage space these pictures would need on the server/in the database!

No, I really want to resize the images right when they're uploaded. In consider this as extremely userfriendly (no need fo the user to resize the images prior to upload) and as a optimal solutions for server performance and storage space. The high resolution/big sized images are not needed for anything, so why keep them on the server?

Have you got an idea where to resize the pictures right at the upload?

Thanks
Franz

Clearly you would need to restrict file size for image uploads so users cant upload unlimited 3MP images. Thats pretty obvious.

This script does dynamic resizing like the title of this thread states. It isn't a script that resizes and then resaves the image, overwriting the original. Though, im sure you could find a php script that does that by searching Google.

Thanks.
Reply With Quote
  #43  
Old 04-28-2006, 07:21 PM
fneumeier fneumeier is offline
 
Join Date: Mar 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My posting probably was not clear enough: I know HOW to resize a image with PHP and GDlib. I just don't find the place in the VB code WHERE to pick up the image date after upload and manipulate it. Any hints where in the code I have to look for that? I suppose it's in the class_upload, but I can't find the exact position ...

Thanks
Franz
Reply With Quote
  #44  
Old 04-29-2006, 02:49 AM
toolblast's Avatar
toolblast toolblast is offline
 
Join Date: Mar 2004
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really dont know where it is, I'd have to go hunting.

Does any expert vb coder know where this bit of code is?
Reply With Quote
  #45  
Old 04-29-2006, 12:07 PM
cannabis-world cannabis-world is offline
 
Join Date: Apr 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know that vb strips the exif data when it makes thumbnails, so is it possible to resize the attachments as they are being uploaded to say 99% of their original size, thereby stripping the exif data. Perhaps someone reading this can help. Thanks for your help toolblast but unfortunately resizing on the fly will slow down our server considerably.
Reply With Quote
  #46  
Old 05-01-2006, 12:35 AM
SQL man SQL man is offline
 
Join Date: Feb 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi , I tried to test it
it didn't work with my member's avatar in the threads pages !! it still big images!!
whats the problem ?
Reply With Quote
  #47  
Old 05-06-2006, 10:42 PM
cucarot cucarot is offline
 
Join Date: Feb 2005
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how to use it in postbit ^ ^ I mean how to resize avatar of a user in postbit if he/she uploads an avatar that exceeds the limit of forum? thx
Reply With Quote
  #48  
Old 05-12-2006, 12:39 PM
toolblast's Avatar
toolblast toolblast is offline
 
Join Date: Mar 2004
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SQL man
hi , I tried to test it
it didn't work with my member's avatar in the threads pages !! it still big images!!
whats the problem ?
Can you give me a demo/test URL to see this SQL man? Or if you feel comfortable enough grant me admincp access and I'll see whats wrong. Previous users have PMd me to get me to install this for them and I have been able to get it working for them.
Reply With Quote
  #49  
Old 05-12-2006, 01:13 PM
toolblast's Avatar
toolblast toolblast is offline
 
Join Date: Mar 2004
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cucarot
how to use it in postbit ^ ^ I mean how to resize avatar of a user in postbit if he/she uploads an avatar that exceeds the limit of forum? thx
Hi Cucarot!

Right now I had to fix a few bugs and this plugin now only works in the forum header and navbar (and a few other templates). Unfortunately it doesnt work in the postbit template (it just shows a blank space instead of the avatar).

I am working on a new version of this plugin that will allow admins to easily add restraints to ANY image attachments/uploads which has been a huge request here on vb.org and I'll keep everyone updated, so stay tooned!

Thanks
Reply With Quote
  #50  
Old 05-16-2006, 07:49 PM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you get this to work without Apache? (without GD Library installed)
Reply With Quote
  #51  
Old 05-17-2006, 03:09 AM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anybody get this to work with ImageMagick??
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06442 seconds
  • Memory Usage 2,310KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete