![]() |
Staff Avatar Background
Split off of this discussion:
https://vborg.vbsupport.ru/showthread.php?t=119470 So what do I mean? Take a look at the admin / mods right here! The general idea is to enable certain members to have a background for their avatar, like the staff here do. Basing this on usergroups would probably be the easiest way. Keep in mind if someone is part of two or more usergroups that are able to have a special background, the end user and/or staff members need to be able to set which background is appropriate for said user. A hierarchy (e.g. a value for each background) could also be set up (managed by staff of course, with optional overrides) to automate this process. Some forums may not want their mods to be noted as such when outside of the sub-forums they moderate, and as such may want an option to have them automatically not show the background in certain forums. The avatar the user chooses preferably should not be modified by the hack, in case of the person being demoted, or the background being used as a contest prize on the forum, etc. The hack could use GD or something to combine the background and the user's avatar into a new one (if needed, I'd recommend storing a copy of the original avatar somewhere in the server or database for backup purposes), but not to replace the avatar direcly within the user's profile. Something like a conditional statement around the avatar block in a post to resolve all of this. Or, a conditional could be used to place the background around the avatar assuming the appropriate conditions are met. No merging of files needed. GD may be used if an optional idea for the hack is used where their name is on the avatar like vB.org, although the name may not necessarily match the user name, akin to here. A nice add-on to this hack would be an ACP area where a staff member can give someone a background for a limited amount of time to support the contest idea. Showing all possible avatars within their UserCP and member page would be nice as well. |
It would be great if this could be based on usergroups or post counts, so a member make 5,000 points, they get a special background of frame or something. Great request, been looking for something like this for months.
|
Are there hacks where a user is placed into a secondary usergroup if x # of posts has been hit?
|
You don't need a hack, just create the usergroup and the promotion for it.
|
1 Attachment(s)
hmmmmmmmm
I'll brb ------------ EDIT hmmmmmmmm I'll brb ok I'm back. Use this to get you started: Code:
<br /> Here's what you do.... Create a 100x100 pixel image you'd like to use as a background. (replace my code http://probetreffen.de/forum/images/ranks/btn_moderator.gif with your background image) This will give you a 100x100 background and a 50x50 avatar ontop of that, centered. That's the easy part :p Now for the hard part: You have to set conditionals for usergroups. If administrator > use this background image and his avatar if moderator > use this image and avatar etc.. then another conditional where you say if usergroupid != "1" & !="2" etc (all the admin and mod groups) display normal avatar. Basically you're saying that if the user is a staff member, the normal avatar won't show up, but instead the background and his avatar will. And if it's a normal user then just display the avatar. It's really not that complicated but it's a little work. You should create a plugin and template to hold all the code and then call the variable within the postbit template. I've attached a quick demo screenshot: 1st is the name, then the user rank, then the background and avatar, then the normal avatar. |
Quote:
that's cake, but the centering (or off centering in the case of vBulletin.org) is the part I'm not sure about. |
1 Attachment(s)
You can use if conditional usergroup setting on: "badge.png"
- If usergroup 1 user image background "badge.png" - If usergroup 2 user image background "badge2.png" - If usergroup 3 user image background "badge3.png" - If usergroup 4 user image background "badge4.png" Code:
<table border="0" cellpadding="0" cellspacing="0" width="124" height="82"> |
Ok, so I went into the postbit and found:
Code:
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if> Code:
<if condition="$show['avatar']"> attempted to replace it with: Code:
<!-- START - TEST FOR AVATAR HACK --> Code:
The following error occurred when attempting to evaluate this template: So, what stupid little thing did I pooch? |
AND is_member_of({$vbulletin->userinfo}, 79)
?????? |
Code:
<if condition="$show['avatar'] AND is_member_of({$vbulletin->userinfo}, 79)"> Code:
<if condition="$show['avatar'] AND is_member_of({$vbulletin->userinfo[usergroupid]}, 79)"> |
Also using the <if><else /></if> structure would make the code less verbose.
|
Didn't work either, but it's a but more concise:
Code:
<!-- START - TEST FOR AVATAR HACK --> |
Quote:
Quote:
Code:
<!-- START - TEST FOR AVATAR HACK --> |
[QUOTE=Allan]
You've still got Code:
AND is_member_of({$vbulletin->userinfo}, 79)"> Why not just do something like <if condition="$vbulletin->userinfo[usergroupid]=6"> bla bla <if condition="$vbulletin->userinfo[usergroupid]=2"> etc and make a plugin to hold the code so the template doesn't get cluttered I'm sure you could use something like <if condition="$vbulletin->userinfo[usergroupid]=6 || $vbulletin->userinfo[usergroupid]=7 || $vbulletin->userinfo[usergroupid]=11"> |
Dont' work :(
Quote:
|
Quote:
|
With this code:
Code:
<!-- START - TEST FOR AVATAR HACK --> http://img180.imageshack.us/img180/5270/result2hp.gif |
Code:
|
Quote:
http://img401.imageshack.us/img401/6864/yep0kc.gif |
Tested and don't work :(
|
Ok, try this. It looks pretty good.
I'm not messing with the if statements right now because my paste arrived :D Code:
|
BTW, there was a small problem with my code (extra bit):
Code:
$vbphrase[xs_avatar]</phrase>" border="0" /></a> Code:
</a> Can you make a whole table a hyperlink though? I think you can. |
1 Attachment(s)
Quote:
|
Quote:
|
Allan, you need to set the avatar to the far right behind the background, so basically set the background to load after the avatar or set the avatar to load as the background, I don't know, I plan to give it a go once my new server is setup.
|
What about this? (don't have the background uploaded to my server yet, just putzing around at work w/ limited access to forum)
I basically just tweaked Sky's code and slapped a basic conditional around it. repositioning the background and the avatar are easy w/ this code, just want to make sure it doesn't interfere w/ vB stuff. Code:
<!-- START --> |
Code:
<!-- START --> |
Quote:
Some group one the background while just the admin should have it. looking:
|
small problem with that code is that someone isn't in that group, it won't go through <if condition="$show['avatar']> by itself.
here's what I was messing with: Code:
|
Code:
<if condition="$show['avatar']"> |
Quote:
Quote:
|
Ok, I got it :)
Code:
<if condition="$show['avatar']"> |
Quote:
But, if i want add other images for other usergroup, How may I make ? |
As many as you want. You can nest the if statements by having it in the format:
if admin else if super mod else if mod else if custom group else normal end if end if end if end if Basically just keep nesting them. If you want two or more groups to use the same image, then you can use an array in the conditional to specify which groups that conditional applies to. |
Schweet :) Going to try tweaking it w/ standard vBulletin code so that if different usergroups have different avatar dimensions the hole will stretch. currently it'll smush the avatar.
Example: http://www.houseofhelp.com/forums/sh...ad.php?t=52133 |
you can do that by using conditional nesting and using different dimensions in the code from there
|
Something like this?
Code:
<if condition="$show['avatar']"> |
Quote:
|
Yep. I was adding it while you were correcting my omission. :cool:
Thanks. Is the use of the else / if considered better formatting? Regards, |
lol I love it, total chaos!
How many designers and coders does it take to come up with a tiny piece of functional code lol. It's really starting to shape up, but I thought about having the small avatar in behind the background image as was mentioned... it's frying my brain.... you have a table --------------------------table--------------------------| tablerow top---------------------------------------TR-| | |............................columntop -------------------TD|.| | |...........................................|..... ........................|.| | |...........................................|..... ........................|.| | |...........................................|---------------------|.| | tablerowbottom-----------------------------------</tr>| | --------------------------table--------------------------| How the hell would you be able to pull it off? I mean, you can't have the column without a table to hold it and you can't add a table because then the 2nd table will not overlap the 1st but instead be to the right or below it.... BRAIN FRYING! |
All times are GMT. The time now is 04: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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|