PDA

View Full Version : Unique avatar


VBDev
03-27-2004, 10:00 PM
With this hack, you will be able to set if you want users to have a unique avatar or not. In fact, if you select yes in 'User Picture Options' in general options of vBulletin, if a user has selected an avatar, an other user will not be able to select the same.

This avatar will still appear in the list, but you will not be able to select it, and instead of its title, you'll see TAKEN to show it's already used.

Support for this hack : http://www.vbulletindev.net/forums/showthread.php?t=107

Hack description : http://www.vbulletindev.net/forums/hacks_root.php?do=aff_hack&hackid=31

Really easy to install : 5 min

Boofo
03-28-2004, 06:44 PM
Will this handle avatars already picked or only after the hack is installed?

ryancooper
03-28-2004, 08:06 PM
Strange I do not have a avatar option here -> http://www.yourforum.com/admincp/options.php?dogroup=

VBDev
03-28-2004, 09:29 PM
@ryan : ............. the url is :
http://www.yourforum.com/admincp/options.php?dogroup=userpix&do=options

and u have to replace yourforum by your site url ...


@boofo : Yes, it will handle avatars already picked

Diva
03-28-2004, 09:34 PM
Hi VBDEV. I think he means "setting: group: avatars".

I dont see that option.

lasto
03-28-2004, 09:37 PM
looks good

also vbdev u releasing some good hacks for vb3 :)

ryancooper
03-28-2004, 09:38 PM
@ryan : ............. the url is :
http://www.yourforum.com/admincp/options.php?dogroup=userpix&do=options

and u have to replace yourforum by your site url ...


@boofo : Yes, it will handle avatars already picked
LOL i know that! What i mean is i don't have the option in my Admin CP! LOL

VBDev
03-28-2004, 09:41 PM
Ok, it's not Setting group : avatars but User Picture Options

I used the french version to code it and so the setting group was replaced with avatars, it changed nothing for you, just select this setting group

I update the txt

Diva
03-28-2004, 09:45 PM
Oh, okay. :) One more thing: How do I get to the phrase manager?

VBDev
03-28-2004, 09:50 PM
In your admincp > languages and phrases > phrases manager ;)

lasto
03-28-2004, 09:57 PM
I done it all (quite easy to do) and even have a few avatars already in the list but when i select one i get this

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully

so it wont let me pick any avatars that are already there

/me will sit on sidelines see if anyone else gets same prob

Diva
03-28-2004, 10:04 PM
I have the same problem.

Also, is there an option so that avatars that are chosen do not show on the list?

lasto
03-28-2004, 10:06 PM
I have the same problem.

Also, is there an option so that avatars that are chosen do not show on the list?

phew glad someone else got it means im not so thick afterall :)

ryancooper
03-28-2004, 10:08 PM
I done it all (quite easy to do) and even have a few avatars already in the list but when i select one i get this

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully

so it wont let me pick any avatars that are already there

* lasto will sit on sidelines see if anyone else gets same prob
Same Error. . .

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully.

VBDev
03-28-2004, 10:08 PM
@lasto : someone has the same problem on our site, I don't know why, there shouldn't be problem updating avatars, I only touch to the SELECT query, can you please send me your profile.php file by email to grog6@tele2.fr so that I verify it ?!

VBDev
03-28-2004, 10:34 PM
Which vb version are you running ?

Diva is 3.0.0 RC4 ! and others ?

Diva
03-28-2004, 10:40 PM
No, I'm running VB3Gold. It's on my test site right now. Why do you think I'm runing RC4?

VBDev
03-28-2004, 10:45 PM
I have just installed it on an other forum and I got the same error, I remove the hack, try to find the problem and put it back when it will be ok :-/

lasto
03-28-2004, 11:09 PM
[QUOTE=VBDevI have just installed it on an other forum and I got the same error, I remove the hack, try to find the problem and put it back when it will be ok :-/
![/QUOTE]

ok nps hope u get it sorted m8

VBDev
03-28-2004, 11:18 PM
For people who have already installed it, just do modifications in profile.php again with new modifications, it should be ok now :)

lasto
03-28-2004, 11:24 PM
works i get no errors now :)
cheers

All works fine now :)

Diva
03-28-2004, 11:43 PM
It works! Thank you, VBDEV.

I was wondering if you knew how to make it so that selected pictures just didnt show up. It had it on the older option and made load time easier if people just looked through the ones they could select.

VBDev
03-29-2004, 12:04 AM
To not display the avatar, replace your modifyavatarbit template with this one :

<if condition="$disabled=="disabled"">
<td class="smallfont" align="$stylevar[center]" valign="middle">
<label for="rb_avatarid_$avatar[avatarid]">
<b>$vbphrase[avatar_taken]</b>
</label>
</td>

