PDA

View Full Version : Avatar hack v0.9 released


06-08-2000, 04:23 AM
Hi all

Well, I finally got the bugs zapped, and am releasing v0.9

What's done:

Admin modification panel now sets the $avimage field properly
Admin modification panel now has new options: text entry field to enter a custom image path and file. Over-ride selector (which lists the publically available avatars), setting the avatar image to the custom one.
Admin Add User panel has the $avimage field bug fix, and the custom image settings.
Removed Javascript from templates, making them more browser compatible, and managing to cleverly avoid having to demonstrate my abject lack of knowledge with dHTML by not having to debug the image selector Javascript :)
Added new option to Edit Profile selector. Now, if a file exists in images/avatar/private, called $userid.gif, the selector box will list "Your Custom Avatar" at the top of the selector box.


This means that private avatars will be available, but the admin will have to upload it and rename it to $userid.gif for it to show up in a user's options.

What's coming up for v1.0?

Option to allow users to upload their own custom avatar images, with byte size limits, toggled from the control panel.
Option to set a default Avatar image for Usergroups, over-riding avatarshow in control panel (So you can allow certain user groups to have avatar images, while restricting it from others).


Instructions for applying this hack from scratch are available at http://www.moonwolf.net/cgi-bin/vb_mods/avatar/instructions.cgi

Those of you who have already applied v0.8, you only need to change:

member.php
user.php
and the three templates: registeradult, registercoppa, updateprofile.

You also need to run the following mini script to update the database fields:

<?php
require("./global.php");
$DB_site->query("ALTER TABLE user ADD avcustom SMALLINT (6) DEFAULT '0' not null ");
echo "Table 'user' updated<br>";
?>


Save this to a file in your forum/admin directory, then call it from your browser.

You should be able to go through the instructions and spot where you need to change, but if people have problems upgrading, I'll post specific instructions up on my site on request.

Here's hoping I remembered all the changes this time :)

Kath

06-08-2000, 05:11 PM
Hello,

This is awesome. I am going to upgrade to vBulletin ASAP!

Thanks for your hack!

06-08-2000, 05:15 PM
Great job Kath!

I'm going to add it to my Beta site and see how it works for me :)

I think I'm gonna wait on the 1.0 before going public with it, tho. what a pain in the patootie to upload and rename 3000+ icons

hehehe

again, super job!

06-08-2000, 05:22 PM
Hello,

Shoot. I read it wrong. I thought the features coming in 1.0 were out in this version.

Looks like I have time. Oh well.

Thanks again Kath. Great job!

06-09-2000, 01:06 AM
heh

Sorry for not getting the avatar upload for users and usergroup avatar functions out in 0.9, but I wanted to get the bug fixed version out as soon as I could.

Martin, are your icons names for the UBB Avatar hack? i.e. _ in names that were converted to " " in the select boxes?

If they were I could write you a little script that will scan the avatars directory and insert their names into the database for you, saving time ...

Kath

06-09-2000, 03:13 AM
Kath,
I appreciate hte thought, but I never bothered to hack it into my UBB because it was such a pain and relied heavily on JavaSrcipt. I have a lot of Mac and WebTV users and I hate for them to feel left out:)

06-09-2000, 03:23 AM
0.9 and 1.0 have no javascript now :)

Kath

06-09-2000, 10:53 AM
Does anyone have a forum running the latest released version of this hack so we can see it in action before applying it to our own?

The underlight.com forum seems to be using a dynamic selector still...

06-09-2000, 08:09 PM
This hack keeps getting better :)
I'll implement it as soon as I have some time

06-12-2000, 11:32 AM
I've got the implementation working.

Also fixed a bug in the original which was messing up the user table when I used the control panel to edit a user.


Original Instruction
$DB_site->query("UPDATE user SET usergroupid=$usergroupid,username='".addslashes($username).


Should be


$DB_site->query("UPDATE user SET usergroupid=$usergroupid,username='".addslashes($ausername).


Shri

06-12-2000, 02:34 PM
Hello,

I'm not trying to be pushy :)

I was just curious what your expected release date was for version 1.0?

Preferably the release of custom user images and byte size limitations.

Thanks.

06-14-2000, 02:18 AM
I don't know whether it will have any problem
when the uploaded user private avatar images have
over 3000 or more in a single directory?

Will it slow the server speed when too many files
stored in a single directory?

I had ever set 2 fields to store image-file-name and image-file-path (ex. image-file-path="1000-3000") when I had
huge user image-files data uploaded!

[Edited by PaulLin on 06-14-2000 at 11:40 AM]

06-15-2000, 04:43 AM
One of the things I'm looking into with 1.0 is storing the custom images direct in the database itself, rather than as files.

Kath

06-15-2000, 01:36 PM
Image files are often huge!
Will it not slow down the mysql searching speed when you
put many image files in mysql database?
You may get 1000 user images files uploaded and get 80mg
file space used!

06-15-2000, 01:59 PM
Hello,

Not if you use image magick and mogrify.

http://www.imagemagick.org/

I use this for a gallery hack that Code Warrior made for the UBB. It will resize an image for you, thus lowering the KB of the image.

Check out an example on my boards at:
http://www.paintballcity.com/cgi-local/ubbcgi/gallery.cgi?action=browse&number=35

You'll see that all the images uploaded were copied to a thumbnail image around 90 x 90 so that users can get a preview of the users uploads and then click on them for the original image. It works great. I had to modify the code a bit to encode the file name if a space was in it but that was easy.

Image Magick is great, but not many hosting companies will allow you to use it. I'm pretty sure Communitech.com does and some others though. I'm running on a dedicated so it makes it easier.

06-16-2000, 01:08 AM
I'd still advise against storing the binary in the database.

Although databases are fast, it is much simpler for the web servers file system to serve up an image. You can still use mogrify to thumbnail it if you need to.

IMO, just store the path (or filename) in the database, and use the call to find it, then the file system to retreive it. :D

06-17-2000, 06:24 AM
For some reason, none of the avatars will appear in the select box for new registers. Any ideas?

They'll appear when you go to edit a profile, but not otherwise

11-17-2000, 10:32 AM
Hi,

I am using vB 1.1.4. Apply the hack, I can choose the icon but it will not show up on post. It is blank?

Got any ideas???

11-17-2000, 12:09 PM
<a href="http://www.vbulletin.com/forum/showthread.php?threadid=2127" target="_blank">http://www.vbulletin.com/forum/showt...?threadid=2127</a>

11-21-2000, 05:29 PM
Sorry about my absence, and what happened to this whole hack.

Basically, I had a life explosion (One loud enough to warrant three articles in the Washington Post about it, even), and am clawing my way out of it slowly but surely.

So if there's still a need for this hack, I'll complete it. If not, I'll drop it :)

Sorry again.

Katherine

Neo
04-27-2002, 06:37 PM
Ahhh the memories

CeleronXL
04-27-2002, 07:56 PM
Why does everyone in this thread show up as a guest except neo?

scsa20
04-27-2002, 08:57 PM
I'm wondering that same question :confused:

Neo
04-27-2002, 09:24 PM
Well most likly they either didnt register on vb.org / changed their user name / or dont use vb anymore