![]() |
Custom CSS based on Usergroup?
Hi Guys,
I have a question.... I would like when posts are made from a certain usergroup in the forum that their posts receive a different background to others so that other members can recognise these posts easier. I understand I need to use an <if> statement to achieve this. I tried: <if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)"></if> <td class="postbox" id="td_post_$post[postid]"> <else /> <td class="postbox2" id="td_post_$post[postid]"> </if> However this only works for the person making the post. It does not change the background for everyone else reading the forum only the individual that made the post can see the difference when they are logged in. Any help would be great! Regards, Joel |
* Bump *
|
How about:
HTML Code:
<if condition="is_member_of($post, 1, 2, 3)"> |
This is relevant to my interests,
Is there any full way to do this? Ive seen it on some company forums. |
Quote:
|
Sorry, im not too good with this kind of stuff.
What im after, if the background of the posts of admins, mods and super mods to be a different color from the norm. the Age Of Conan forum has it, although they wont tell me how :( |
This is for 3.6.8, change for your own version...
Find this code in your postbit(_legacy) and add this style info into the div tag: HTML Code:
<tr> |
Sorry to bump this old thread, but anyone got any clues to this ?
|
The answer was posted, so I'm not sure what you mean. I think there may even be a mod for this - do a search in "all mods" "titles only" and you may find it.
|
I'm sorry, but I tried to search, and found nothing, or, maybe I'm just using the wrong key-words.
Either way, the code above doesn't work, the only thing I get to work is to show all member posts with the same color, regardless of their user group. |
The best way to get help when something "doesn't work" is to post exact what you did so we can see where you went wrong. Please use the code/html/php tags when you post it. And make sure you always tell us the template or hook location when posting code.
|
I'll just dump my postbit_legacy code part here.
Mind, I use a custom code, coded by someone else, so I have really no clue at all.... Hope this is allowed/alright. BTW, Lynne, what do you mean by template or hook location ? The path to where the template is located ? postbit legacy: Code:
$template_hook[postbit_start] |
You didn't show the code you tried at all. Nowhere in there do I see an added condition based on usergroup for the background. I can't tell what you did wrong if you don't post what you did.
|
Oh shit, wrong piece of code.
Let me update it. --------------- Added [DATE]1247154163[/DATE] at [TIME]1247154163[/TIME] --------------- Updated, also marked the areas I've changed with red color. CSS .postbit is simply background-color. I've gotten it half-way working now, only part missing is the background-color for the post itself, user-area and all those mini buttons (report, etc) are showing correctly. I got a bit confused at this part: Code:
<if condition="$show['moderated']"> |
Anyone able to give me a hand ? I can't seem to find the correct spot to include the code
|
What is the result of the code you posted above (a link to a page where this should be working would be useful)? It's hard to help when you didn't say what is wrong. And, check your page source to see what is in there.
$show['moderatored'] has to do with whether a post is a moderated post to show just to the moderators. |
|
Quote:
I've tried so much, but I have honestly not much of a clue on where to place the codebit. Quote:
|
Try this :
first open this file Code:
forumdisplay.php Code:
// Soft Deleted Thread PHP Code:
if you want to do this for Certain groups add this code PHP Code:
Notice: you need to change number (6) to the ID number of the group you want .. use (,) if you want to do it on Different groups Save and Upload the file ----------------- Then open this file Code:
clientscript/vbulletin_ajax_threadslist.js Code:
this.inputobj.style.width = Math.max(this.linkobj.offsetWidth, 250) + 'px'; PHP Code:
in the same file find Code:
this.inputobj.title = this.inputobj.value; PHP Code:
Save the file and Upload it That's will be all |
Try this instead of what you have:
HTML Code:
<if condition="$show['moderated']"> |
All times are GMT. The time now is 02:52 AM. |
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:
|