Hôm nay mình sẽ hướng dẫn các bạn ...okie chua
Các file cần sửa:
./sources/Register.php
./sources/Admin/ad_settings.php
Nhớ Backup khi hack mod
Mở sources/Register.php
[b]
Tìm cài đoạn này:
QUOTE
//+--------------------------------------------
//| Insert into the DB
//+--------------------------------------------
$member['password'] = md5( $member['password'] );
$db_string = $std->compile_db_string( $member );
$DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
Dán vào phía trên nó:
QUOTE
//+--------------------------------
//| Auto Send PM To New Users V4.0
//+--------------------------------
if($ibforums->vars['auto_pm_on'] == 1) {
$DB->query("SELECT MAX(msg_id) as message_id FROM ibf_messages");
$auto_pm = $DB->fetch_row();
$auto_pm_messageid = $auto_pm['message_id'] + 1;
$current_time = time();
$pm_message = str_replace("*username*",$in_username,$ibforums->vars['auto_pm_message']);
$pm_subject = str_replace("*username*",$in_username,$ibforums->vars['auto_pm_subject']);
require "./sources/lib/post_parser.php";
$this->parser = new post_parser();
$pm_message = $this->parser->convert( array( 'TEXT' => $pm_message,
'SMILIES' => 1,
'CODE' => $ibforums->vars['msg_allow_code'],
'HTML' => $ibforums->vars['msg_allow_html']
) );
$pm_message = addslashes($pm_message);
$DB->query("INSERT INTO ibf_messages & #40;msg_id,msg_date,read_state,title,message,from_id,vid,member_id,recipient_id,
attach_type,attach_file,cc_users,tracking,read_date) VALUES ('','{$current_time}','0','{$pm_subject}','{$pm_message}','{$ibforums->vars['auto_pm_from']}','in','{$member_id}','{$member_id}', 'NULL', 'NULL', 'NULL', '0', 'NULL')");
$member['msg_from_id'] = $ibforums->vars['auto_pm_from'];
$member['msg_msg_id'] = $auto_pm_messageid;
$member['new_msg'] = 1;
$member['msg_total'] += 1;
$member['show_popup'] = $ibforums->vars['show_pm_popup'];
}
Save và upload
Tiếp theo mở file: sources/Admin/ad_settings.php
Tìm cái này:
QUOTE
case 'url':
$this->url();
break;
case 'dourl':
$this->save_config( array ( 'number_format', 'html_dir','safe_mode_skins', 'board_name','board_url','home_name','home_url', 'disable_gzip',
'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug' ) );
break;
Thay nó bằng:
QUOTE
case 'url':
$this->url();
break;
case 'dourl':
$this->save_config( array ( 'number_format', 'html_dir','safe_mode_skins', 'board_name','board_url','home_name','home_url', 'disable_gzip',
'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug', 'auto_pm_on', 'show_pm_popup', 'auto_pm_subject', 'auto_pm_message', 'auto_pm_from' ) );
break;
Chú ý:
Cái này bạn có thể thêm vào sau CODE'sql_debug' là:
QUOTE
, 'auto_pm_on', 'show_pm_popup', 'auto_pm_subject', 'auto_pm_message', 'auto_pm_from'
Tiếp đó tìm cái đoạn này:
QUOTE
$ADMIN->html .= $SKIN->add_td_row( array( "<b>Debug level</b>" ,
$SKIN->form_dropdown( "debug_level",
array(
0 => array( 0, '0: None - Don\'t show any debug information' ),
1 => array( 1, '1: Show server load, page generation times and query count' ),
2 => array( 2, '2: Show level 1 (above) and GET and POST information'),
3 => array( 3, '3: Show level 1 + 2 and database queries'),
),
$INFO['debug_level'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "<b><i>ENABLE</I> SQL Debug Mode?</b><br>(If yes, add '&debug=1' to any page to view mySQL debug info)" ,
$SKIN->form_yes_no( "sql_debug", $INFO['sql_debug'] )
) );
Dán bên dưới:
QUOTE
//--------------------------------------------------------------------------------
$ADMIN->html .= $SKIN->add_td_basic( 'Auto PM To New Users', 'left', 'catrow2' );
//--------------------------------------------------------------------------------
$ADMIN->html .= $SKIN->add_td_row( array( "<b>Enable Auto PM?</b><br>(If yes, new users who register will get a PM from you)" ,
$SKIN->form_yes_no( "auto_pm_on", $INFO['auto_pm_on'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "<b>Show New Message Popup?</b><br>(If yes, when a user has registered and logs into there account it will popup the New PM window, else it will just show 1 New Messages.)" ,
$SKIN->form_yes_no( "show_pm_popup", $INFO['show_pm_popup'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "<b>New Registration PM From?</b><br>(The User ID to send the PM from when a new user joins)<br />You're User ID is: <b>".$MEMBER['id']."</b>" ,
$SKIN->form_input( "auto_pm_from", $INFO['auto_pm_from'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "<b>PM Subject</b><br>(The subject a new PM will have)" ,
$SKIN->form_input( "auto_pm_subject", $INFO['auto_pm_subject'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "<b>PM Sent to New Users</b><br>(Use *username* will replace that with the new users, username)" ,
$SKIN->form_textarea( "auto_pm_message", $INFO['auto_pm_message'] )
) );
Save và upload lên forum của bạn