vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is there a way to make it appear an infraction came from a central user? (https://vborg.vbsupport.ru/showthread.php?t=221607)

Joey Link 08-24-2009 12:33 AM

Is there a way to make it appear an infraction came from a central user?
 
What I'm trying to do is make it so when a moderator issues a warning or infraction it appears as though it comes from one central user, such as "Site Police", instead of the actual moderator that issued it. The reason is because some of my moderators are more active than others and those moderators tend to get a bad reputation among the general membership. I don't want them to have to log into another account whenever they see something that needs to be moderated, and we still need the ability to see who did what for admin purposes.

s0lidgr0und 08-24-2009 01:17 AM

*checking what I typed in here before I try to help*

I was wrong in what I claimed. I'd probably create an account for the moderators to access and have them send in their infractions from there, unless there's a mod that addresses this.

Good luck.

Joey Link 08-25-2009 01:36 AM

Thanks, but I'm really trying to not do it that way.

Anyone?

tipoboy 08-25-2009 05:56 AM

Quote:

Originally Posted by Joey Link (Post 1873803)
Thanks, but I'm really trying to not do it that way.

Anyone?

off hand i dont think there is any other way, but there is a way to make things easier when having a seperate "board police" user.

There is a hack by CYB - log in as user which allows users you have stipulated to log into users account and could be quite useful for this purpose, as this does not log the original user out, more just allows them to log in with two accounts simultaniously(sp).

James Birkett 08-25-2009 10:25 AM

The account doesn't log in simultaneously, when you log into user accounts you can't use your own account.
Also, using the Log In To User is effectively (unless modified) giving people permission to access any account on your forum.

Also, this wouldn't work (unless you give them the "Board Police" password) as it asks you to reauthenticate when doing an action.

Lynne 08-25-2009 01:54 PM

This is the line that sets the userif (I think) - line 652 in infraction.php:
PHP Code:

    $infdata->set('whoadded'$vbulletin->userinfo['userid']); 

So, look at the file and see if there is a hook after that, but before the infraction is actually given, and change that variable.

You should also look at the PM processing underneath that line and see about modifying who the PM is from also. These are the two lines for that (around line 747):
PHP Code:

        $pmdm->set('fromuserid'$vbulletin->userinfo['userid']);
        
$pmdm->set('fromusername'$vbulletin->userinfo['username']); 

There is a hook right under those lines for you to use to change them.

Joey Link 08-25-2009 05:20 PM

I appreciate your reply Lynne, as usual. This gives me some hope that it's actually possible to do.

So I tried changing the userid on line 652 to 2, which is the userid of the account I want the infractions to appear like they came from. When I tested it, it gave the infraction, but didn't create the infraction thread in the admin area, didn't show up on the users infraction list within his profile, and didn't send the PM.

I've read about hooks but I don't know how to spot one, let alone change it.

I then tried changing the lines around 747 so the userid was 2 and the username was Northwest Firearms. When I tried to issue an infraction it returned a fatal error.

--------------- Added [DATE]1251228223[/DATE] at [TIME]1251228223[/TIME] ---------------

Ah I see the $hook below the second set of code now, though I still don't know the proper way to modify it.

James Birkett 08-25-2009 05:46 PM

Admin CP -> Plugins & Products -> Add New Plugin
That allows you to mess with hooks.
Product: vBulletin
Hook: Whatever you found
Title: Specify
PHP Code: Code you want to use.

Lynne 08-25-2009 05:58 PM

It's very hard to tell what you did wrong when you don't post your actual code changes/additions nor the exact error message.


All times are GMT. The time now is 05:26 AM.

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.03448 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete