Upload file autopm_install.php trong file đính kèm vào thư mục gốc forum & chạy bằng browser.
Mở file ./sources/register.php
Tìm:
CODE
//--------------------------------------------
// Insert into the custom profile fields DB
//--------------------------------------------
// Ensure deleted members profile fields are removed.
$DB->simple_exec_query( array( 'delete' => 'pfields_content', 'where' => 'member_id='.$member['id'] ) );
$fields->out_fields['member_id'] = $member['id'];
$DB->do_insert( 'pfields_content', $fields->out_fields );
Thêm bên dưới:
CODE
//--------------------------------------------
// Auto Send PM to new Users V5.0
//--------------------------------------------
if($ibforums->vars['auto_pm_on']) {
require_once(ROOT_PATH."sources/lib/post_parser.php");
$this->parser = new post_parser(1);
$ibforums->vars['auto_pm_message'] = $this->parser->convert( array( 'TEXT' => $ibforums->vars['auto_pm_message'],
'SMILIES' => 0,
'CODE' => 1,
'HTML' => 0));
$msg_text = array('msg_date' => time(),
'msg_post' => str_replace("{username}",$in_username,stripslashes($ibforums->vars['auto_pm_message'])),
'msg_cc_users' => "",
'msg_sent_to_count' => 1,
'msg_post_key' => md5(microtime()),
'msg_author_id' => $member['id'],);
$msg_data = $DB->compile_db_insert_string($msg_text);
$DB->query("INSERT INTO ibf_message_text({$msg_data['FIELD_NAMES']}) VALUES({$msg_data['FIELD_VALUES']})");
$msg_id = $DB->get_insert_id();
$msg_topic = array( 'mt_msg_id' => $msg_id,
'mt_date' => time(),
'mt_title' => str_replace("{username}",$in_username,$ibforums->vars['auto_pm_subject']),
'mt_from_id' => $ibforums->vars['auto_pm_from'],
'mt_to_id' => $member['id'],
'mt_vid_folder' => 'in',
'mt_tracking' => 0,
'mt_hasattach' => 0,
'mt_owner_id' => $member['id'],
'mt_hide_cc' => 1);
$msg_data = $DB->compile_db_insert_string($msg_topic);
$DB->query("INSERT INTO ibf_message_topics({$msg_data['FIELD_NAMES']}) VALUES({$msg_data['FIELD_VALUES']})");
$DB->query("UPDATE ibf_members SET new_msg=new_msg+1,msg_total=msg_total+1,show_popup={$ibforums->vars['auto_pm_popup']} WHERE id={$member['id']}");
}