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.
There seems to have been a slight problem with the database, etc etc
I backed it up first and then started from scratch, still got the same error.
I admit I don't know anything about php, but I'm curious about the coding in the instructions. For example, you say to find:
PHP Code:
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
and replace with:
PHP Code:
if ($post[hascustomavatar] and $avatarenabled) {
if ($usefileavatar) $avatarurl=$fileavatarfolder . "/avatar$post[userid]_$post[avatarrevision].gif";
else $avatarurl="avatar.php?userid=$post[userid]";
As I say, I don't know PHP, but every instance I've seen of else is enclosed as } else {, but not in your script. Could this cause the error?
Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE user ADD
avatarrevision INT (6) UNSIGNED DEFAULT '0' not null AFTER avatarid
mysql error: Duplicate column name 'avatarrevision'
mysql error number: 1060
The error appears because you already have an avatarrevision field in your database, that is because you already instaled another hack that added that field.
if you have phpMyAdmin instaled, select to your database
and in the USER table delete the 'avatarrevision' field
then go to the SETTINGS table and delete the last two fields
But, as previously was mentioned I suggest you to begin installing the hack with a clean VB.
I have not get into this or installed yet, but I was wandering if this hack could be made compatible or is already compatible with the avatar categories hack posted.
I dunno if its got anything to do with the code involved but I would like to know if both hacks could be installed to work together.