Version: , by Kier
Developer Last Online: May 2011
Version: 2.2.x
Rating:
Released: 03-18-2001
Last Update: Never
Installs: 52
No support by the author.
Updated for vBulletin 2.2.2, 5th February 2002
Since there has been so much demand for this, I wrote a hack that will allow you to store all your custom avatars as files, rather than in the mySQL database.
Doing this will have the following benefits:
Avatars folder can be protected by .htaccess (Apache only) to prevent bandwidth stealing
No SQL queries or PHP code required to display custom avatars - server load decreases
No cacheing issues with Internet Explorer 5.5, so server bandwidth use should decrease
The install script will make the necessary modifications to your database, install a control panel option to switch the file-based avatars on, and convert your existing custom avatars from the database into files.
All avatar options that are present when using the standard mySQL avatar system are still present, and users will not notice a difference in the interface.
Full instructions for altering your PHP files are included in the zip file.
Once you have made the necessary modifications to the PHP scripts, you should run the enclosed install_favatar.php script from your admin/ folder.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by -saturn- They are just RENAMED to GIFs or are they converted to GIFs?
They are just renamed to GIF. This also happens (in a roundabout sort of way) with custom avatars stored in the database (they send a content header which describes their content to the browser as 'image/gif')
problem with showthread.php, private.php, announcement.php, admin/functions.php logic.
If there exists a customavatar record for the poster, it works great. But if you deleted all the customavatar table records, there's a problem.
Code:
if ($post[hascustomavatar] and $avatarenabled) {
if ($usefileavatar) $avatarurl="custom_avatars/avatar$post[userid]_$post[avatarrevision].gif";
else $avatarurl="avatar.php?userid=$post[userid]";
hascustomavatar is false because customavatar.avatardata is null, therefore, it can never check to see if $usefileavatar is true or not. There needs to be a way of determining if a customavatar that's saved as a file exists for that user. Maybe checking avatarrevision > 0.
Code:
if ($post[avatarrevision]>0 and $usefileavatar and $avatarenabled) {
$avatarurl="custom_avatars/avatar$post[userid]_$post[avatarrevision].gif";
} else {
if ($post[hascustomavatar] and $avatarenabled) $avatarurl="avatar.php?userid=$post[userid]";
}
member.php - Also, when a customavatar is deleted or changed to a predefined avatar, the user record needs to be updated to change avatarrevision=0.
I know you can already do this, but this isn't the way it should be done. Its a pain if users want to change all the time or test new ones out.
Quote:
Originally posted by tubedogg
You can already do this, in a round-about-sort-of-way. Just set Custom Avatars to No (in Options) then go into User > Find > username > Edit > change avatar and you can set a custom avatar even if it's disabled for the board at large.
As Pfunk pointed out, there was a logic error which occurred if you deleted the contents of your customavatar table...
I did sat in the instructions and in the install script that I did not recommend that you empty the custom avatar table unless you really (really) had a good reason to do so.
In any case, the code is now fixed. Visit the instructions page and make the necessary modifications to member.php - the other files do not need to be altered if you have already hacked them.
If any of your members' avatars are not showing up, simply get them to re-upload their avatar and it will fix itself.