![]() |
Random Rotating Avatar for specific users
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:
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. |
<a href="https://vborg.vbsupport.ru/showthread.php?t=83252" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=83252</a>
|
good idea but this has potential to get really messy.
good starting point though. |
Hmm couldn't you make it a lil less messy though?
Add a new user field "randomavatar" with the yes/no code and a new user field of "maxrandavatar" Code:
if ($this->post['randomavatar'] == 1) // meaning yes Course you'd go through the admin users panel to turn it on and set how many images it randomizes through. That's my input :) Awesome idea though, will definately be implementing this in some form for premium members :) |
Quote:
And BTW - if the mods and admins need your help, I'm sure they'll let you know. |
You migth want to make the plug-in for this as it would be considered a code mod without, it wouldn't it?
|
Quote:
I could make an xml file, but that only adds an extra step since the user will still have to edit the plug in and provide the path to the images directory where the random images are, the maximum rand seed and the userid that it is to affect before it will work correctly. |
A simple admin CP setting would take care of that.
|
Nice mod. I use one slightly different that doesn't require naming of the files in any specific method, but yours will run faster.
|
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. |
All times are GMT. The time now is 07:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|