2011-09-12, 10:21 AM
Works With 1.6.x
Original Author: thebod
First of all you have to find this in warnings.php (line 248):
Add below:
Then create a file named 'warnpost.php' in inc/plugins with the following content:
You only have to change "$into_fid". That's the Forums ID.
It's a German Tutorial. Therefore, it is "Punkte" for "Points" and "Notiz" for "Notice".
You can change it for yourself.
Then you have to activate it in ACP. That is!
Original Author: thebod
First of all you have to find this in warnings.php (line 248):
$db->insert_query("warnings", $new_warning);
Add below:
$plugins->run_hooks("warnings_do_warn_insert");
Then create a file named 'warnpost.php' in inc/plugins with the following content:
<?php
/*
Warn Post Extension
Version 0.1
Autor: thebod
Homepage: http://www.b-ike.de/
Erstellt bei Userverwarnungen einen Thread.
Alpha-Testversion, bitte anpassen!
Lizenz: Ihr dürft alles machen, lasst nur meinen Namen bitte drin ;)
*/
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
global $into_fid;
/*********** CHANGE HERE ***********/
$into_fid = 2; // Foren ID
/***********************************/
$plugins->add_hook("warnings_do_warn_insert", "warnpost_doAction");
function warnpost_info()
{
return array(
"name" => "Warn Post",
"description" => "Erstellt einen Thread beim Verwarnungen von Userns",
"website" => "http://www.schwarzernorden.de/",
"author" => "thebod",
"authorsite" => "http://www.b-ike.de/",
"version" => "0.1",
"guid" => "",
"compatibility" => "*"
);
}
function warnpost_doAction()
{
global $mybb, $new_warning, $into_fid;
require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("insert");
$posthandler->action = "thread";
$user = get_user($new_warning['uid']);
$pmNotice = false;
if($mybb->input['send_pm'] == 1 && $group_permissions['canusepms'] != 0 && $user['receivepms'] != 0 && $mybb->settings['enablepms'] != 0)
$pmNotice = true;
$new_thread = array(
"fid" => $into_fid,
"subject" => "Warning User " . $user['username'],
"prefix" => '',
"icon" => 0,
"uid" => $mybb->user['uid'],
"username" => $mybb->user['username'],
"message" =>"Warning User " . $user['username']."\n".
"Notiz:[QUOTE]" . $new_warning['notes'] . "[/QUOTE]\n".
"Punkte: " . $new_warning['points'] . "\n".
($pmNotice ? "Der User wurde per PM benachrichtigt.\n" : ''),
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']
);
$posthandler->set_data($new_thread);
$posthandler->validate_thread();
$posthandler->insert_thread();
}
You only have to change "$into_fid". That's the Forums ID.
It's a German Tutorial. Therefore, it is "Punkte" for "Points" and "Notiz" for "Notice".
You can change it for yourself.
Then you have to activate it in ACP. That is!