Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Unique Avatars Details »»
Unique Avatars
Version: 1.1, by mfyvie mfyvie is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Category: Profile Enhancements - Version: 3.6.7 Rating:
Released: 06-01-2007 Last Update: 01-20-2008 Installs: 81
DB Changes Uses Plugins Auto-Templates
Re-useable Code Translations  
No support by the author.

*** Staff note: The author of this modification has passed away in a diving accident. 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 boards
The inspiration from this mod came from a similar one for vBulletin 3.0 by VBDev. 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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 06-03-2007, 01:15 PM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #23  
Old 06-03-2007, 01:54 PM
txspaderz's Avatar
txspaderz txspaderz is offline
 
Join Date: Apr 2006
Location: Houston
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this conflict at all with the default Avatar / No Avatar image?
Reply With Quote
  #24  
Old 06-03-2007, 01:58 PM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by txspaderz View Post
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.
Reply With Quote
  #25  
Old 06-03-2007, 02:15 PM
Andyucs's Avatar
Andyucs Andyucs is offline
 
Join Date: Nov 2006
Location: Okcular, Turkey
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mfyvie View Post
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
Reply With Quote
  #26  
Old 06-03-2007, 02:28 PM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andyucs View Post
phpMyAdmin - 2.10.0.2

PHP 4.3.11

no table prefixes

hope that helps
Mysql version?
Reply With Quote
  #27  
Old 06-03-2007, 02:39 PM
Andyucs's Avatar
Andyucs Andyucs is offline
 
Join Date: Nov 2006
Location: Okcular, Turkey
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry

MySQL client version: 4.1.21
Reply With Quote
  #28  
Old 06-05-2007, 05:29 AM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andyucs View Post
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.
Reply With Quote
  #29  
Old 06-05-2007, 11:38 AM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
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:
Quote:
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.
Reply With Quote
  #30  
Old 06-05-2007, 04:24 PM
JD45 JD45 is offline
 
Join Date: Feb 2006
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the hack and agreed, this should be a default feature in VB.
Reply With Quote
  #31  
Old 06-05-2007, 08:33 PM
JordanT JordanT is offline
 
Join Date: Mar 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the same problem as Andy:

Code:
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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09731 seconds
  • Memory Usage 2,313KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete