โดย buay » 25/06/2014 11:48 am
- 25-6-2557 11-31-08.png (31.12 KiB) Viewed 9087 times
รายละเอียด : MOD นี้สามารถลบบัญชีผู้ใช้ของตัวเองได้
พัฒนาโดย : KillBill.
Version : 1.0.2
ดาวน์โหลดได้ที่ :
https://www.mindphp.com/download/files/1 ... n-zip.html
ไฟล์ที่ใช้ในการติดตั้ง
>>includes/ucp/info/ucp_profile.php,
>>includes/ucp/ucp_profile.php,
>>language/en/acp/common.php,
>>language/en/acp/permissions_phpbb.php,
>>language/en/ucp.php
วิธีติดตั้ง
เปิดไฟล์ : includes/ucp/info/ucp_profile.php
ค้นหา
โค้ด: เลือกทั้งหมด
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
เติมหลัง
โค้ด: เลือกทั้งหมด
// Start delete my registration
'my_acc_delete' => array('title' => 'UCP_PROFILE_MY_ACC_DELETE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
// End delete my registration
เปิดไฟล์ : includes/ucp/ucp_profile.php
ค้นหา
เติมก่อน
โค้ด: เลือกทั้งหมด
// Start delete my registration
case 'my_acc_delete':
$delete_acc = (!empty($_POST['delete_acc'])) ? true : false;
$delete_post = (!empty($_POST['delete_post']) && $auth->acl_get('u_my_acc_post_delete')) ? true : false;
$user_password = request_var('user_password', '', true);
add_form_key('my_acc_delete');
if ($submit)
{
if (!check_form_key('my_acc_delete'))
{
$error[] = 'FORM_INVALID';
}
if (!$delete_acc)
{
$error[] = 'MY_ACC_DELETE_CONFIRM_ERROR';
}
if ($user->data['user_type'] == USER_FOUNDER)
{
$error[] = 'MY_ACC_DELETE_FOUNDER_ERROR';
}
if (!phpbb_check_hash($user_password, $user->data['user_password']))
{
$error[] = 'CUR_PASSWORD_ERROR';
}
if (!sizeof($error) && $submit)
{
$delete_type = ($delete_post) ? 'remove' : 'retain';
$log_type = ($delete_post) ? 'LOG_MY_ACC_POST_DELETE' : 'LOG_MY_ACC_DELETE';
add_log('user', ANONYMOUS, $log_type, $user->data['username']);
user_delete($delete_type, $user->data['user_id'], $user->data['username']);
meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
trigger_error('MY_ACC_DELETE_SUCCESS');
}
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$template->assign_vars(array(
'S_ERROR' => (sizeof($error)) ? true : false,
'S_DELETE_MY_POST' => ($auth->acl_get('u_my_acc_post_delete')) ? true : false,
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'CONFIRM_CHECKED' => ($delete_acc) ? ' checked="checked"' : '',
'POST_CHECKED' => ($delete_post) ? ' checked="checked"' : ''
));
break;
// End delete my registration
เปิดไฟล์ : language/en/acp/common.php
ค้นหา
เติมก่อน
โค้ด: เลือกทั้งหมด
// Start delete my registration
$lang = array_merge($lang, array(
'LOG_MY_ACC_DELETE' => '<strong>Delete my registration</strong><br />» %s',
'LOG_MY_ACC_POST_DELETE' => '<strong>Delete my registration along with the posts.</strong><br />» %s',
));
// End delete my registration
เปิดไฟล์ : language/en/acp/permissions_phpbb.php,
ค้นหา
โค้ด: เลือกทั้งหมด
'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'),
เติมหลัง
โค้ด: เลือกทั้งหมด
// Start delete my registration
'acl_u_my_acc_post_delete'=> array('lang' => 'Can delete posts when deleting registration', 'cat' => 'profile'),
// End delete my registration
เปิดไฟล์ : language/en/ucp.php
ค้นหา
เติมก่อน
โค้ด: เลือกทั้งหมด
// Start delete my registration
$lang = array_merge($lang, array(
'MY_ACC_DELETE_CONFIRM' => 'Delete my registration confirmation',
'MY_ACC_DELETE_CONFIRM_ERROR' => 'Deletion of registration has not been confirmed!',
'MY_ACC_DELETE_EXPLAIN' => 'Delete my registration<br /><em>Please note, if you do then there is no way to restore your data!</em>',
'MY_ACC_DELETE_FOUNDER_ERROR' => 'Board founders can not delete their registration!',
'MY_ACC_DELETE_SUCCESS' => 'Registration is successfully deleted',
'MY_ACC_POST_DELETE' => 'Post delete',
'MY_ACC_POST_DELETE_EXPLAIN' => 'your posts will be deleted on the board',
'UCP_PROFILE_MY_ACC_DELETE' => 'Delete my registration',
));
// End delete my registration
*จากนั้นให้ทำการ คัดลอกไฟล์ทั้งหมดที่มี ในโฟลเดอร์ root ไปวางทับ
และทำการรันในหน้า install/index.php เพื่อทำการ install
[attachment=0]25-6-2557 11-31-08.png[/attachment]
[b]รายละเอียด[/b] : MOD นี้สามารถลบบัญชีผู้ใช้ของตัวเองได้
[b]พัฒนาโดย[/b] : KillBill.
[b]Version[/b] : 1.0.2
[b]ดาวน์โหลดได้ที่[/b] : [url]https://www.mindphp.com/download/files/109-109-phpbb-delete-my-registration-zip.html[/url]
[b]ไฟล์ที่ใช้ในการติดตั้ง[/b]
>>includes/ucp/info/ucp_profile.php,
>>includes/ucp/ucp_profile.php,
>>language/en/acp/common.php,
>>language/en/acp/permissions_phpbb.php,
>>language/en/ucp.php
[b][size=150][u]วิธีติดตั้ง[/u][/size][/b]
[b][color=#BF00FF]เปิดไฟล์ : includes/ucp/info/ucp_profile.php[/color][/b]
[b][color=#40BF40]ค้นหา[/color][/b]
[code=php]
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
[/code]
[b][color=#FF0000]เติมหลัง[/color][/b]
[code=php]
// Start delete my registration
'my_acc_delete' => array('title' => 'UCP_PROFILE_MY_ACC_DELETE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
// End delete my registration
[/code]
[b][color=#BF00FF]เปิดไฟล์ : includes/ucp/ucp_profile.php[/color][/b]
[b][color=#00BF40]ค้นหา[/color][/b]
[code=php]
case 'profile_info':
[/code]
[b][color=#4080FF]เติมก่อน[/color][/b]
[code=php]
// Start delete my registration
case 'my_acc_delete':
$delete_acc = (!empty($_POST['delete_acc'])) ? true : false;
$delete_post = (!empty($_POST['delete_post']) && $auth->acl_get('u_my_acc_post_delete')) ? true : false;
$user_password = request_var('user_password', '', true);
add_form_key('my_acc_delete');
if ($submit)
{
if (!check_form_key('my_acc_delete'))
{
$error[] = 'FORM_INVALID';
}
if (!$delete_acc)
{
$error[] = 'MY_ACC_DELETE_CONFIRM_ERROR';
}
if ($user->data['user_type'] == USER_FOUNDER)
{
$error[] = 'MY_ACC_DELETE_FOUNDER_ERROR';
}
if (!phpbb_check_hash($user_password, $user->data['user_password']))
{
$error[] = 'CUR_PASSWORD_ERROR';
}
if (!sizeof($error) && $submit)
{
$delete_type = ($delete_post) ? 'remove' : 'retain';
$log_type = ($delete_post) ? 'LOG_MY_ACC_POST_DELETE' : 'LOG_MY_ACC_DELETE';
add_log('user', ANONYMOUS, $log_type, $user->data['username']);
user_delete($delete_type, $user->data['user_id'], $user->data['username']);
meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
trigger_error('MY_ACC_DELETE_SUCCESS');
}
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$template->assign_vars(array(
'S_ERROR' => (sizeof($error)) ? true : false,
'S_DELETE_MY_POST' => ($auth->acl_get('u_my_acc_post_delete')) ? true : false,
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'CONFIRM_CHECKED' => ($delete_acc) ? ' checked="checked"' : '',
'POST_CHECKED' => ($delete_post) ? ' checked="checked"' : ''
));
break;
// End delete my registration
[/code]
[b][color=#BF00FF]เปิดไฟล์ : language/en/acp/common.php[/color][/b]
[b][color=#00BF40]ค้นหา[/color][/b]
[code=php]
?>
[/code]
[b][color=#4080FF]เติมก่อน[/color][/b]
[code=php]
// Start delete my registration
$lang = array_merge($lang, array(
'LOG_MY_ACC_DELETE' => '<strong>Delete my registration</strong><br />» %s',
'LOG_MY_ACC_POST_DELETE' => '<strong>Delete my registration along with the posts.</strong><br />» %s',
));
// End delete my registration
[/code]
[b][color=#BF00FF]เปิดไฟล์ : language/en/acp/permissions_phpbb.php,[/color][/b]
[b][color=#00BF40]ค้นหา[/color][/b]
[code=php]
'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'),
[/code]
[b][color=#FF0000]เติมหลัง[/color][/b]
[code=php]
// Start delete my registration
'acl_u_my_acc_post_delete'=> array('lang' => 'Can delete posts when deleting registration', 'cat' => 'profile'),
// End delete my registration
[/code]
[b][color=#BF00FF]เปิดไฟล์ : language/en/ucp.php[/color][/b]
[b][color=#00BF40]
ค้นหา[/color][/b]
[code=php]
?>
[/code]
[b][color=#4080FF]เติมก่อน[/color][/b]
[code=php]
// Start delete my registration
$lang = array_merge($lang, array(
'MY_ACC_DELETE_CONFIRM' => 'Delete my registration confirmation',
'MY_ACC_DELETE_CONFIRM_ERROR' => 'Deletion of registration has not been confirmed!',
'MY_ACC_DELETE_EXPLAIN' => 'Delete my registration<br /><em>Please note, if you do then there is no way to restore your data!</em>',
'MY_ACC_DELETE_FOUNDER_ERROR' => 'Board founders can not delete their registration!',
'MY_ACC_DELETE_SUCCESS' => 'Registration is successfully deleted',
'MY_ACC_POST_DELETE' => 'Post delete',
'MY_ACC_POST_DELETE_EXPLAIN' => 'your posts will be deleted on the board',
'UCP_PROFILE_MY_ACC_DELETE' => 'Delete my registration',
));
// End delete my registration
[/code]
*จากนั้นให้ทำการ คัดลอกไฟล์ทั้งหมดที่มี ในโฟลเดอร์ root ไปวางทับ
และทำการรันในหน้า install/index.php เพื่อทำการ install