Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Random Rotating Avatar for specific users Details »»
Random Rotating Avatar for specific users
Version: 1.00, by Michael Morris Michael Morris is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Version: 3.5.0 RC2 Rating:
Released: 09-07-2005 Last Update: Never Installs: 21
 
No support by the author.

This little plug in allows you to have a random avatar instead of a constant one. The avatar of the user(s) you do this to will change each time their postbit is called. This will allow you as an admin, and those you choose (usually mods) to stand out a little more. Be cautious on using this too liberally unless you theme the avatars (all by the same artist - all of the same character, etc.).

Start out of course by creating the images that you want to cycle through and place them in the same directory, numbering them sequenctially -- 1.jpg, 2.jpg, 3.jpg, 4.jpg etc.

Now go to the plug in manager and click "Add New Plug in." Name it "John Doe's avatar" or some such. The hook location is "postbit_display_complete"

The code is as follows:

PHP Code:
if ($this->post['userid'] == Y)
{
$randomavatar rand(1,X);
$this->post['avatarurl'] = "http://yourdomain/path_to_your_directory/$randomavatar.jpg";

X is the upper most picture you made - so if your highest picture is 22.jpg you would use rand(1,22)

Y is your user id (or the id of the user you want this to apply to.

If you want to do this to multiple users then put multiple instances of this code in the same plugin to save on queries.

Make sure to keep your avatar set to something despite this plug in -- if you don't vbulletin will think there is no avatar and set the $show['avatar'] variable to false. While you could override this you'd need to check the logged in user's preferences to see if they even want to see avatars. It's just a whole lot easier to avoid the issue by making sure that vbulletin has an avatar on file for the user this plugin affects - this plugin will then switch the avatar url after vbulletin has made all it's normal determinations.

Tested on RC2, should work on all versions.

Show Your Support

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

Comments
  #12  
Old 09-25-2005, 11:36 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wordplay
anybody got a hack coming out with random avatars for all users within specific usergroups?

thought that would be cool, if all users had 1-5 rotating avatars. number of rotating avatars set by usergroup options.
No, but this hack would definitely be a good starting point to develop such an expansion - and anyone who wants to do so has my blessing to go ahead and publish it here.
Reply With Quote
  #13  
Old 10-05-2005, 04:22 AM
Bubble #5 Bubble #5 is offline
 
Join Date: Apr 2005
Posts: 984
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wordplay
anybody got a hack coming out with random avatars for all users within specific usergroups?
This would be a nice add-on for members who donate.
Reply With Quote
  #14  
Old 10-09-2005, 02:10 PM
LadyBeth LadyBeth is offline
 
Join Date: Jun 2003
Location: East Coast
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If this could be set for a user who gets to a certain "rank" I would love it.
Beth
Reply With Quote
  #15  
Old 10-12-2005, 09:55 AM
piXelatedEmpire piXelatedEmpire is offline
 
Join Date: Oct 2005
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is anyone currently working on this hack? I would love to see a admincp option developed for this.. and the ability to apply this to certain usergroups
Reply With Quote
  #16  
Old 10-14-2005, 01:34 PM
Next-Selection Next-Selection is offline
 
Join Date: Oct 2005
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by piXelatedEmpire
Is anyone currently working on this hack? I would love to see a admincp option developed for this.. and the ability to apply this to certain usergroups
WORD !!!
Reply With Quote
  #17  
Old 10-14-2005, 11:51 PM
Gaffer's Avatar
Gaffer Gaffer is offline
 
Join Date: Nov 2001
Location: Australia
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool... someone made another one of these...

i made something like this for Verseion 2.2.x but i've never been able to convert it, mainly cause i've not had the time

https://vborg.vbsupport.ru/showthread.php?t=44749
Reply With Quote
  #18  
Old 06-11-2006, 10:23 PM
tony adams tony adams is offline
 
Join Date: Oct 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent hack, been after this for a long time
Reply With Quote
  #19  
Old 10-12-2007, 07:06 AM
gakousei's Avatar
gakousei gakousei is offline
 
Join Date: Jun 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tested but it doesn't work on v3.6.8.
Nobody cares about this kind of mod ? I want to have this function on my forum.
Reply With Quote
  #20  
Old 11-12-2007, 08:02 AM
Ragnarok's Avatar
Ragnarok Ragnarok is offline
 
Join Date: Dec 2005
Location: Canada
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works fine on my v3.6.8 install.

It possible to change it to work on the memberlist and in profiles as well, and any other add-ons?

As installed you only get random avatars in the postbits, and your usercp-set avatar displays everywhere else.
Reply With Quote
  #21  
Old 07-05-2008, 10:56 AM
BigDog56 BigDog56 is offline
 
Join Date: Jan 2007
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tried this in 3.7.2 and it works just fine! thank you!
Reply With Quote
Reply


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 10:11 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.07183 seconds
  • Memory Usage 2,307KB
  • 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
  • (1)bbcode_php
  • (3)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
  • (1)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