<else />


<td class="smallfont" align="$stylevar[left]">
<label for="rb_avatarid_$avatar[avatarid]">
<img src="$avatar[avatarpath]" alt="$avatar[title]" border="0" /><br />
<input type="radio" name="avatarid" value="$avatar[avatarid]" id="rb_avatarid_$avatar[avatarid]" $avatarchecked[$avatarid] $disabled/>$avatar[title]

</label>
</td>
</if>

Diva
03-29-2004, 12:16 AM
Sorry to be a pain... I meant that if someone selected it there wouldnt be a slot there.

Example:


Before someone selects AVATAR 2;

AVATAR 1 | AVATAR 2 | AVATAR 3

Afterwards:

AVATAR 1 | AVATAR 3

If it's too hard then this will be just fine.

ryancooper
03-29-2004, 12:22 AM
Strange,
I get no errors but I can also select any avatar even if another member has it selected. And I do have use unique avatars selected in the options.

NIX THAT. Got it! Thanks a million!!

VBDev
03-29-2004, 12:22 AM
It should be really too hard to do this Diva, I began but stoped rapidly

Indeed, to do this you have to rebuild $perpage before the SELECT query and the time you would win to not display the pic , you lost it with the code which as to be modified ;)

The template's mod I gave you, improve your page's load by not displaying picture and it's no longer compared to sthg if the code had to be modifed to not display the template at all

Hurm, what I'm saying is quite confused, but it's really late (4h30), I'm quite tired and enough of vB for 6 mounths ^^

Diva
03-29-2004, 12:24 AM
No worries, it's perfect. *hugs* I appreciate all of your help. :)

aloha
03-29-2004, 02:20 PM
Can you make it so that it doesn't allow you to input anything at all instead of displaying 'taken' right next to an option. Some people are really airheaded and that will confuse them. :) At least on my site. lol At times they don't know how to get to the message boards... when it says "Forums" ... So I'm guessing this might cause a little confusion on mine. Just wondering... ;-)

Eternal2u
04-25-2004, 07:20 AM
Very nice..

I remember having this same thing on my phpBB board b4 i moved over to vB, nice to see you guyz got this one :D

**Click install

DenzoForums
04-26-2004, 03:31 PM
when in usercp, edit avars
http://www.denzoforums.com/forum/profile.php?do=editavatar

i get this error..
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /homepages/28/d98287039/htdocs/denzo/forum/profile.php on line 1552

P.S. I had a problem with this..
In your browser, go to :

http://www.yourforum.com/admincp/options.php?dogroup=userpix&do=options


Click Add setting and insert these values :

*****************************

varname : avatar_unique
setting group : User Picture Options
title : Unique avatar ?
description : With this option you can choose if you want each member to have a unique avatar or not
Option code : yesno
Default : 0
Display order : 50
vbulletin default : yes

I don;t have anything that saus add setting..

Thanks
Dave
P.S. using 3.0.1

DenzoForums
04-26-2004, 11:49 PM
when in usercp, edit avars
http://www.denzoforums.com/forum/profile.php?do=editavatar

i get this error..
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /homepages/28/d98287039/htdocs/denzo/forum/profile.php on line 1552

P.S. I had a problem with this..


I don;t have anything that saus add setting..

Thanks
Dave
P.S. using 3.0.1
Anyone? I need some help with this..

Thanks
Dave

Diva
04-26-2004, 11:55 PM
Hi Dave... Have you tried reinstalling?

Roxie
06-01-2004, 03:24 AM
Hack works great...thanks!

turbidblue
07-11-2004, 04:15 AM
thanks for the hack, i was having some trouble with avatars showing up twice both with taken underneath them, so instead of trying to fix that, i just added the "show no avatar" with just the word "taken" instead

i am so lazy..

*clicks install

gsk8
07-13-2004, 04:08 PM
Is this 3.0.3 compatible? Having problems with this step:

In your browser, go to :

http://www.yourforum.com/admincp/options.php?dogroup=userpix&do=options


Click Add setting and insert these values :

I can't seem to find the "Add Setting".....

gsk8
07-13-2004, 04:14 PM
Let me add that I did use my own domain addy: Here is the what I got:

http://www.goldenskate.com/avatar.jpg

nexialys
07-13-2004, 04:16 PM
@gsk8 .. you forgot to add the $debug =1; where it is written to do so...

gsk8
07-13-2004, 04:25 PM
You mean in the config.php? I did. Note the upper-left corner of the image.

gsk8
07-13-2004, 06:22 PM
Still unable to this step:

Click Add setting and insert these values :

