![]() |
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:
Quote:
Quote:
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: |
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. |
woot, I'll check this out very soon
First post! |
Installed.
But could you zip all the files ? Thank anyway. |
this looks good, I will maybe try it out today :)
|
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. |
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. |
Quote:
|
Quote:
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. |
Quote:
And did you update it? |
Quote:
Go to your vbulletin admincp and tell me what you find here: VBULLETIN OPTIONS > VBULLETIN OPTIONS > SITE NAME / URL / CONTACT DETAILS >> The variable called "FORUM URL" (2nd input box). You should have the url to your forum in there with no trailing slash. |
I have that filled up with "http://www.MYSITENAME.com/forums" with no quotes and my real forum name.
|
Ok, and tell me:
1) Try putting the avatar code into the header template of your forum. 2) Then, login to your forum and make sure you have an avatar selected for the username you logged in with. 3) Make sure you've downloaded and are using the recent files I put in the zip file attached here. It should work fine if you're using VB3.5. There must be a setting somewhere that is not set correctly on your forum if it doesnt work. I can show you a demo forum with this running if you'd like. |
I did the top 2 already. Did you update #3 today?
EDIT: I am using 3.5.4 |
Hi Kihon,
I just did some checking and I see the problem you are seeing now. It only seems to happen in FireFox. If you use IE the plugin works fine. I wonder why it doesnt work in firefox. I'll look into it. |
Quote:
Yes. I just uploaded a new zip file. It seems that the image isnt displaying in firefox (though its common php thats creating the image, so Im not sure sure why). |
Oh ok, even though I have a busy forum with 99.99% women, many many use Firefox. I'll wait until you update it w/ firefox. :-)
|
Hi Kihon.
Ok, I have gotten it to work with FireFox now. I will upload a new zip file to this thread in about 4 minutes and it will be called 'PluginFiles.zip' ok? |
woot! nice support toolblast! update the version and I'll reinstall it
|
Ok Kihon. It should be all done.
Works in both Firefox and IE6. Ive checked both. Also, i've included an image called 'noavatar.jpg' which will show up if the user has no avatar. Tell me if you have any problems! |
Don't forget, the variable is now '$useravatar' if you just downloaded the latest zip file (which I uploaded a second ago). Then $useravatar is the variable you can use in any template to show your resized avatar of the current logged in user.
|
Quote:
|
Quote:
I uploaded the php file into the forum root, imported the plugin in the acp and I than went to my header template and addedd:
WHo knows. |
Ok, right-click on the red x'd image and look at the properties of the image. Copy and paste that into this thread. Thanks :)
As for the 'no avatar image' hack, I'm not sure exactly what will happen because I dont have it installed on my test board. I would assume that the no avatar image hack either a) gives all users a default avatar, so they have an avatar at all times, just the one they get is your default one. This case, this plugin would just shrink and display the default avatar. b) it dynamically places a 'noavatar' image everywhere that the user's avatar is displayed and dynamically does it. Thus, the user sees 'do not use avatar' checked off in their usercp, but it shows the default image anyways. In this case Im not sure what would happen. Is the 'no avatar image' hack, that is separate to this one, a plugin? If so, try turning that plugin off and seeing if this one works. |
RED X url:
Code:
http://www.MYSITEHERE.com/forums/imageresize.php?image_name=http://www.MYSITEHERE.com/forums/image.php?u=4&dateline=1139443346&image_height=40&image_width=50 |
Check with your host, you might not have the GD graphics library enabled on your server. Maybe if you want i'll put together a php file that will do a test to see if you have the requirements that php needs to generate the thumbnail.
|
Quote:
Running Linux Fedora ...this server also has GD 2 installed |
Hmm. Well Kihon, I really dont know what to say lol. If you're running vb 3.5.4 and you're logged in as a user who has uploaded a custom avatar, and you are still seeing an X or nothing in firefox, then something is setup incorrectly on your server or your vbulletin forum.
If you'd like i'll PM you the URL to a test board I have running the plugin with nothing else installed and it works just fine. Have you tried taking off the 'default avatar' hack you had installed? |
Yep, running a pretty successfull 3.5.4 with almost 400,000 posts :)
What if I let you come in as an admin and you can fool with it? PM me if interested |
hi toolblast, do you know how I might use the imageresize.php to remove exif data from attachments as they are uploaded. I was told that if I can reduce the uploaded files color depth that it would remove the exif data. I was also told that if I resize it was also remove exif data, but I don't really want to resize attachments.
thanks for your time |
Hi Cannabis,
Why do you need exif data removed, may I ask? There may be another solution. |
the users have specifically requested that exif data get dropped for their personal security (cannabis gardeners), also it will help reduce the bandwidth, overhead etc.
thank you for looking into this matter, much appreciated!! |
The only way I see that being done would be to recreate the image (thus taking away the tags from the previous authorship). Using this script you could do that. All you need to do is use the imageresize.php script and make the maximum dimentions HUGE like 99999. That way the image they do upload will not need to be resized. Once you've done that, php will recreate the image and it wont lose any quality (at least it shouldnt). Tell me how that goes. Goodluck.
|
My original question was: Where in the code is the place to do this. And, hey, I really want to reduce the size of the images!
Any idea where in the code ist the place to do this? I just couldn't find the place where the images are being handled when/after uploaded by the user. Thanks! Franz |
I'm kinda in the same boat, due to my lack of php skills I'm not sure where to put the include, but I figured out it would go in the includes/class_upload.php somewhere
|
How can this be used in the postbit so that all users avatars can be made a consistent size within the forums? What code and where would need to be replaced to make this work? I would assume the post_bit but not sure.
|
very good nice job :)
|
Quote:
What are you wanting to resize... ALL images that your users upload in their forum posts? So, it would be in the postbit where the forum displays the images attached to the post? Quote:
|
Quote:
Code:
<if condition="$show['avatar']"> <br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" alt="<phrase 1=" $post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></if> Code:
<if condition="$show['avatar']"> <br /><a href="member.php?$session[sessionurl]u=$post[userid]">$useravatar</a></if> |
Quote:
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 |
All times are GMT. The time now is 11:44 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|