Author Topic: Modify your "EXTREME" items to log actions in a forum  (Read 1678 times)

Offline chadk

Modify your "EXTREME" items to log actions in a forum
« on: October 21, 2006, 11:13:04 am »
I created a forum for my Shop History so everyone can now see who's tried to do what and they can reply and carry on in that area.  They can't create NEW topics though (using advanced permissions that you can turn on in SMF).

Anyway, add this code to whatever item you want to post a message for in the  onuse function :

Make sure these are part of that function's GLOBAL declaration:
$ID_MEMBER, $sourcedir
This example is from the KARMA BOOST item:

Code: [Select]
require_once($sourcedir . '/Subs-Post.php');
$topicOptions['board'] = 98; //SHOP history forum  Mine is #98  You need to create this then use it's ID number
$topicOptions['id']=0; //NEW topic
$msgOptions['subject'] = "I just boosted ".$_POST['bashwho']; //Subject
$msgOptions['body'] = "I just boosted ".$_POST['bashwho']; //Message area
$posterOptions['id']=$ID_MEMBER; //Current user's ID
createPost(&$msgOptions, &$topicOptions, &$posterOptions); //create the post using the SMF posting function

Offline Daniel15

Re: Modify your "EXTREME" items to log actions in a forum
« Reply #1 on: October 21, 2006, 01:31:48 pm »
I was planning to write up a log last week, but I didn't have time to...
Your idea seems to be quite good, though. This is exactly what a lot of people are looking for :D