PDA

View Full Version : Add Something to the moderator Log


JoeBOBBillyTed
02-08-2009, 12:22 PM
I have some customized pages. I need to track which mods are doing what with these pages. I want to use the

log_moderator_action() function. However, I am having issues getting ti to work correctly. Does anyone have a tutorial on this? I searched and came up empty.

Lynne
02-08-2009, 02:54 PM
I don't know of a tutorial. I've seen it done a couple of different ways - just download a modification that does it and see how they do it. There are two hook locations available though - fetch_modlogactions and fetch_modlogtypes

JoeBOBBillyTed
02-08-2009, 10:18 PM
lynne do you know of a good one to look at? I searched but without knowing one that does this, it is difficult.

Lynne
02-08-2009, 11:11 PM
A quick look at the products on my test site shows this product name - Change Threads Prefix Inline. Search for that and take a look at what they did.

JoeBOBBillyTed
02-09-2009, 12:08 AM
Thanks Lynee

--------------- Added 1234149678 at 1234149678 ---------------

okay, another question regarding this. I got the code working to add it ot the moderator log. However, I want to put some information into Info column. I checked out the code and I am not seeing a way to do this without editing the php code on the forums/admincp/modlog.php page and most likely the includes/functions_log_error.php page. Is there a way of doing this without editing the php code. If not, anyone have a good mod to reference to figure out how to do this?

JoeBOBBillyTed
02-10-2009, 01:28 PM
Any suggestions on this? It would be greatly appreciated.

Lynne
02-10-2009, 02:28 PM
The info column? What is your call to enter something into the log? Are you putting something in for the $action?

From the API (http://members.vbulletin.com/api/):
log_moderator_action (line 275) Logs the moderation actions that are being performed on the forum
void log_moderator_action (array $loginfo, integer $logtype, [string $action = ''])

array $loginfo: Array of information indicating on what data the action was performed
integer $logtype: This value corresponds to the action that was being performed
string $action: Other moderator parameters

JoeBOBBillyTed
02-10-2009, 08:53 PM
Lynne,

I am using :

log_moderator_action($modlog, 'changed_trade_status', 'Changed Trade Status');


The Action is showing up, however I am using 3.5 and there is an information column as well. Typically this displays what this action is being applied to. In most cases this is a thread / post and it displays the thread or post and then the forum it is in. I want to add an additional item that can be displayed there. It is for a trade manager that is integrated with one of the feedback systems here. I need to know when a moderator changes the status of a trade. I can currently insert the change, but it is not directly connected to a trade, like a typical log would have an attached thread/post.

Lynne
02-10-2009, 10:09 PM
I'm not sure exactly what you mean. Perhaps this will help.

For a mod I wrote, I have this line:
log_moderator_action($threadinfo, 'thread_verified_x_reason_y_hold_z', array($vbulletin->GPC['verify_status'], $vbulletin->GPC['verify_reason'], $vbulletin->GPC['verify_hold']));
The phrase 'thread_verified_x_reason_y_hold_z' is:
Thread verified. (verified: {1}; reason: {2}; hold: {3})

So from my statement, it actually translates into this in the log:

Thread verified. (verified: $vbulletin->GPC['verify_status']; reason: $vbulletin->GPC['verify_reason']; hold: $vbulletin->GPC['verify_hold'])

OR (example)
Thread verified. (verified: 2; reason: 3; hold: 0)

A verifiy status of 2 means it's a questionable thread, the reason being #3 and the thread is not on hold. (It doesn't really matter exactly except that I and the mods understand that line.) I passed it variables which it entered into the log.

Is that what you are wanting to do?