Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2014, 04:10 AM
broncoshq broncoshq is offline
 
Join Date: Feb 2012
Location: Brisbane, Australia
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 06-17-2014, 11:42 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
broncoshq
  #3  
Old 08-15-2014, 09:39 AM
broncoshq broncoshq is offline
 
Join Date: Feb 2012
Location: Brisbane, Australia
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know if such a plugin exists. That is certainly well out of my element!
Reply With Quote
  #4  
Old 08-16-2014, 03:14 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']))
	);
}
in hook location postbit_display_complete

It returns true (1) for moderators (group 7) admins (group 6) and super moderators (group 5)
Reply With Quote
Благодарность от:
broncoshq
  #5  
Old 08-16-2014, 03:15 PM
broncoshq broncoshq is offline
 
Join Date: Feb 2012
Location: Brisbane, Australia
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome thanks for your help.
Reply With Quote
  #6  
Old 08-16-2014, 03:37 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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";
}
Reply With Quote
  #7  
Old 08-17-2014, 10:32 AM
broncoshq broncoshq is offline
 
Join Date: Feb 2012
Location: Brisbane, Australia
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
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";
}
Where would I put that, sorry?
Reply With Quote
  #8  
Old 08-17-2014, 01:30 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 09-06-2014, 02:13 PM
broncoshq broncoshq is offline
 
Join Date: Feb 2012
Location: Brisbane, Australia
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
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.

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.
Reply With Quote
  #10  
Old 09-06-2014, 07:00 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change the first line of the plugin to read
Code:
if($post['edit_username'] != '' AND $post['edit_username']  != $vbulletin->userinfo['username'])
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04331 seconds
  • Memory Usage 2,258KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete