vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Proportionally Auto Resize User Avatar (https://vborg.vbsupport.ru/showthread.php?t=113306)

toolblast 04-17-2006 10:00 PM

Proportionally Auto Resize User Avatar
 
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! :cool:

toolblast 04-18-2006 04:03 AM

The FILE HAS BEEN UPDATED April 18th.

It is now easier to edit the constraints proportions, they are 2 variables at the very top of the plugin code that you can easily edit via the plugin manager.

Supports pre-defined avatars from your vbulletin collection, custom uploaded avatars, as well as can put an image in place of an avatar if the user has not yet specified one.

UPDATE: Two new screenshots added.

UPDATE: Support for both IE and FIREFOX added.

Kihon Kata 04-18-2006 06:15 AM

woot, I'll check this out very soon

First post!

G-Force 199 04-18-2006 02:11 PM

Installed.
But could you zip all the files ? Thank anyway.

The Chief 04-18-2006 02:19 PM

this looks good, I will maybe try it out today :)

Kihon Kata 04-18-2006 02:58 PM

COOL! INSTALLED! One problem, it didn't work! ;)

I installed this and all it did was put the text "Your Avatar" with a link to http://www.YOURSITENAME.com/forums/p...?do=editavatar

I tried to put it in a few different templates also.

toolblast 04-18-2006 11:19 PM

Hi Kihon and others! Thanks for installing and testing.

I quickly uploaded this plugin last night as I finally got it working on my forum. However, there are a few bugs in the code which I am fixing right now.

Expect an updated zip file within an hour or so! Thanks.

toolblast 04-19-2006 01:22 AM

Quote:

Originally Posted by G-Force 199
Installed.
But could you zip all the files ? Thank anyway.

Zipped. Done.

toolblast 04-19-2006 01:24 AM

Quote:

Originally Posted by Kihon Kata
COOL! INSTALLED! One problem, it didn't work! ;)

I installed this and all it did was put the text "Your Avatar" with a link to http://www.YOURSITENAME.com/forums/p...?do=editavatar

I tried to put it in a few different templates also.


It is showing 'yoursitename' and the avatar image is not working because you have not defined your website URL in your general Vbulletin settings. Do that and it should work fine.

Kihon Kata 04-19-2006 01:40 AM

Quote:

Originally Posted by toolblast
It is showing 'yoursitename' and the avatar image is not working because you have not defined your website URL in your general Vbulletin settings. Do that and it should work fine.

HI Tool! Uhm do you mean my "Internal URLs"?

And did you update it?


All times are GMT. The time now is 06:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01166 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete