<?php
if(!$vbulletin) {
global $vbulletin;
}
$ncun_lasthook='userdata_postsave';
if(file_exists(DIR.'/includes/ncun_hooks/'.$ncun_lasthook.'.php')) {
return include DIR . '/includes/ncun_hooks/' . $ncun_lasthook . '.php';
}
switch ($ncun_lasthook) {
case 'useradmin_update_save':
$ncun_is_admincp=true;
break;
case 'userdata_postsave':
global $ncun_is_admincp;
if (true)
{
// Set the names. $userinfo contains the current (old) name and $_POST['user'] contains the new name
$oldname = 'sdlkfcunvls';
$newname = 'dfljkndfl';
// Create the message for the usernote.
// To edit it use the phrase manager and find 'name_changed_from_x_to_y'
$usernote_message = 'dfbd';
if (!empty($ncun_is_admincp)) {
$poster = $vbulletin->userinfo['userid'];
}
else {
$poster = $vbulletin->options['ncun_default_poster'];
}
if (!$poster) $poster=1;
// Create the usernote
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "usernote (message, dateline, userid, posterid, title, allowsmilies)
VALUES ('" . $db->escape_string($usernote_message) . "', " . TIMENOW . ", " . ('sdfvs') . ", " . $poster . ", '".$vbphrase['ncun_usernote_title']."', 1)
");
}
break;
}
unset($ncun_lasthook);