View Full Version : Profile Enhancements - Unique Avatars
mfyvie
06-01-2007, 10:00 PM
*** Staff note: The author of this modification has passed away in a diving accident (http://www.englishforum.ch/announcements/20529-mourning-loss-friend-leader-innovator-genuinely-nice-guy.html). We wish his family all strength in dealing with this traggic issue. ***
Have you ever been frustrated by the fact that many of your users choose the same avatars from your pre-defined avatars?
Now you can prevent users from selecting avatars that others are already using.
Features
No template or file edits, just a single .xml file to install
Phrase-based - update language strings as you like
Can either omit the used avatars from the display, or show them as unavailable
Can optionally display a count of how many times each avatar is used
All options configurable via the admin control panel
Install routine adds an additional index to ensure database performance not impacted on larger boardsThe inspiration from this mod came from a similar one (https://vborg.vbsupport.ru/showthread.php?t=63079) for vBulletin 3.0 by VBDev (https://vborg.vbsupport.ru/member.php?u=47177). Even though there is almost no code in common between these mods I've sought and obtained his permission to release this.
Installation (30 seconds)
Download the attached .xml file
Go into your admin control panel -> Plugins & Products -> Manage Products -> Add/Import Product.
Press the browse button to locate the .xml file you just downloaded click OK.
Ensure that "Allow Overwrite" is set to "Yes" and press "Import"
Note: requires MySQL version 4.1 or higher.Configuration
VBulletin Options -> Unique Avatar
Version History
1.0 - Initial release (02.06.2007)
1.1 - 1 minor bugfix (20.01.2008)
See screenshots for further details.
That is a great idea. I like it!
If two people on the board already have the same avatar and you install this, what effect will it have on those two people??
I like this idea....nice of ya to rls it.
mfyvie
06-01-2007, 11:32 PM
No effect, but if one of them selects a different avatar, then they won't be able to reselect it (since at least one other person is using it).
If you configure the mod to show the count of how many people are using a given avatar you can get an overview of which avatars are used.
It would be possible to craft some queries to show you which users were using a duplicate avatar (count of 2 or higher), and theoretically it would be possible to make a query which removed the avatar from these users (forcing them to choose again, and therefore no more duplicates possible from that point on).
Nice idea.
Thanks for the share,
Mat
gforce75
06-02-2007, 12:14 AM
Not a bad idea. Once I get my forum going with some more advatars, I'll give this hack a crack.
Great idea .. thanks mfyvie
Clicked install.
FreshFroot
06-02-2007, 01:06 AM
i love the idea, great one mate!
rjmjr69
06-02-2007, 02:35 AM
Nice thank you installed
tehPARADOX
06-02-2007, 03:16 AM
Very nice! Can't believe this isn't a default feature.
SuperTaz
06-02-2007, 05:33 AM
very nice...installed
VBDev
06-02-2007, 05:54 AM
Nice buddy :)
projectego
06-02-2007, 09:39 AM
Awesome idea, mfyvie! Great work. :)
Dr. Bantham
06-02-2007, 10:45 AM
Yes! I have been asking for this of late, here and within the vBulletin forums. Many thanks!
mfyvie
06-02-2007, 12:31 PM
Here is a query that will allow you to quickly identify existing users on your board that have the same avatars as others.
If you don't know how to run an SQL query, in your admincp go to Maintenance -> Execute SQL Query, then copy and paste the query below:
/*
This query will return a list of all of those users on your board who share an avatar with
at least one other person. This will allow you to contact them, edit them, or do whatever
you like with the information.
If this query doesn't work, you may be using prefixes in front of your table names. In this
case you'll have to edit the table names in the FROM line.
For example if your table prefix was vb then the FROM line would look like this:
FROM vbavatar av1,vbuser usr1, vbuser usr2
If you don't use table prefixes (most people), just do nothing and run this query as is
*/
SELECT distinct usr1.userid ,usr1.username, av1.title, av1.avatarid, av1.imagecategoryid
FROM avatar av1, user usr1, user usr2
WHERE av1.avatarid=usr1.avatarid
AND av1.avatarid=usr2.avatarid
AND usr1.userid <> usr2.userid
and usr1.avatarid>0
and usr2.avatarid>0
order by 4 asc
It can sometimes be interesting to see just how much you actually needed this mod :)
Note: I found that when I ran this inside the admincp it only gave me the number of rows returned. If you run it in another mysql tool you'll get the full results, including the usernames affected, etc.
Barakat
06-02-2007, 09:10 PM
What if u have a thousand member ,! Installed indeed .
CCWBumper
06-02-2007, 10:16 PM
Installing now!
PoetJA-1975
06-03-2007, 08:38 AM
Ha! This is very nice - I was looking for something similar.
This will do just fine - Thanx very much for the sharing!
Jacquii.
william99
06-03-2007, 08:40 AM
Installed, awesome idea, I have been waiting for something like this for a long time :-)
Andyucs
06-03-2007, 01:05 PM
i get this error when i enable it
in my usercp change avata
Database error in vBulletin 3.6.7:
Invalid SQL:
SELECT avatar.avatarid, avatar.title, avatar.minimumposts, avatar.avatarpath, avatar.imagecategoryid, avatar.displayorder, count(1)
FROM user , avatar
WHERE user.avatarid = avatar.avatarid
AND avatar.imagecategoryid = 3
AND minimumposts <= 1167
GROUP by avatar.avatarid
UNION
SELECT avatarid, title, minimumposts, avatarpath, imagecategoryid, displayorder, 0
FROM avatar
WHERE avatarid not in (select distinct avatarid from user)
AND imagecategoryid = 3
AND minimumposts <= 1167
ORDER by displayorder, title
LIMIT 0,10;
MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select distinct avatarid from user)
AND imagecateg
Error Number : 1064
Date : Sunday, June 3rd 2007 @ 02:53:25 PM
Script : http://www.ucsclan.co.uk/forum/profile.php?do=editavatar
Referrer : http://www.ucsclan.co.uk/forum/profile.php?do=editoptions
IP Address : 83.100.253.11
Username : FlatLiner
Classname : vb_database
mfyvie
06-03-2007, 01:15 PM
Hi Andy, I can't think why that is happening. The query is correct. Can you confirm that you aren't using any table prefixes (in other words, the tables in your database are actually called avatar and user). Also please tell us the version of php and mysql that you are using. You are the first to report any problems with this, so I'm interested to know if there is something different about your setup.
Mark
txspaderz
06-03-2007, 01:54 PM
Does this conflict at all with the default Avatar / No Avatar image?
mfyvie
06-03-2007, 01:58 PM
Does this conflict at all with the default Avatar / No Avatar image? I don't know - try it and see. It's fairly specific in what it does, so chances are there won't be a conflict. Please update this thread with the result.
Andyucs
06-03-2007, 02:15 PM
Hi Andy, I can't think why that is happening. The query is correct. Can you confirm that you aren't using any table prefixes (in other words, the tables in your database are actually called avatar and user). Also please tell us the version of php and mysql that you are using. You are the first to report any problems with this, so I'm interested to know if there is something different about your setup.
Mark
phpMyAdmin - 2.10.0.2
PHP 4.3.11
no table prefixes
hope that helps
mfyvie
06-03-2007, 02:28 PM
phpMyAdmin - 2.10.0.2
PHP 4.3.11
no table prefixes
hope that helps
Mysql version?
Andyucs
06-03-2007, 02:39 PM
sorry
MySQL client version: 4.1.21
mfyvie
06-05-2007, 05:29 AM
sorry
MySQL client version: 4.1.21
Hi Andy, I sent you a PM a couple of days ago offering to help. If I don't hear back from you via this PM then I'll assume you've resolved this issue.
mfyvie
06-05-2007, 11:38 AM
Would you like something that will automatically REMOVE the avatar for those users who already have the same avatar as others?
The following two queries will do this. The first one will report how many duplicates you have, the second will delete the avatars.
WARNING: The second query will actually change your database. I've tested it on my system and am confident that it works. However, if you run this query on a live system and it breaks it, and you didn't back it up - don't come running to me about it!
First query:
select avatarid,count(1) from user
where avatarid>0
group by avatarid
having count(1) > 1
order by 2 desc
This will simply report how many cases of duplication you have. Once you can see the extent of the problem you can run this:
Second query:
update user u1, user u2
set u1.avatarid=0
where u1.avatarid=u2.avatarid
and u1.userid!=u2.userid
and u1.userid>u2.userid
and u1.avatarid>0
and u2.avatarid>0
You can then re-run the first query to confirm that it worked - if it did, you'll get 0 rows returned.
Note that these queries, as well as the one I posted a few days back will work even if you don't have this mod installed (might be a bit slow due to lack of an extra index though).
If there are two users using the same avatar it won't delete both of their avatars - the lowest userID (usually the oldest member) gets to keep theirs, only the "new" guy will lose theirs.
Once you've used this to eliminate all the duplicates you can be sure that no more will happen when you are running this mod.
The only side effect is the users might wonder where their avatar went...
By the way - in case anyone thinks I am any good at making or changing these queries - I'm not. I gave it to some database gurus to do. They had to scratch their heads a bit before coming up with the final solution. They said it wasn't so simple to figure out.
Thanks for the hack and agreed, this should be a default feature in VB.
JordanT
06-05-2007, 08:33 PM
I have the same problem as Andy:
Database error in vBulletin 3.6.6:
Invalid SQL:
SELECT avatar.avatarid, avatar.title, avatar.minimumposts, avatar.avatarpath, avatar.imagecategoryid, avatar.displayorder, count(1)
FROM vb_user , vb_avatar
WHERE user.avatarid = avatar.avatarid
AND avatar.imagecategoryid = 4
AND minimumposts <= 64
GROUP by avatar.avatarid
UNION
SELECT avatarid, title, minimumposts, avatarpath, imagecategoryid, displayorder, 0
FROM vb_avatar
WHERE avatarid not in (select distinct avatarid from user)
AND imagecategoryid = 4
AND minimumposts <= 64
ORDER by displayorder, title
LIMIT 0,10;
MySQL Error : Table 'host4_vb.user' doesn't exist
Error Number : 1146
Date : Tuesday, June 5th 2007 @ 05:32:23 PM
Script : http://www.host4posts.com/profile.php?do=editavatar
Referrer : http://www.host4posts.com/usercp.php
IP Address : 66.170.53.178
Username : Jordan
Classname : vB_Database
:(
mfyvie
06-06-2007, 07:23 AM
JordanT - your issue is not the same as Andy's - the error message is totally different.
It looks like you are the first guy to use table prefixes, and I see a small mistake in the query, I'll work on a fix soon, but am still looking at Andy's issue. I'll update this thread with more info soon.
ABMAC
06-06-2007, 08:03 AM
I'm also having trouble getting this mod to work. I would appreciate any help you can offer.
PHP version 4.4.7
MySQL version 4.0.23
Database error in vBulletin 3.6.7:
Invalid SQL:
SELECT avatar.avatarid, avatar.title, avatar.minimumposts, avatar.avatarpath, avatar.imagecategoryid, avatar.displayorder, count(1)
FROM user , avatar
WHERE user.avatarid = avatar.avatarid
AND avatar.imagecategoryid = 3
AND minimumposts <= 8681
GROUP by avatar.avatarid
UNION
SELECT avatarid, title, minimumposts, avatarpath, imagecategoryid, displayorder, 0
FROM avatar
WHERE avatarid not in (select distinct avatarid from user)
AND imagecategoryid = 3
AND minimumposts <= 8681
ORDER by displayorder, title
LIMIT 50,10;
MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select distinct avatarid from user)
AND imagecateg
Error Number : 1064
Date : Tuesday, June 5th 2007 @ 04:04:37 PM
Script : http://megomuseum.com/community/profile.php?do=editavatar&categoryid=3&page=6
Referrer : http://megomuseum.com/community/profile.php?do=editavatar&categoryid=3&page=5
IP Address : ***.***.***.***
Username : ABMAC
Classname : vb_database
mfyvie
06-06-2007, 08:17 AM
Ok, so far we've had two people with error 1064 - reporting a syntax error. This is very strange, since the syntax seems to be correct. Please run a repair / optimise on your database to see if it corrects the issue. To be honest this is a stab in the dark, but I can't think what else would cause this.
The report of error 1146 is a bug which affects people with table prefixes. I've made some changes, but waiting for the guy who reported it to get back to me so I can get him to test it.
ABMAC - please report back after running a repair/optimise
mfyvie
06-06-2007, 09:12 AM
ABMAC - apparently subqueries (which this one is using) are only available in mysql 4.1 and up. You are running 4.0 - would you consider upgrading? Andy is running 4.1 and having the same issue, but the cause may be different.
mfyvie
06-06-2007, 09:23 AM
Ok, I've updated the XML file - it was not handling situations where people are using table prefixes. This will resolve JordanT's issue, but not the issue seen by ABMAC or Andy.
Andyucs
06-06-2007, 09:35 AM
just like to say thanks for your work trying to resole this matter
Andyucs
06-06-2007, 10:09 AM
ok installed on another site and get the same
as soon as i enable Force unique avatars? to yes i get the error
runs fine as in the screen shot
ABMAC
06-06-2007, 03:20 PM
Thanks, mfyvie, I'll see about getting MySQL 4.1 installed. Should I still run repair/optimise on my database? My board is fairly new and shouldn't have any problems yet.
mfyvie
06-06-2007, 03:29 PM
You don't have to, but it probably wouldn't hurt. I wasn't able to figure out Andy's issue, but he has no control over his mysql settings so we were limited in what we could do. Your issue should be fixed by an upgrade though.
I'm going to look at re-writing the query so that people with < mysql 4.1 can also use this mod, but it's not simple.
JordanT
06-06-2007, 08:17 PM
Thanks for fixing my problem. Much appreciated!
mfyvie
06-06-2007, 10:17 PM
Looks like Andy wasn't running MySQL 4.1.21 (that was his client), his server version was 4.0.27.
So at the moment the two outstanding issues are now both linked to 4.0 - which doesn't support the query used in this mod.
I had a friend of mine build a completely different query. However, the new one doesn't work on mysql 4.0 either.
I've therefore updated the xml installer so that it requires mysql 4.1. Sorry to all those 4.0 users out there (I guess there are still a small number), but unless you upgrade to at least 4.1 you won't be able to use this mod.
The minimum version requirement should cut down on the number of new cases reporting this error, since they won't be able to install it.
bornoffire
06-08-2007, 02:04 AM
I get this:
The following dependencies were not met:
This product is not compatible with version 4.0.27-max-log of MySQL. (Compatible starting with 4.1)
Is there a way to upgrade sql without messing things up? I really don't know, never upgraded
mfyvie
06-08-2007, 11:05 AM
Is there a way to upgrade sql without messing things up? I really don't know, never upgraded
Excellent, then that little version check has saved another SQL syntax error being posted in here :-)
I'm afraid I can't give you any advice on upgrading your version of mysql - I've never done it myself either so I don't know what the issues are. I'd suggest trying to locate another thread or using google to try and figure that out.
Triky
06-08-2007, 04:50 PM
Installed.
thenewuser
06-10-2007, 09:05 PM
Hey there, thanks for making this neat mod.
I'm having trouble. I have the settings set to:
Force unique avatars? no
Display number of times used? yes
Hide used avatars? no
however when I used an avatar it still hides it and doesn't say "used x times"
I would love some help! :)
thenewuser
06-10-2007, 09:19 PM
maybe it was because I was an admin? I had a normal user use one and while it did NOT disappear it also didn't say "Used 1 time" or anything.
:(
mfyvie
06-11-2007, 07:07 AM
Force unique avatars? no
You won't have much luck if you set this setting to "no" because then it will disable the mod. The whole point of this mod is to force unique avatars, so by setting it to no you can't be surprised if nothing happens!
Mark
ABMAC
06-11-2007, 03:12 PM
Upgraded MySQL and the mod is working perfectly! Thanks again, mfyvie.
Andyucs
07-13-2007, 04:13 PM
moved hosts and all is working fine thanks
radarhunter
07-15-2007, 01:22 PM
it`s showing me this any idea how to solve this problem. Other than upgrading my SQL version.......
mfyvie
07-15-2007, 01:25 PM
it`s showing me this any idea how to solve this problem. Other than upgrading my SQL version.......
I specifically made it display that message to STOP people with less than 4.1 using this mod. Why? Because it simply won't work - it uses commands which are only present in 4.1. That warning message is there to stop people from installing it then coming to complain when it won't work.
SNATCH3R
01-19-2008, 10:25 AM
Thanks for this gr8 hack.....
DITTO!!!
And thank you SO much for taking the time to help me with my techy issues. I've waited for this had for so long!
I'm now I'm on my way to Paypal to show my appreciation :up:
mfyvie
01-21-2008, 07:49 AM
DITTO!!!
And thank you SO much for taking the time to help me with my techy issues. I've waited for this had for so long!
I'm now I'm on my way to Paypal to show my appreciation :up:
gsk8 seems to have removed her original message outlining the bug she found, but I just wanted to let everyone know that I addressed that bug and incremented the version to 1.1 this morning. The only change is that one of the plugins has moved hook locations.
The original bug report (now not visible, presumed deleted) was that when a user had selected a pre-defined avatar it didn't appear as their current avatar when the edit avatar page of the usercp was displayed.
If you are running 1.0 and are not bothered by this (it seems nobody else noticed) then there's no immediate or urgent need to upgrade.
legionofangels
01-21-2008, 01:01 PM
I have a question here. I like the hacks idea, in forcing users to choose different avatars, so that it's easy to visually recognize people. But have we ever tested the theory of what happens if all avatars in the default system are selected?
Do new users have no choice then of a preset system avatar, or does the system cycle and now allow no more than 2 users to have the same avatar, once all of them have been chosen?
(( I mean, I just completed our websites avatars, and I'm not doing anymore...ever. lolz, so I will not keep readding to support this hack if that is required in this scenario ))
lemme know, thanks,
LoA
mfyvie
01-21-2008, 01:51 PM
LOA - Each time an avatar is used then it will be greyed out, therefore impossible to select. The user would then have to go to the next page or avatars, or select another category.
Of course, there's nothing stopping them uploading their own.
On my own system the first page of avatars is completely allocated - users obviously tend to choose one from the first page they see.
legionofangels
01-21-2008, 04:38 PM
I hear what you're saying and I really like your system. Unfortunately I can't use it. See, I hear what you're saying. When all the avatars are used up, there is none to choose from. But still, I actually don't allow custom upload until a post amount, and therefore after they are all used, new users will have to wait to fill the post amount prior to having any avatar at all.
mfyvie
01-21-2008, 04:53 PM
I hear what you're saying and I really like your system. Unfortunately I can't use it. See, I hear what you're saying. When all the avatars are used up, there is none to choose from. But still, I actually don't allow custom upload until a post amount, and therefore after they are all used, new users will have to wait to fill the post amount prior to having any avatar at all.
In that case your requirements are absolutely opposite to what this mod does. If you want your avatars to never run out, then you cannot demand of your users that they all be unique.
You could also just give them a larger library to choose from...
legionofangels
01-21-2008, 05:51 PM
In that case your requirements are absolutely opposite to what this mod does. If you want your avatars to never run out, then you cannot demand of your users that they all be unique.
You could also just give them a larger library to choose from...
I don't know if I'd say they're opposite, but they are incompatible is a better term.
If a function of the hack allowed avatars to be used again, after ALL had been used once that would solve the problem and allow for enough diversity that they would never run out. Meaning that All used once, then it cycles again, once Avatar 1 has been chosen twice, it again is removed from the list until all the other avatars you have are used a second time, etc., etc.
I mean the value of the hack is there, no doubt about it. However admins will have to make a trade off here. They either have to keep adding more avatars to help create a neverending supply, OR they have to always allow custom avatars from the get go without post requirement.
I made 777 custom avatars for my board, that is a ton and could last for years with this hack. However, since I use a post count point before custom av's allowed, it would eventually run out of avatars. After 777 even if I didn't have the post count rule, it "could" eventually still run out or I'd have to delete inactive users to keep avatars available. In short, I like your mod, but I don't want to make anymore avatars after months of doing it. lol
athlon64bit
05-07-2008, 01:22 AM
This should be released and posted for vb3.7 users to find and use.:D It is a top mod!
karthik123
05-07-2008, 03:15 AM
thats an awesome idea especially them being unique
Marco van Herwaarden
05-15-2008, 10:17 AM
*** Staff note: The author of this modification has passed away in a diving accident (http://www.englishforum.ch/announcements/20529-mourning-loss-friend-leader-innovator-genuinely-nice-guy.html). We wish his family all strength in dealing with this traggic issue. ***
PoetJA-1975
05-15-2008, 04:55 PM
OMG! Wow - Tough situation and I offer my condolensces as well.
Jacquii.
Boofo
05-15-2008, 05:12 PM
I use this hack and all I can say is we lost an excellent coder and good friend.
I've just granted permission to another coder (https://vborg.vbsupport.ru/member.php?u=211414) who has agreed to take over the code from Mark's mods (https://vborg.vbsupport.ru/member.php?u=190317) (like this one) and keep them up to date and free to all, which should be good news for all of you who use his mods and allow his legacy to continue.
Robert Fyvie
Yalan
09-25-2008, 11:12 PM
very very thanks!
i'm finding it!
Edit:
upload it but i didn't run.
vb options -> unique avatars -> Force unique avatars? YES -> Display number of times used? YES
isn't it?
User cp -> edit avatar ...
the same menu again:S
help help ...
applebeef
01-18-2010, 08:13 PM
Anyone know if I can use this for 3.8?
athlon64bit
02-18-2010, 04:56 PM
Has anyone tested this in vb4?
acast
01-17-2012, 09:55 AM
Has anyone tested this in vb4?
Me. It doesnt work :(
I posted above that I gave another coder permission to work on my late brother's mods. Sadly, I notice that after permission was given, this person has done nothing about it. Good intentions are cheap. If anyone would like to take over this (and mfyvie's other mods) please PM me. I would like to see his work being used and not abandoned. Most of his work was good and should be well written enough for someone to upgrade without too much effort.
cykelmyggen
05-03-2014, 03:08 PM
Does anyone know if there's a similar mod for vB 4?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.