The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Edited Post Note Conditional
Hi There.
One rule on our forum is that discussion of moderation decisions must be discussed in a private forum between us and the user. We want to add a line under the edited post information, but only if an admin has edited the post, not when a member edits their own post. Is this possible? |
#2
|
|||
|
|||
Of course it's possible, but probably requires a plugin. I think one issue is that the editlog table has the userid and username of the user that edited the post, but not the usergroup, so you'd either need to look that up or else modify that table to include the usergroup (and maybe a column for the text for your second line, if you need that). Then you could probably just have a vb:if in the template to check the usergroup and display your line if needed.
|
Благодарность от: | ||
broncoshq |
#3
|
|||
|
|||
Does anyone know if such a plugin exists. That is certainly well out of my element!
|
#4
|
|||
|
|||
If you can do the appropriate template conditionals you can use boolean $post['edited_by_mod']
with this plugin code Code:
if($post['edit_username'] != '') { $edited_by = $this->registry->db->query_first(" SELECT CONCAT(usergroupid, ',', membergroupids) AS groups FROM " . TABLE_PREFIX . "user WHERE username = '" . $this->registry->db->escape_string(htmlspecialchars_uni($post['edit_username'])) . "' "); $post['edited_by_mod'] = ( in_array(5, array($edited_by['groups'])) OR in_array(6, array($edited_by['groups'])) OR in_array(7, array($edited_by['groups'])) ); } It returns true (1) for moderators (group 7) admins (group 6) and super moderators (group 5) |
Благодарность от: | ||
broncoshq |
#5
|
|||
|
|||
Awesome thanks for your help.
|
#6
|
|||
|
|||
If you don't want to mess with editing templates and template conditionals you could put a message right in the plugin.
Add some code like this at the bottom of the plugin Code:
if($post['edited_by_mod']) { $post['edit_reason'] .= " To complain about this edit, post a thread in the Whine Pout and Complain forum"; } |
#7
|
|||
|
|||
Quote:
|
#8
|
|||
|
|||
Just paste that in at the bottom of the plugin code I posted earlier with your own message text.
I assume you just want a generic message like that. |
#9
|
|||
|
|||
Quote:
Sorry about the late reply. Thank you very much for your help. It's working well. Is there anyway to only have the message show up with a staff member edits another member? The message still displays when a staff member edit's their own posts. |
#10
|
|||
|
|||
Change the first line of the plugin to read
Code:
if($post['edit_username'] != '' AND $post['edit_username'] != $vbulletin->userinfo['username']) |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|