The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
If moderator of forum, etc etc
Hello,
I have a quick question about an if conditional. I know a forum that has moderators of individual categories. Here's an example. There's a Music category, and a Television category. Jimmy is a moderator of the Music category, so when he posts in the Music category, his name shows up in a Green color (or any color). Now, there's Bob, who is a moderator of the Television category. When he posts in the Television category, his name also shows up Green (or any other color). Now, if Bob posts in the Music Area, or vice-versa, their name will not show up green because they aren't a moderator of that particular forum. I am trying this code; HTML Code:
<if condition="can_moderate($forum['forumid'])"> stuff here </if> |
#2
|
|||
|
|||
Try this...
Code:
<if condition="can_moderate($foruminfo['forumid'] !== X)"> stuff here </if> |
#3
|
|||
|
|||
Well, here is the thing. It is much much easier to use an if conditional where I don't have to enter each forum ID. We have over 25 diff forums where there are diff users as moderators of that forum, henceforth that would be a really long code where it is possible to use the if condition I am seeking. But thank you though. If no one can tell me if my if condition is correct and/or why it isn't working in the postbit template, I'll try to use yours.
|
#4
|
||||
|
||||
Have you tried "is_moderator?"
Everyone can moderate - their own posts. But not everyone is a moderator. Perhaps, "is_usergroupID?" |
#5
|
||||
|
||||
Quote:
|
#6
|
|||
|
|||
--------------- Added [DATE]1361049497[/DATE] at [TIME]1361049497[/TIME] ---------------
Okay, I kind of figured out why. My if condition was saying that, if the user moderated the forum and the user is apart of the usergroup IDs I specified, they could see the code. I needed it so if the user moderated the current forum and the user who moderates that forum is a member of the usergroup ID I specified, then they get the code shown in their post and is visible to everyone else. My friend helped me get to this code; HTML Code:
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 7,47)"> <div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']}Leader</big></b></div></if> <else /> <if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 5,55)"> <div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']} Moderator</big></b></div> </if> |
#7
|
||||
|
||||
Quote:
First off, let's narrow down what you're trying to do. Because the first code you posted (which I spent a couple of hours trying to figure out earlier today) isn't doing the same thing that you're trying to do now. In the first post you seem to only want to show code that displayed Thread Starter, Thread Starter & Moderator and Thread Starter & Leader (which I'm assuming was groups 7 and 47). Now you seem to only want to demarcate Moderators from Leaders, with no regard for thread starter. Let's pick one of those and go with it, because the code would be different depending on which you're trying to accomplish. |
#8
|
|||
|
|||
Disregard the old code, and look at the new code I just posted
The old code, I was combining it with the Original Posting modification I had in place. Disregard it. Here is the CURRENT code I'm trying; HTML Code:
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 96)"> <div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']} Leader</big></b></div></if> <else /> <if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 95)"> <div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']} Moderator</big></b></div> </if> If the user who posted a reply/thread is a moderator of the forum they posted it in AND that user who posted is a member of usergroup ID 96, it shows you the code provided. Else, if the user who posted a reply/thread is a moderator of the forum they posted in AND that user who posted is a member of the usergroup ID 95, it shows you the code provided. Now, before, I was using 4 usergroup IDs (in my old post), however, my friend said that this was only working with usergroups that aren't set as 'primary' for that person, so I made 2 usergroups (IDs 95 and 96) that I added the users to as one of their additional usergroups, however, it still isn't working, yet it's working for him. |
#9
|
||||
|
||||
I don't think it should matter whether the usergroup is primary or not, but for the postbit templates, you'll want to use is_member_of($post, X), where X is the usergroup ID. Also, the <else /> statement is only used inside an if conditional, so it's not really needed, nor does it do anything here.
HTML Code:
<!-- Has to have moderator permissions AND be a member of Usergroup 96 --> <if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($post, 96)"> <div class="new_class_name">{$GLOBALS['foruminfo']['title']} Leader</div> </if> <!-- Has to have moderator permissions AND be a member of Usergroup 95 --> <if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($post, 95)"> <div class="new_class_name">{$GLOBALS['foruminfo']['title']} Moderator</div> </if> I would also recommend not using <big> tags here. One, because it's not really modern HTML anymore, and two, because the smallfont class and <big> would probably be fighting each other and not really displaying properly. I would suggest putting your own CSS in the Additional CSS options of your skin and use that class name for the div here. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|