Advertisement:

Author Topic: Logging Functions  (Read 13962 times)

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Logging Functions
« on: February 17, 2018, 04:26:18 PM »
I am missing a function where I can have more logging.

Example:
Some administrator on my board has entered a very bad CENSOR WORD combination
in Aadmin>Posts and Topics> Censored Words

How can I see who has entered that?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline Sh@mbles

  • SMF Hero
  • ******
  • Posts: 4,890
  • Gender: Male
    • i30 Owners Club
Re: Logging Functions
« Reply #1 on: February 17, 2018, 05:03:42 PM »
Ask them?

Online Sesquipedalian

  • The Mad Doctor
  • Lead Developer
  • Jr. Member
  • *
  • Posts: 322
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Logging Functions
« Reply #2 on: February 18, 2018, 01:39:46 AM »
This is unlikely to become a normal feature, but you can implement it yourself easily enough.

In Sources/ManagePosts.php, find:
Code: [Select]
// Set the new arrays and settings in the database.
$updates = array(
'censor_vulgar' => implode("\n", $censored_vulgar),
'censor_proper' => implode("\n", $censored_proper),
'censorWholeWord' => empty($_POST['censorWholeWord']) ? '0' : '1',
'censorIgnoreCase' => empty($_POST['censorIgnoreCase']) ? '0' : '1',
);

After that, add:
Code: [Select]
logAction('update_censor', array(), 'admin');

Or, if you want the log to contain a verbose record of what the censor was set to:
Code: [Select]
logAction('update_censor', $updates, 'admin');

Note: I have not tested this. See signature for my guarantee policy.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.