vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Edited Post Note Conditional (https://vborg.vbsupport.ru/showthread.php?t=312163)

broncoshq 06-15-2014 04:10 AM

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?

kh99 06-17-2014 11:42 AM

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 08-15-2014 09:39 AM

Does anyone know if such a plugin exists. That is certainly well out of my element!

nerbert 08-16-2014 03:14 AM

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)

broncoshq 08-16-2014 03:15 PM

Awesome thanks for your help.

nerbert 08-16-2014 03:37 PM

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";
}


broncoshq 08-17-2014 10:32 AM

Quote:

Originally Posted by nerbert (Post 2511537)
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?

nerbert 08-17-2014 01:30 PM

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.

broncoshq 09-06-2014 02:13 PM

Quote:

Originally Posted by nerbert (Post 2511692)
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.

nerbert 09-06-2014 07:00 PM

Change the first line of the plugin to read
Code:

if($post['edit_username'] != '' AND $post['edit_username']  != $vbulletin->userinfo['username'])


All times are GMT. The time now is 02:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01590 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete