View Full Version : Mini-Avatars Hack Released
Mystikal
10-12-2002, 10:00 PM
I've re-released this hack with a completely re-written database independent version :) Enjoy.
The mini-avatars system will enable users to have their own 16x16 image in front of their username in threads, and in the who's online portion of the website. The hack creates 1 table and alters a few files, with 2 new files created.
I'm working on the the new modifications to the admin panel, but this will get you up and running so far =)
Pancreas Paul
10-13-2002, 08:35 PM
May I see some screenshots?
Mystikal
10-13-2002, 08:58 PM
here is 1
Mystikal
10-13-2002, 08:59 PM
another.
Mystikal
10-13-2002, 08:59 PM
the last.
Nice idea. what about user side editing?
(I can see the store hack integration now.. tisk)
Mystikal
10-13-2002, 10:43 PM
eh... see it at blizzforums.com :) im too lazy (actually dont have time) to upload the pic... but its intergrated into the usercp.
mewgood
10-13-2002, 11:58 PM
so where do you put this code <img src="icon.php?userid=$uservariable[userid]" height="16" width="16">
if I want it like blizzforum?
As well it seems it is not working for me. I have safe mode for php.
I uploaded an avatar, but it doesn't show anything..
Velocd
10-14-2002, 12:26 AM
Nice, I like this idea quite a bit actually ;)
*clicks install*
Mystikal
10-14-2002, 01:50 AM
mewgood, we have safe mode and it works fine... the stuff is stored in the database, that's how we get around safe mode.
Mystikal
10-14-2002, 01:51 AM
edit whatever templates you want and put that code in front of the username :)
i.e.,
if you want it in who's online, just edit the loggedinuser template in forumhome templates and put <img src="icon.php?userid=$uservariable[userid]" height="16" width="16"> in front of $user[username].
mewgood
10-14-2002, 05:15 AM
..
when I trying to upload an avatar, it doesn't change in the index.php..
it is the same with the defult image..
Help please.
bejita
10-14-2002, 07:20 AM
finally you release it :) soon i'll install to my forum
NuclioN
10-14-2002, 08:38 AM
Also no update after uploading an image. Default stays visible.
Mystikal
10-14-2002, 04:40 PM
You have to refresh the page.
mewgood
10-14-2002, 06:59 PM
I did refresh.....
nth change...
Sketch
10-14-2002, 08:45 PM
looks like it will make the boards look cluttered. I'll pass. Nice idea though. :)
Mystikal
10-14-2002, 09:24 PM
Hm. I dunno then. Try going to /icon.php?userid=xxxx and see if its there.. or check phpMyAdmin to see if an entry is created with your userid.... It should work, works for me.
Harryli
10-14-2002, 10:52 PM
If i call icon.php?userid=xxx I see icons :D maybe we have the wrong icon.php?
Harryli
10-14-2002, 11:24 PM
sorry, was in /admin. under /Forum/icon.php I see my mini, but it also does not show up... only the default one
mewgood
10-14-2002, 11:58 PM
Try going to /icon.php?userid=xxxx and see if its there
what do you mean?
Mystikal
10-15-2002, 12:17 AM
Do you have phpMyAdmin or direct access to the database?
Check to make sure you actually have an entry.. maybe there's a bug but I didn't think so.
Velocd
10-15-2002, 12:34 AM
Two questions:
Can you implement a check where it insures the user does not upload an avatar larger than 16 by 16 pixels? Personally I don't want to add the width and height attributes to the image tag, incase somebody uses a larger or smaller icon. This should be possible, if you view the avatar-source code in member.php.
Second, is there any possible way to check if the gif image contains transparency? Probably not, but I'd like all my members to make the backgrounds of their icons transparent, or else the icon looks very tacky.
Velocd
10-15-2002, 02:32 AM
Well I figured my first request out pretty easily, you can forget the second since I know it's not possible.
---------------------------------------
For those wanting to check the icon size insuring it's not larger than 16x16 pixels, use this very easy to install add-on:
In member.php, find:
if( !$HTTP_POST_FILES['file1']['size'] || $HTTP_POST_FILES['file1']['size'] < 1 ) {
eval("standarderror(\"".gettemplate("error_invalid_image")."\");");
}
Below it add:
// check valid image
if ($imginfo=@getimagesize($HTTP_POST_FILES['file1']['tmp_name'])) {
if ($imginfo[0]>16 or $imginfo[1]>16) {
eval("standarderror(\"".gettemplate("error_invalid_image")."\");");
}
}
And there we go :p There is no need to set width and height attributes to the image tag. You can also check for it not to be lower than a certain amount, by modifying the if statement with a lesser than (<) clause.
mewgood
10-15-2002, 05:47 AM
yes I have phpmyadmin
what do I check?
mewgood
10-15-2002, 05:56 AM
Ok when I go to phpmyadmin after i click the edit button it turns an error..
first ss
mewgood
10-15-2002, 05:57 AM
here is the error
Ninth Dimension
10-15-2002, 08:17 AM
It's funny, but I was thinking on doing something like this myself a few weeks ago, but yours looks much better than anything I could have developed, so good job to you :)
Harryli
10-15-2002, 08:41 AM
I have the same error in phpmyadmin. Looks lige a CR behind 89a
Mystikal
10-15-2002, 04:46 PM
Originally posted by Velocd
Well I figured my first request out pretty easily, you can forget the second since I know it's not possible.
---------------------------------------
For those wanting to check the icon size insuring it's not larger than 16x16 pixels, use this very easy to install add-on:
In member.php, find:
if( !$HTTP_POST_FILES['file1']['size'] || $HTTP_POST_FILES['file1']['size'] < 1 ) {
eval("standarderror(\"".gettemplate("error_invalid_image")."\");");
}
Below it add:
// check valid image
if ($imginfo=@getimagesize($HTTP_POST_FILES['file1']['tmp_name'])) {
if ($imginfo[0]>16 or $imginfo[1]>16) {
eval("standarderror(\"".gettemplate("error_invalid_image")."\");");
}
}
And there we go :p There is no need to set width and height attributes to the image tag. You can also check for it not to be lower than a certain amount, by modifying the if statement with a lesser than (<) clause.
This mod will -not- function on certain servers. This is why I chose -not- to include this. The reason why the getimagesize() function does not work is uknown to most people, and when I tried it.. worked on 1 server, failed on the other (both had the graphic libraries installed that were required).
Mystikal
10-15-2002, 04:47 PM
Harry, dont' try and select something from the usericons when using data='whatever', it won't work unless you use the LIKE % command which I don't even think can be done on binary columns (it might be able to be, I forget.. too lazy to check).
Mystikal
10-15-2002, 04:48 PM
Oh crap.. mewgood, install a later version of phpMyAdmin.. could be your problem...
Mystikal
10-15-2002, 04:51 PM
<a href="http://www.wcgalaxy.com/vbb/icon.php?userid=1" target="_blank">http://www.wcgalaxy.com/vbb/icon.php?userid=1</a>
Shows up fine for me.. looks like its installed fine.
Harryli
10-15-2002, 07:40 PM
Yes, my mini is also showing up correct if I use ..icon.php?userid=1 but if I change the forumhome_loggedinuser template from
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">$username</a>$invisibleuser
to
<img src="icon.php?userid=$uservariable[userid]" height="16" width="16"><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">$username</a>$invisibleuser
only the default one shows up :(
Mystikal
10-15-2002, 09:28 PM
well that's because $uservariable isn't set to anything.
I should have specified...
$uservariable = whatever variable contains the user info.. it differs from page to page, and you can use the <IMG> stuff anywhere.
mewgood
10-15-2002, 11:23 PM
so
I need to install a later version of phpmyadmin
what version is yours?|
Mystikal
10-16-2002, 12:07 AM
I have 2.3.0-RC2. No you don't have to..
go to your who's online template and change icon.php?userid=$uservariable to userid=$userid. That should fix your problem.
You gotta make sure that your actually passing it a userid value ya know? Make sure and double check that with any other templtase its put in.
mewgood
10-17-2002, 12:16 AM
cool
it works now:D
Mystikal
10-17-2002, 06:49 PM
Yup :P Told ya that was all :=)
Mystikal
10-17-2002, 06:50 PM
BTW, mewgood, you should really alter the default image it doesn't look right with your vbulletin =\. I didn't make it transparent because it didn't need to be for my board.
Kars10
10-17-2002, 07:27 PM
Thankx Mystikal!!
Install was pretty easy...works like a charm!!
* Minifreunde klicks install!! :D
Kars10
10-17-2002, 07:28 PM
One Thing.... did you think about a store-integration with the avatar-hack?? This could be very cool!! ;)
NuclioN
10-17-2002, 09:01 PM
Hm, i can't get the mini avatar visible. I have it in the postbit next to the username and altough the default stays visible it will not update the new image. :(
Strange thing is that it's working correct in the loggedinuser for the who's online display. (???) Another code for the postbit?
mewgood
10-18-2002, 12:39 AM
how to change?
help please.
Mystikal
10-18-2002, 01:42 AM
how to change what? the default? uhm... just edit in a graphics program and reupload it? I'm not sure what you're asking.
Nuclion, for the postbit it would be icon.php?userid=$post[userid]
NuclioN
10-18-2002, 01:56 AM
Tnx Mystikal :)
mewgood
10-18-2002, 05:13 AM
I tried on photoshop
but it make it even worst.
Kars10
10-18-2002, 02:32 PM
Now i have the first Problem here!
When i try to change the Mini-avatar it don?t work.
I looked in the DB and see that the old avatar is still there after uploading a new one.
If i go to admin-panel and delete my avatar, than i can upload a other avatar. ... Any Idea?
Please excuse my bad english.. ;)
Mystikal
10-18-2002, 06:41 PM
When you update it, it should still be there. However, in order to see the update, you need to refresh the page and it should show up.
traekwon
10-27-2002, 05:22 AM
Originally posted by Mystikal
edit whatever templates you want and put that code in front of the username :)
i.e.,
if you want it in who's online, just edit the loggedinuser template in forumhome templates and put <img src="icon.php?userid=$uservariable[userid]" height="16" width="16"> in front of $user[username].
To get it to work I had to use:
<img src="icon.php?userid=getinfo&userid=$userid" height="16" width="16">
Thanks for the great hack!
Mystikal
10-27-2002, 11:35 AM
whoa... that's weird... what version of vbulletin are you using?
edwardandtubbs1
11-05-2002, 12:38 AM
what template do I change to add the avatar to next to the users names in the forums?
also I am new to this so can you tell me what part of code I am looking for.
edwardandtubbs1
11-05-2002, 01:18 AM
also I have this problem
my userid is 1 so anyone with a 1 at the start of they userid has my miniavatar. Also a member uploaded a miniavatar userid 27 and it jst shows the default avatar, just my database doesnt like the querys ERROR: Unclosed quote @ 94
STR: '
SQL: DELETE FROM `usericons` WHERE `userid` = '1' AND `filename` = 'indifference.gif' AND `data` = 'GIF89a2 LIMIT 1
Error
SQL-query :
DELETE FROM `usericons` WHERE `userid` = '1' AND `filename` = 'indifference.gif' AND `data` = 'GIF89a2 LIMIT 1
MySQL said:
You have an error in your SQL syntax near ''GIF89a2 LIMIT 1' at line 1
Can I have the querys it install please
Zombie
11-05-2002, 06:38 AM
For "Active Users" on the forum home you would use:
<img src="icon.php?userid=$userid" height="16" width="16">
For the "Who's Online" page you would use
<img src="icon.php?userid=$userinfo[userid]" height="16" width="16">
For your postbit you would use:
<img src="icon.php?userid=$post[userid]" height="16" width="16">
Hope that helps!
Nice little hack btw :)
auz1111
11-08-2002, 01:00 AM
Great hack! I got it to work after a little tinkering. Make sure to tell installers to change:
<img src="../icon.php?userid=$uservariable[userid]" height="16" width="16"align="absmiddle" border="0">
to:
<img src="../icon.php?userid=$userid[userid]" height="16" width="16"align="absmiddle" border="0">
I kept getting the default icon until changing this. Thanks!
Chris M
11-23-2002, 12:13 PM
Nice idea:)
Satan
ChrisLohman
01-02-2003, 07:12 PM
Wow, I must have completely missed something with this hack as I can't make it work at all on 2.2.9. The install instructions left me very unclear on what to do in some instances.
So...care to help me figure out how to make this work? :nervous:
I went through the miniavatar_install.txt several times and double checked everything.
First: I don't see any edit miniavatar link in my user control panel; nor do I understand in these install instructions where that's supposed to happen. Is that part of the member.php stuff? If so, can you be more specific as to where to add this to member.php? I tried adding at the end (just before the closing php tag) and in the middle, but it made no difference.
Second: I tried entering my control panal, edition options, and then in my address bar I changed the action to miniavatar. This pulled a miniavatar upload page. I created a 16x16 flat image in photoshop that is 1kb in size. When I attempt to upload it it say the following: "the mini-avatar you attempted to upload is too large. Please limit sizes to 2 KB. The image you tried to upload was 0 KB"
Third:
forumhome_loggedinuser
add forumhome_loggedinuser at the very beginnign, which by default should be in front of the persons name.
All I can say after reading that is, Huh? I assume I'm editing the forumhome_loggedinuser template: what does "add forumhome_loggedinuser" translate to code wise? Did you mean to say add the <img src="icon.php?userid=$post[userid]" width="16" height="16"> into the forumhome_loggedinuser template some where?
Fourth: I see people talking about SQL errors. Did I miss some step where something was updated in SQL? I don't see any instructions to alter SQL in any way.
Fifth: The default_mini_avatar.gif is not being used. It's not replacing the ../icon.php... code with the actual image source. You can see this on my forumhome at http://www.sonsofvalor.com/community
I've installed many, many hacks from vb.org and this one looks awesome; but I'm just stumped. I can't code in PhP (thus I can't read your code to figure out what is happening) but I've been able to handle every other hack I've come across. Obviously others have made it work so my brain must just be turned off today or something.
Obviously you don't have to help so anything would be greatly appreciated.
Mystikal
01-02-2003, 08:17 PM
I'm working on it.. there is something wrong with the code.. but it should be updated...
ChrisLohman
01-02-2003, 10:38 PM
oh, ok thx
Christy
01-04-2003, 07:46 PM
Thanks, nice job!
Savant
01-13-2003, 03:59 AM
I had the same issues as ChrisLohman, gave it my best, really cool sounding hack. If anyone rewrites the instructions for us simple minded folk, I'll give it another shot :)
Christy
01-13-2003, 04:24 AM
Ok, I redid the instructions so it should be a little better, I fixed some of the code stuff that was saying that the image you uploaded was too large even though it was actually smaller.
I take no credit for this, im just helping ppl to get this awesome hack installed. The instructions attached are exactly how and what I used to get mine working.
There are no SQL stuff to run as it has nothing to do with your DB.
Enjoy and let me know how it goes.
Mystikal
01-13-2003, 03:08 PM
I'm sorry that I haven't had time to work on this as of late guys.. been pretty busy with school =(
Dark Jim
01-22-2003, 10:14 PM
Cool hack but could you or someone else make this exactly like avatars (icon list, custom icon, custom icons in the database, post count requirement)?
Edit: Never mind, I made it myself including a store integration. Will post it here some time.
reismarktq2
06-16-2003, 05:56 PM
Love the idea for this hack, but I'd prefer it if someone could code a version of it where the user wouldn't add a custom mini-avatar but would rather select one from a list pre-determined and provided by the admins... can anyone do that?
X-Fan
09-21-2003, 08:45 AM
Is there any way to change this so that only admins can add mini-avatars?
FFXIOnline
12-21-2003, 02:22 PM
Is there any way to change this so that only admins can add mini-avatars?
Yes, all you have to do is avoid making the member.php modification entirely, and don't add in any new templates. You'd just simply upload images to the mini/ directory that have the name of the userid of the user who you want to have that icon.
Now I'm having some troubles with my installation...
I changed it around a bit because I would like to have instead of individual users having an icon, I'd like to have an entire GROUP have the icon. This would work inside the posts because of the $post array being available (and usergroupid being a value inside that array), however - on the front page, for the little "who's online" display, it doesn't work. Obviously the $post array isn't available there so I gave $bbuserinfo a shot - well, $bbuserinfo does have the value I'm looking for, but it only gets the usergroupid variable ONCE (in my case, it's always 6, which refers to Administrator). I'm wondering if anyone knows where either the usergroupid is stored for the current user being displayed in the who's online list (on the forum home page) or where the query is for it so I can add in another query to get the usergroupid for those users.
Thanks!
Yes, all you have to do is avoid making the member.php modification entirely, and don't add in any new templates. You'd just simply upload images to the mini/ directory that have the name of the userid of the user who you want to have that icon.
Now I'm having some troubles with my installation...
I changed it around a bit because I would like to have instead of individual users having an icon, I'd like to have an entire GROUP have the icon. This would work inside the posts because of the $post array being available (and usergroupid being a value inside that array), however - on the front page, for the little "who's online" display, it doesn't work. Obviously the $post array isn't available there so I gave $bbuserinfo a shot - well, $bbuserinfo does have the value I'm looking for, but it only gets the usergroupid variable ONCE (in my case, it's always 6, which refers to Administrator). I'm wondering if anyone knows where either the usergroupid is stored for the current user being displayed in the who's online list (on the forum home page) or where the query is for it so I can add in another query to get the usergroupid for those users.
Thanks!
whats say a 3.5 port?
DevinM
01-01-2007, 12:25 AM
perhaps for 3.6?
Shazz
01-01-2007, 12:27 AM
a beta released in 2002
And he hasen't been on since 03
Really no reason to up it =\
DevinM
01-01-2007, 11:58 PM
I know just useful for what I am trying to do.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.