The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Getting the group ID of edited post
How do you get the group ID of the user that edited a post? I wanted to display a different style if the post was edited by moderators or admins.
|
#2
|
||||
|
||||
Hello,
Wrap the output with if conditionals like this: Code:
<if condition="is_member_of($bbuserinfo, 6)"> Admins Display This for editted post </if> </else> <if condition="is_member_of($bbuserinfo, 2)"> Member Display this for editted post </if> Code:
<if condition="is_member_of($bbuserinfo, 6,5,7)"> Staff Display This for editted post </if> |
#3
|
||||
|
||||
That's what I did but not exactly what I wanted. The logic is: if the post was edited by a moderator or admin, show it using a different style (div) else use normal style.
|
#4
|
||||
|
||||
Hello,
To make it look differently, you will need to add YOUR code between the conditions. For example: <if condition="is_member_of($bbuserinfo, 6)"> <div class="YOURS">Admins Display This for editted post</div> </if> </else> <if condition="is_member_of($bbuserinfo, 2)"> Whatever is normally here! </if> I don't know exactly where the editted post info is located, so i don't know how it is handled. (Don't have time to search through the templates right now.) |
#5
|
||||
|
||||
What he wants is not quite as simple as that - $bbuserinfo is the information for the poster, not the editor.
|
#6
|
||||
|
||||
Hello,
I just ran a test on my site to see if I could figure this out. This is what I did and it worked for me: Code:
<if condition="is_member_of($bbuserinfo, 6)"> <if condition="$show['postedited']"> <!-- edit note --> <div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" /> <em> <phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>- No No. <if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if> </em> </div> <!-- / edit note --> </if></if> </else> <if condition="is_member_of($bbuserinfo, 2)"> <if condition="$show['postedited']"> <!-- edit note --> <div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" /> <em> <phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase> - HA HA. <if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if> </em> </div> <!-- / edit note --> </if></if> I didn't play with the colors or anything. I just added the little text that is bolded to see if it saw the difference. I editted a post of my test account and it displayed the "No No" like I wanted it to. I then logged in with my test account, which is a normal user, and it displayed the "HA HA" when he editted like I wanted it to. On both of these I entered a reason for the edit. The only other thing I was going to try was the $post[edit_userid] and perhaps create an array with the user id's of those in the staff. I am not sure if this will remain working but I was thinking that since the edit function passes through the permissions system this would be adequate. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|