View Full Version : [RELEASE vB2.0] Custom Avatars as Files
Kier
Sun 18th Mar '01, 7:56pm
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.
http://kier.3dfrontier.com/vbhacks/avatarasfile.gif
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 are available here (http://kier.3dfrontier.com/vbhacks/avatarasfile.php).
Please insure that you have thoroughly read the instructions (http://kier.3dfrontier.com/vbhacks/avatarasfile.php) before asking questions, as they are probably already answered there.
Sharg
Sun 18th Mar '01, 8:04pm
Hi kier,
does your system allow admin to set max avatar size (lets say 80 x 80) and a weight (lets say 3ko) ?
This worked with mysql storing , will it work with your sysem ?
Sharg
Sun 18th Mar '01, 8:06pm
Oh, and does it allow user to upload their files, switch from one avater to the other (and have the previous one replaced and eareased ) ?
Sharg
Sun 18th Mar '01, 8:08pm
Kier, you know what ? :)
It would be GREAT to port this system to attached files to :)
Kier
Sun 18th Mar '01, 8:12pm
Originally posted by Sharg
does your system allow admin to set max avatar size (lets say 80 x 80) and a weight (lets say 3kb) ?
Oh, and does it allow user to upload their files, switch from one avater to the other (and have the previous one replaced and eareased ) ? Yes, All avatar options that are present when using the standard mySQL avatar system are still present
Originally posted by Sharg
Kier, you know what ? :)
It would be GREAT to port this system to attached files to :) I'm not really interested in doing this for attached files, partly for security reasons, and partly because storing attachments in the database does not have the same problems/disadvantages as the avatar system. The reason I have done this for avatars is mainly to solve a problem with IE's cache which causes avatars to be downloaded again for every page, leading to increased server load and bandwidth use.
Sharg
Sun 18th Mar '01, 8:22pm
Yes, All avatar options that are present when using the standard mySQL avatar system are still present
Ok, just wanted to make sure they worked with directory storing, as I thought these size and weight option were database storing specific.
Another question: do I need to set to 777 the directory storing the avatars ?
Kier
Sun 18th Mar '01, 8:26pm
Originally posted by Sharg
Another question: do I need to set to 777 the directory storing the avatars ? Do the instructions say you have to? Have a read. http://kier.3dfrontier.com/vbhacks/avatarasfile.php
Kier
Sun 18th Mar '01, 8:29pm
And I quote:
1) Firstly, you will need to create a new folder in your forums directory called custom_avatars and set the permissions on the folder to 777.
Sharg
Sun 18th Mar '01, 8:32pm
Just a last question before I try to install it:
I'm not really interested in doing this for attached files, partly for security reasons,
What's the security concern that attachement files folder storing involve that isn't involved by avatar folder storing ?
Kier
Sun 18th Mar '01, 8:35pm
Originally posted by Sharg
What's the security concern that attachement files folder storing involve that isn't involved by avatar folder storing ? Avatars are always stored as xxxx.gif. Attachments can be of any file type that the administrator decides to allow. If an administrator decided to let .php files be uploaded, and they were stored as files on the system, anyone could run a php script that could destroy the server.
It's a bad idea.
Sharg
Sun 18th Mar '01, 8:41pm
Ok, got it, thanks Kier.
I didn't considered this cause I would only allow jpg,gif, txt and zip and would use it.
Anyway, good job with this hack. Gives the webmaster the final decision.
Chris Schreiber
Sun 18th Mar '01, 9:14pm
Another wonderful hack, thanks Kier.... I already have it installed and working on Me2Be's forums.
Just one small typo, in the control panel options, it says "Store Custom Avatars in Database?", but this has to be set to "yes" to use files, "no" to use the database. It should say "Store Custom Avatars as Files?". But otherwise it works great!
Thanks :)
Kier
Sun 18th Mar '01, 9:23pm
Fixed :)
If you have this problem and want to correct it, run this query:
UPDATE setting SET title='Store Custom Avatars as Files?' WHERE varname='usefileavatar'
Kier
Sun 18th Mar '01, 9:40pm
I just discovered that two php files that require modifications were not mentioned in the original documentation... please revisit the docs and follow the steps to modify private.php and announcement.php if you installed this hack prior to the posting of this message. :)
-saturn-
Mon 19th Mar '01, 6:22am
Kier, you are great! :)
Are all avatars stored as GIFs? Even those uploaded as JPGs? I'm asking because you said "Avatars are always stored as xxxx.gif".
GameGalaxy
Mon 19th Mar '01, 6:26am
Can you please make a hack for avatars that mods and admins can use custom, but any other group can't?
Or make it to where by group you turn on/off custom setting.
Under each group add
Can use custom avatar Yes/No
If you do modify for a group you'd see where it would be nice to have that setting.
Thanks
pestilence
Mon 19th Mar '01, 7:14am
yet another fine hack well done kier btw when does your new website open to the general public ?
tubedogg
Mon 19th Mar '01, 8:34am
Originally posted by GameGalaxy
Can you please make a hack for avatars that mods and admins can use custom, but any other group can't?
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.
mrlister
Mon 19th Mar '01, 10:58am
kool hack Kier
PFunk
Mon 19th Mar '01, 12:18pm
Are all avatars stored as GIFs? Even those uploaded as JPGs? I'm asking because you said "Avatars are always stored as xxxx.gif".
Yes, even JPG file types. Rename a .jpg file to .gif and open it in your browser. It should display just fine.
-saturn-
Mon 19th Mar '01, 1:16pm
They are just RENAMED to GIFs or are they converted to GIFs?
PFunk
Mon 19th Mar '01, 1:21pm
They are just RENAMED to GIFs or are they converted to GIFs?
There is no "conversion" from one type to another. The data is stored as binary, and when "displayed" using avatar.php, it adds header("Content-type: image/gif"); so your browser will believe it's a gif file. The contents of your jpg are unchanged, just sent to the browser as image/gif so it can be displayed.
Kier
Mon 19th Mar '01, 1:22pm
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')
PFunk
Mon 19th Mar '01, 1:25pm
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.
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.
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.
Let me know if I am way off base here.
Kier
Mon 19th Mar '01, 1:45pm
You're right. I'll look into it.
GameGalaxy
Mon 19th Mar '01, 1:51pm
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.
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.
Kier
Mon 19th Mar '01, 2:44pm
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 (http://kier.3dfrontier.com/vbhacks/avatarasfile.php) 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.
-saturn-
Mon 19th Mar '01, 2:55pm
Thank you Kier!
Kier
Mon 19th Mar '01, 3:14pm
Originally posted by pestilence
yet another fine hack well done kier btw when does your new website open to the general public ? not yet (http://vbulletin.com/forum/showthread.php?postid=http://vbulletin.com/forum/report.php?s=&postid=78048#post78048) ;)
conan
Mon 19th Mar '01, 3:34pm
Another great hack Kier!
Thanks a lot
Trog
Mon 19th Mar '01, 4:19pm
Another stunning effort. Just one question. I know you have been in close connection with the developers on this issue, so do you know if this hack will be in Beta 4? I just don't want to install it then re-install when beat 4 comes out.
PFunk
Mon 19th Mar '01, 4:32pm
Ok, this is the final thorn I will use today.
How about one last modification to avatar.php to prevent bandwidth stealers from circumventing the security measures people may put on the custom_avatars folder. Only bring this up because now there is a customavatar record again.
Either returning nothing, or the clear.gif image.
Ok, that's it... I promise. =) No, really! heheheh
Great work on the hack, and responding so quickly with a fix to the previous post of mine.
jojo85
Mon 19th Mar '01, 4:55pm
one more kier
you are the best of the best!
Kier
Mon 19th Mar '01, 6:15pm
Originally posted by PFunk
Either returning nothing, or the clear.gif image. Easy, if you use avatars-as-files, just edit avatar.php and at the top of the file, under <?php just put
exit;
I'm not going to do anything more fancy than that, as it would add extra queries to avatar.php, which I am not prepared to do.
Kier
Mon 19th Mar '01, 7:16pm
If you installed the hack previous to this message, please revisit the instructions and follow the steps to modify admin/user.php... I completely forgot to hack that file before :rolleyes:
PFunk
Mon 19th Mar '01, 11:15pm
<< removed >>
Kier
Mon 19th Mar '01, 11:58pm
Originally posted by PFunk
Add this:
require("./global.php");
if ($usefileavatar) exit;
This will cause avatar.php not to return the graphic if Use File Avatars is enabled, otherwise, it works as before. Oh my god do you not want to add that!!!!
If you use require("./global.php") in avatar.php, you will be executing huge numbers of queries every time an avatar is displayed...
This code should really (really) not be added!
Robert Basil
Fri 30th Mar '01, 12:55pm
Kier,
Great hack! This should speed up my forum a lot.
One thing before I install this hack. Will the database change that this hack does cause any problems when I upgrade to beta4? (Other than changing the php files of course)
Thanks again!
VirtueTech
Fri 30th Mar '01, 4:51pm
Hello Kier,
Would I be able to use this hack in conjunction with upgrading my 1.13 forum.
See, right now the current VB 2.0 upgrade1.php script does not upgrade my "custom_avatar" table from freddies VB 1.13 "Custom Avatar HAck"...which means my users will have to all re-upload their custom avatars.
You seem to be a hack master around here lately...do you think you could figure it out?
If so here is the information:
Here is my old 1.13 "custom_avatar" table:
CREATE TABLE custom_avatar (
id int(6) NOT NULL auto_increment,
bin_data longblob NOT NULL,
filename varchar(50) NOT NULL,
filesize varchar(50) NOT NULL,
filetype varchar(50) NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
UNIQUE userid (userid),
KEY userid_2 (userid)
);
And here is the new VB 2.0 "customavatar" table:
CREATE TABLE customavatar (
userid int(10) unsigned DEFAULT '0' NOT NULL,
avatardata mediumtext NOT NULL,
PRIMARY KEY (userid)
);
Anything you could do to help me salvage my current user's custom avaatrs would be fantastic. Even if it means upgrading the custom avatars into your hack...which I want to store them outside the database anyway.
Thanks for your time. :)
Freddie Bingham
Fri 30th Mar '01, 4:59pm
drop the new customavatar table.
rename custom_avatar to customavatar.
Drop the fields id, filename,filesize, & filetype
rename bin_data to avatardata, change the type to mediumtext.
Drop the second index userid_2
p.s. now watch your avatars blow up in size as my hack made no checks on image height/width, only filesize. It used img tags to force all images to be the same size when displayed.
DVD Plaza
Tue 10th Apr '01, 2:32am
This might be a silly question (sorry!), but why isn't this a part of the official product?
TechTalk
Wed 11th Apr '01, 11:23pm
Originally posted by DVD Plaza
This might be a silly question (sorry!), but why isn't this a part of the official product?
I would like to know too....
Kier, can we just make sure all of your hacks make it in the final releases? I would be a much happier man
~Chris
Freddie Bingham
Wed 11th Apr '01, 11:40pm
It will be part of 2.1
jojo85
Thu 12th Apr '01, 12:49am
Nice :D
VirtueTech
Sat 14th Apr '01, 5:40am
Thank you very much Kier
TooHectic
Sat 14th Apr '01, 11:58pm
does this work with beta 5?
I ran the install_db2fileavatars.php, at started to edit the files, but I noticed that the files were a little different for beta 5. For instance, the first modification step adjusts the functions.php file, and one of the original lines is
return "avatar.php?s=$session[sessionhash]&userid=$userid";
But this line looks like this in beta 5
return "avatar.php?userid=$userid&dateline=$avatarinfo[dateline]";
Can I still proceed with the rest? In fact, I had origianlly decided to stop, but the install_db2fileavatars.php already changed some things...... so I can't even set any custom avatars as it stands right now. I get a blank screen after I submit the settings for uploading the avatar. Can I fix this, or can I just continue with the hack? :confused:
VirtueTech
Sun 15th Apr '01, 12:03am
I proceeded and it worked great with beta 5
TooHectic
Sun 15th Apr '01, 4:20am
Thanks... I'll try it tomorrow.
CityNet
Mon 16th Apr '01, 4:36am
Arrgh.. I did this hack, entirely as instructed and when going into the Change Profile page I get this:
Parse error: parse error in /usr/local/plesk/apache/vhosts/thecitynetwork.net/httpdocs/forums/member.php on line 1042
What happened?
TomLloyd
Mon 16th Apr '01, 10:05am
Thanks for this hack Kier.
We had to disable avatars on our site because the amount of people uploading to the Db crashed our server! (RaQ 4)
Have re-enabled avatars now, much thanks.
(I'm using beta 5, and I noticed no problems installing btw)
CityNet
Mon 16th Apr '01, 2:59pm
Originally posted by CityNet
Arrgh.. I did this hack, entirely as instructed and when going into the Change Profile page I get this:
Parse error: parse error in /usr/local/plesk/apache/vhosts/thecitynetwork.net/httpdocs/forums/member.php on line 1042
What happened?
Finally got around to installing Word and figuring out how to turn on line numbering... What? Line 1042 is just some commented file?
I tried uploading it again. It worked this time.. Thanks. ^_^
((EDIT: Tried entering a URL for an avatar and STILL keep getting "This is not a valid GIF or JPG file. Please ensure that it is and try again"
That's it... I'm going to cuddle up in a fetal position and just cry. Trying to get these avs to work is going to result in me tearing my hair out)
SpankMe
Thu 19th Apr '01, 7:15pm
What we really need is a utility that will go through the MySQL dB and convert all image attachments to files and update the associated post. We could then cron it to run every so often.
I like allowing users to attach images but it is a REAL PAIN for them to download the images every time they visit the thread :(
eiko
Thu 10th May '01, 8:05pm
After installing this hack (which is Awesome by the way)...
When you click a user's profile link, returns this error:
Warning: Object DB_site not found in /home/name/dir/forums3/member.php on line 1037
Fatal error: Member function used on a non-object in /home/name/dir/forums3/member.php on line 1037
RC2
eiko
Fri 11th May '01, 5:33pm
anyone?
eiko
Sat 12th May '01, 10:25am
Maybe I asked this question in the wrong forum?
eiko
Sat 12th May '01, 10:47am
Well no wonder no one replied...
Sorry... BONEHEAD mistake on my part.
uhh...
in my best Gilda Radner.... Nevermind.
Dakota
Tue 15th May '01, 2:09pm
Is there anyway that there could be an option for just mods and admins be able to select custom avatars?
TGO
Thu 17th May '01, 8:22pm
I tried to install this on RC3 and got a datbase error..I REALLY need this hack too. :\
BTW, the error is when I run the install script, I press Install and I get a database error. Whether I have created the custom_avatars directory or not..
Error is:
---
There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.
An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.
We apologise for any inconvenience.
----
Please help with this one Kier..
ForzaGrifo
Sat 19th May '01, 10:51pm
Kier, I've got RC 3 too and I really want this hack. Will I get the same problem as TGO's? Thanks.
Cid Kramer
Sun 20th May '01, 7:53am
I'm in the same boat as TGO the hack is needed badly too, any help would be greatly apriciated.
Sven
Tue 22nd May '01, 5:11am
Tried to install into Final Release... but got stuck while editing functions.php....
The lines to replace are not matching the installation description.... :(
Will there be any update on the hack for the Final????
It would be really nice to get it working, currently Avatars on our Forums are disabled due to traffic but i'd like to offer this to our users.
Fiyah
Tue 22nd May '01, 6:52am
Originally posted by Kier
Yes, All avatar options that are present when using the standard mySQL avatar system are still present
where would you change the max size at?
ForzaGrifo
Tue 22nd May '01, 3:17pm
Originally posted by Sven
Tried to install into Final Release... but got stuck while editing functions.php....
The lines to replace are not matching the installation description.... :(
Will there be any update on the hack for the Final????
Yeah, I would like to know the instructions for installing into 2.0 Gold as well. Can anyone help?
PeterS
Tue 22nd May '01, 10:32pm
just wanted to note works dandy with the 2.0.0 release. read to re-tweak the files but all is happy once again.
Great Hack, many thanks
http://forums.sobservers.com
ForzaGrifo
Wed 23rd May '01, 3:20pm
Hey PeterS, cool site! where did you get that cool news fader?
Luciano
Thu 24th May '01, 3:57am
sorry if i'm off topic,
but i was wondering..
if i have lets say 600 avatars
wouldn't it be nice to have categories like:
Male avatars,
female avatars
simpson avatars
,,,, avatars..
with about 80 each...
would be user and server friendly...
or am I wrong???
Luc
jucs
Fri 25th May '01, 7:01am
If I install this hack for example, what are the risks? I assume if a 2.1 version came out I would have to reinstall? Would it affect say converting from 2.0 to 2.1 down the road?
Sorry if this is a dumb question. I just don't want to sprint before I walk with VB. :)
Sven
Fri 25th May '01, 6:05pm
as announced in the Suggestions & Feedback Thread the Hack will be part of the next version....
But still:
I need some Instructions for this hack to get it installed in vB2.0.0...
Is there anybody who successfully installed it in the final release and could tell me what to do?
jucs
Fri 25th May '01, 8:25pm
Ditto...I would like to install it into V2.0 final.
eva2000
Fri 25th May '01, 8:27pm
Originally posted by PeterS
just wanted to note works dandy with the 2.0.0 release. read to re-tweak the files but all is happy once again.
Great Hack, many thanks
http://forums.sobservers.com great the next hack i need to add :D
jucs
Fri 25th May '01, 9:45pm
What does Read to re-tweak mean?
jucs
Sun 27th May '01, 9:46am
Answer Sven and my questions? Thanks.
Sven
Sun 27th May '01, 11:13am
So here's a bit of the problem:
admin/functions.php as per instructions:
function getavatarurl($userid) {
global $DB_site,$session;
if ($avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom FROM user LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid WHERE user.userid='$userid'")) {
if ($avatarinfo[avatarpath]!="") {
return $avatarinfo[avatarpath];
} else if ($avatarinfo['hascustom']) {
return "avatar.php?s=$session[sessionhash]&userid=$userid";
admin/functions.php in vB2.0.0 Final Release:
function getavatarurl($userid) {
global $DB_site,$session;
if ($avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid='$userid'")) {
if ($avatarinfo[avatarpath]!="") {
return $avatarinfo[avatarpath];
} else if ($avatarinfo['hascustom']) {
return "avatar.php?userid=$userid&dateline=$avatarinfo[dateline]";
} else {
return '';
}
}
}
You see that tiny differences?
So is there anyone out there who could tell me what to do?
nuno
Sun 27th May '01, 11:59am
tx Kier
works with 2.0.0 release also
functions.php
find:
function getavatarurl($userid) {
global $DB_site,$session;
if ($avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid='$userid'")) {
if ($avatarinfo[avatarpath]!="") {
return $avatarinfo[avatarpath];
} else if ($avatarinfo['hascustom']) {
return "avatar.php?userid=$userid&dateline=$avatarinfo[dateline]";
} else {
return '';
}
}
}
replace with:
function getavatarurl($userid) {
global $DB_site,$session,$usefileavatar;
if ($avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,avatarrevision,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid='$userid'")) {
if ($avatarinfo[avatarpath]!="") {
return $avatarinfo[avatarpath];
if ($usefileavatar) return "custom_avatars/avatar$userid"."_$avatarinfo[avatarrevision].gif";
else return "avatar.php?userid=$userid";
}
}
}
Freddie Bingham
Sun 27th May '01, 12:01pm
sven the code looks the same .. it just appears I got to it and broke the sql up into multiple lines which I have a habit of doing.
Wayne Luke
Mon 28th May '01, 2:10am
Originally posted by freddie
sven the code looks the same .. it just appears I got to it and broke the sql up into multiple lines which I have a habit of doing.
Only because it is a lot easier to read and comprehend.
jucs
Mon 28th May '01, 12:26pm
The code replace for announcement.php is incorrect?? I can only find this:
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
Note it is different from this in the instructions:
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?s=$session[sessionhash]&userid=$post[userid]";
What gives? I have final 2.0.
Sven
Mon 28th May '01, 12:31pm
Well, that's almost the same question I have.... what about the
&dateline=$post[avatardateline]" thing?
Do I have to add this at the appropriate places or is it not mandatory?
I got the Avatar_as_files option working on my local testinstallation with the replacements from the instructions but I'm not sure if I can use this on the production environment w/o causing bugs due to the changes.
jucs
Mon 28th May '01, 12:46pm
I just started with that file...are there any more of these discrepencies?
Sven
Mon 28th May '01, 3:45pm
@jucs:
I edited all of the files now to add the "dateline"...
It's in all files but member.php, in most of them you just need to add the
&dateline=$post[avatardateline]"
but in user.php it's different, take care of that one!
In my local installation it seems to work - after I changed the files ;)
jucs
Mon 28th May '01, 7:59pm
I wish the documenation was updated. Now I don't trust myself as there are several "got ya's" due to inaccurate documention for V2.0 and you can't systematically follow exact directions. <sigh>
ForzaGrifo
Tue 29th May '01, 5:01pm
Can someone update the hack install documentation so that 2.0 gold users will know exactly what to do? Thanks.
Sven
Wed 30th May '01, 3:47am
Well, that's what we're asking for.... I already send out a PM to Kier (about a week ago)... but got no response :(
You may want to do the same as I have the assumption that he doesn't look into this thread at the moment.
ForzaGrifo
Wed 30th May '01, 1:29pm
hey, may be the guy is busy.:o
rebby
Thu 31st May '01, 3:05pm
if this will be included in 2.1... i'm really curious on the 2.1 eta... would it be worth my time to hack 2.0???
CoolaShacka
Tue 5th Jun '01, 7:11pm
updating the Instructions woukd be very nice.
Tnx
TooFastForYa
Wed 6th Jun '01, 12:12am
Originally posted by Sharg
Kier, you know what ? :)
It would be GREAT to port this system to attached files to :)
I agree with Sharg...I have been looking for this hack for a long time no with no success. It should be made for the people with smaller databases with large webspace, that want to attach larger files. Please look into making this hack...It would be greatly appreshated!
Thanks,
TooFastForYa
jucs
Wed 6th Jun '01, 1:36pm
I would just go for getting the documenation updated. :(
Dakota
Thu 7th Jun '01, 12:22am
Great hack, I love it, just been holding out on installing it. It installed without any problems. I really like the installer that is coming with these hack, it really saves time.
Edit: the dateline you guys are talking about didn't affect it when I installed it. I just acted like it wasn't there, and just put what is in the installation instructions. It works fine without the dateline stuff.
cditty
Sat 9th Jun '01, 3:44am
Would this be easily modified to allow users to serve their avatars from their web server?
Figure it might save a lot of bandwidth if I allow custom avatars and require them to be served elsewhere.
Chris
huythuy
Sun 10th Jun '01, 4:44pm
Thanks for this hack .
How can I have "custom_avartars" in another folder not the vBB fodler ? Coz I want a share avatars folder with another forum and gallery .
Thanks in advance
huythuy
Fri 15th Jun '01, 4:19pm
Please anyone ?????? :(
Tolitz
Sat 23rd Jun '01, 4:20am
Has anyone been able to make this work on VB 2.0.1? What changes in the instructions did you do? I "really" like to incorporate this hack coz it'll save me valuable database space, as well as protect my avatar images with mod_rewrite ...
Anyone care to update the instructions? please? :(
ztsky
Sat 23rd Jun '01, 11:12am
Originally posted by Tolitz
Has anyone been able to make this work on VB 2.0.1? What changes in the instructions did you do? I "really" like to incorporate this hack coz it'll save me valuable database space, as well as protect my avatar images with mod_rewrite ...
Anyone care to update the instructions? please? :(
Check my board (http://www.chinavbb.com)
ztsky
Sat 23rd Jun '01, 11:34am
See this,I edit this hack from Kier.
It works well on my board vb2.0.1.
this zip include two files. install_db2fileavatars.php adn install.txt.
Unzip this zip,upload and run install_db2fileavatars.php in your board admin dir.Then edit and upload your file as install.txt.
Good luck!
Christian
Tue 26th Jun '01, 6:52am
When the hack is installed and all files are stores in the folder, is it safe to empty the custom_avatar table then?
Dimitri
Fri 29th Jun '01, 7:25pm
Only problem with ztsky's version of this hack is that the avatar will no longer display on the profile page, whether it's your edit profile page or someone else's view profile page. Can you modify the 'hack' in the members.php file so it still shows it in profile pages? Works fine otherwise. ;)
ztsky
Mon 2nd Jul '01, 4:00pm
Originally posted by Dimitri
Only problem with ztsky's version of this hack is that the avatar will no longer display on the profile page, whether it's your edit profile page or someone else's view profile page. Can you modify the 'hack' in the members.php file so it still shows it in profile pages? Works fine otherwise. ;)
just like this
in member.php,
1ˇ˘find :
$userinfo[avatarurl]=getavatarurl($userinfo[userid]);
if ($userinfo[avatarurl]=="") {
$userinfo[avatarurl]="images/clear.gif";
replace with this:
$userinfo[avatarurl]=getavatarurl($userinfo[userid]);
if ($userinfo[avatarurl]=="") {
if ($userinfo[avatarrevision]>0) {
$userinfo[avatarurl]="custom_avatars/avatar$userinfo[userid]"."_$userinfo[avatarrevision].gif";
} else
$userinfo[avatarurl]="images/clear.gif";
2ˇ˘find
if ($bbuserinfo[avatarurl]=="") {
$bbuserinfo[avatarurl]="images/clear.gif";
replace with this:
if ($bbuserinfo[avatarurl]=="") {
if ($bbuserinfo[avatarrevision]>0) {
$bbuserinfo[avatarurl]="custom_avatars/avatar$bbuserinfo[userid]"."_$bbuserinfo[avatarrevision].gif";
} else
$bbuserinfo[avatarurl]="images/clear.gif";
ForzaGrifo
Mon 16th Jul '01, 3:39am
Originally posted by Dakota
the dateline you guys are talking about didn't affect it when I installed it. I just acted like it wasn't there, and just put what is in the installation instructions. It works fine without the dateline stuff.
I've got 2.0.0. So do I just ignore the dateline stuff and put what's in the installation instruction? Will it really work?
I'm hesitant of hacking the code unless I'm 100% sure it will work and not crash.
btw can somebody update the instruction for 2.0.x users?
ztsky
Mon 16th Jul '01, 7:02am
Originally posted by ForzaGrifo
I've got 2.0.0. So do I just ignore the dateline stuff and put what's in the installation instruction? Will it really work?
I'm hesitant of hacking the code unless I'm 100% sure it will work and not crash.
btw can somebody update the instruction for 2.0.x users?
http://161.58.84.213/forum/showthread.php?threadid=22115
Mr. X
Wed 25th Jul '01, 5:23am
Fatal error: Failed opening required './global.php' (include_path='') in /home/mx3dm1/public_html/vb/admin/install_db2fileavatars.php on line 2
This is what I get. Im using php3 files since vB refuses to install when I use .php.
Im wondering, can I just change the .php in your installer file to .php3?
Also, when you say:
1) Firstly, you will need to create a new folder in your forums directory called custom_avatars and set the permissions on the folder to 777.
Do you mean create in the root forum folder, or in the /images folder? If not, do I need to move all the other avatars in my images/avatars folder to the new one?
Mr. X
Sun 29th Jul '01, 4:38pm
Bump. Come on, no one?
VirtueTech
Mon 30th Jul '01, 1:15am
Doesn't 2.0.1 include this hack already?
Same with attachments?
Scoty
Tue 31st Jul '01, 1:01am
There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.
An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.
We apologise for any inconvenience.
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
i have vBulletin 2.0
TheProfessor
Tue 7th Aug '01, 4:50am
How to apply this hack in vB 2.0.3?
showthread.php changed completly, I just cannot replace some code, because it is not there.
Kier or Freddi, please?
Greetings, The Professor!
eXtremeTim
Tue 7th Aug '01, 5:36am
in the newer version ov vb it seems that the users only have to hack member.php and admin functions.php and the hack seems to work fine.
TheProfessor
Tue 7th Aug '01, 8:32am
Yes, in fact it works fine, but just when viewing the member's profiles or private messages.
When showing threads, avatars will be still loaded from the SQL-Server.
Greetings, The Professor!
eXtremeTim
Tue 7th Aug '01, 9:26am
yea i just noticed that so you just have to hack the showthread file up.
eXtremeTim
Tue 7th Aug '01, 9:47am
i did some searching and found were the coding to hack up is at now so latter tonight i will see about releasing a new version of this hack for vbulletin 2.0.3
Castel
Thu 9th Aug '01, 9:07pm
Any progress in getting this to work properly for 2.0.3 showthread?
HalfBreed
Sun 12th Aug '01, 4:00pm
**BUMP**
Dakota
Fri 17th Aug '01, 3:14am
Here's how to get it working in 2.0.3
In admin/functions/php, announcement.php and private.php
Find:
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
and replace it with:
if ($post[hascustomavatar] and $avatarenabled) {
if ($usefileavatar) $avatarurl="custom_avatars/avatar$post[userid]_$post[avatarrevision].gif";
else $avatarurl="avatar.php?userid=$post[userid]";
Christian
Fri 17th Aug '01, 3:51pm
Do you have to run the install again after upgrading?
If so, which one did you use?
The original or the one of the modified hack?
Castel
Thu 23rd Aug '01, 2:07pm
Dakota, that's the exact same code as the original hack. I am aware that the showthread.php changes are now in functions.php but this doesn't make it work.
Look at the source code of a thread with a custom avatar and you will see the avatar is still img src=avatar.php.... while on other pages that display the avatar it does indeed come for the custum_avatars folder.
Lordmusic
Fri 24th Aug '01, 8:39pm
****, buddy. Please rerelease an update for your hack!!! It is needed.
DoST
Fri 24th Aug '01, 10:41pm
Yes please I also want to use this hack with vB 2.0.3
centris
Sat 25th Aug '01, 12:09pm
Would someone PLEASE start a new thread for 2.03 hacks. I ran the install script and then found that the code did not match, now I have to wait for an update.
Sven
Wed 29th Aug '01, 1:54pm
Mhmm, if just Kier would look into here and post something like:
Yes, I'm going to update, be patient
or at least
No, I'm too busy, sorry
pier
Tue 4th Sep '01, 10:14am
Any news yet ? My forum needs this mod to work!
thanks for your great feature
pier
tamarian
Tue 4th Sep '01, 8:05pm
I have a guess why Kier didn't update the hack.
It's already done on the vB 2.0.4 waiting for release! :D
Lordmusic
Tue 4th Sep '01, 9:01pm
Unless this hack is done, none of my members can change their avatars :-/
Sven
Thu 6th Sep '01, 6:07pm
^bump^this^a^little^ ;)
DarkReaper
Thu 6th Sep '01, 6:47pm
You state that you can use .htaccess to prevent the files from being linked from outside my server...how would I do this? Place a .htaccess file in the forums directory with what contents? Thanks.
eva2000
Thu 6th Sep '01, 6:51pm
Originally posted by DarkReaper
You state that you can use .htaccess to prevent the files from being linked from outside my server...how would I do this? Place a .htaccess file in the forums directory with what contents? Thanks. use http://faq.solutionscripts.com/misc/hot_linking.html
DarkReaper
Thu 6th Sep '01, 7:09pm
Thanks :)
kaeros
Fri 7th Sep '01, 12:22pm
I just recently installed this hack and now I notice that the forum doesn't update the numver of views where before it did. Is this happening to anyone else?
Lordmusic
Sat 15th Sep '01, 3:15pm
This hack needs to be updated for 2.0.3 ! ! !
cocomiel
Sat 15th Sep '01, 5:11pm
Please Update the hack ... why you didnt yet ?
Its one of the bests hacks outhere
cocomiel
Sat 15th Sep '01, 5:12pm
Ok, i will code this one, will be ready in two days
DarkReaper
Sat 15th Sep '01, 6:56pm
um..the installation link isn't loading.
DoST
Fri 21st Sep '01, 11:44am
two days passed :P how is it going?
cocomiel
Fri 21st Sep '01, 2:50pm
you should look here :
http://www.vbulletin.com/forum/showthread.php?threadid=28337
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.