Version: , by Cocomiel
Developer Last Online: Mar 2005
Version: 2.2.x
Rating:
Released: 09-17-2001
Last Update: Never
Installs: 17
No support by the author.
Custom Avatars As Files Hack for VB 2.2.1
BASED ON THE KIER'S HACK
Description: This hack lets you store custom avatars in a separate folder rather than in the VBulletin database, saving space & querys in your MySQL database
Here are some of the features:
Allows to switch between file mode & database mode on the fly
You can specify the custom avatar folder
No SQL queries or PHP code required to display custom avatars
If you use the Apache Web Server, the avatars folder can be protected by .htaccess thus preventing bandwidth stealing
No cacheing issues with Internet Explorer 5.5
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.
Intructions:
Upload install_fileavatar.php to your ADMIN directory and open it in your browser, then follow the screen instructions.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
if ($avexists=$DB_site->query_first("SELECT userid FROM customavatar WHERE userid=$bbuserinfo[userid]")) {
$DB_site->query("UPDATE customavatar SET filename='".addslashes($avatarfile_name)."',dateline='".time()."',avatardata='".addslashes($filestuff)."' WHERE userid=$bbuserinfo[userid]");
} else {
$DB_site->query("INSERT INTO customavatar (userid,avatardata,dateline,filename) VALUES ($bbuserinfo[userid],'".addslashes($filestuff)."','".time()."','".addslashes($avatarfile_name)."')");
}
with:
PHP Code:
if ($avexists=$DB_site->query_first("SELECT userid FROM customavatar WHERE userid=$bbuserinfo[userid]"))
$DB_site->query("UPDATE customavatar SET avatardata='".addslashes($filestuff)."' WHERE userid=$bbuserinfo[userid]");
else
$DB_site->query("INSERT INTO customavatar (userid,avatardata) VALUES ($bbuserinfo[userid],'".addslashes($filestuff)."')");
It seems absolutely inaccurate, as you say to replace a different piece of code (than Kier's/Bira's VB 2.0.x version), because in 2.2.1 that's the actual code, WITH THE SAME piece they specified...
I got many many more confused !
Is it possible after SIX MONTHS of challenge, none of you gave a DECENT version of this hack ?
Sorry for my phrases, but I think it isn't acceptable from coder or people they want to help some other.
Hi what's the performance issue prob if I use the default method which stores custom avatars into the database?? I have about 40 users who would want custom avatars.
How do I uninstall the things this hack did? I did the install and the editing all errored, and when i went bck to the board the avatars were all still hosted via database.