*****************************

varname : avatar_unique
setting group : User Picture Options
title : Unique avatar ?
description : With this option you can choose if you want each member to have a unique avatar or not
Option code : yesno
Default : 0
Display order : 50
vbulletin default : yes

When I tye in the URL, I don't get an option to "Add Settings". This is what I get:
http://www.goldenskate.com/avatar.jpg

Floris
07-17-2004, 12:55 AM
Still unable to this step:

Click Add setting and insert these values :

*****************************

varname : avatar_unique
setting group : User Picture Options
title : Unique avatar ?
description : With this option you can choose if you want each member to have a unique avatar or not
Option code : yesno
Default : 0
Display order : 50
vbulletin default : yes

When I tye in the URL, I don't get an option to "Add Settings". This is what I get:
http://www.goldenskate.com/avatar.jpg
I will look into this right now on your server goldenskate :)

gsk8
07-18-2004, 12:10 PM
Thanks Floris! Runs great. Will email you for further info.

Sadie Frost
07-20-2004, 07:38 PM
Can someone tell me how this handles avatars already being used by more than one person? Does it let them both keep it, does the person who chose it first keep it etc?

Thanks :)

Also, is there a way to deal with lurkers who have chosen an avatar but haven't been around ina while?

turbidblue
07-20-2004, 07:47 PM
when i first installed this hack, i had trouble with avatars showing up twice or maybe three times in the "edit avatar" field. It was because more than one member had chosen the same one, now that it has to be unique, they all show up only once :)

inziga
08-01-2004, 07:58 AM
Works great!

Just one thing...Scince it would be too hard to make the avatar dissaper, would it be possible to (if each category has multiple pages) make the "taken" avatars move to the last pages of that category? :)

Gutspiller
11-02-2004, 04:58 AM
I didn't know we could attach boobies into our threads.

Probably not the best image to display the hacks ability VBDev. :)

Scerina
11-19-2004, 02:58 AM
Will this handle avatars already picked or only after the hack is installed?
Can someone please install this hack for me please??? I really like it and would love to have it on my forum. If anyone can help me out here...please email me at: Pandora@Sweet-November.Net

cinq
12-09-2004, 12:51 AM
Are the problems resolved for this hack ? It would be a great addition ( and should be default in vb ) if so.

Also how does it handled already chosen avatars which aren't unique ? i.e 2 or more members already using the same avatar ?

Dot50Cal
05-03-2006, 01:16 PM
Bump from the grave, Im very interested in this but it doesnt work for 3.5. Can anyone help?

kall
05-03-2006, 07:11 PM
It does. but you will need to make it into a plugin yourself. :)

Diva
10-20-2006, 08:55 PM
It does. but you will need to make it into a plugin yourself. :)

I only wish I had the skill to do so! Is anyone willing to port this over? I love the hack and think it would be great as a default on VB. *crosses fingers and hopes for a response*

mfyvie
03-09-2007, 04:36 PM
I had a look at this, but it doesn't look like it is possible to do this as a plugin. I changed it around a little bit and got it working on 3.65. Then I noticed that there were some problems with it - namely that if you had 100 avatars in a category and 50 were already in use then it would select 150 records, but only display 100, repeating the same avatars over and over.

So I made some adjustments to the version I was making so that instead of being displayed with "taken" the used avatars are simply omitted from the list entirely (incorporating the suggestions made by others earlier in this thread).

I also removed the ability to turn this hack on or off on a per user basis - it simply applies to all users on the system now.

Even though this is a thread about a mod which only worked on 3.0, I've attached the version that works on 3.6 to this post. Since I'm not the author of this mod I can't really provide any support for it - sorry.

mfyvie
05-05-2007, 01:39 PM
If you've used the original version of this mod, or you've used my modified version prior to this date you should be aware that there is a performance issue. If the query is used on a busy or large system it can tie up the mysql process on the server, affecting all other queries. Therefore you need to ensure that you execute this sql query on your database:

ALTER TABLE `user` ADD INDEX(`avatarid`)

By adding this index it cut the query time on my server from over 15 seconds to 0.0065 seconds.

I've updated the attached file in the previous post to incorporate this change.

If you are using this mod and you do not add the index as described above you could affect not only the performance of your own forum, but also other applications / sites which run on the same server.

mfyvie
06-01-2007, 11:28 PM
If you have been using the modified version of the original mod I made above (1.1), you should know that I've made a full port of this to 3.6.x and released it as a version which uses the plug-in system.

If you'd like to use this new version then you should first remove any changes made manually to files or templates before installing the new mod.

You can find the newly released mod here:

https://vborg.vbsupport.ru/showthread.php?t=148711