[MOD] phpBB Delete my registration

แนะนำ Mod ต่างๆ ของ PHPBB3 แนะนำความสามารถ ของ mod การติดตั้ง การเข้ากันได้กับเวอร์ชั่น

Moderator: mindphp

buay
PHP Super Member
PHP Super Member
โพสต์: 250
ลงทะเบียนเมื่อ: 02/06/2014 9:55 am

[MOD] phpBB Delete my registration

โพสต์ที่ยังไม่ได้อ่าน โดย buay »

25-6-2557 11-31-08.png
25-6-2557 11-31-08.png (31.12 KiB) Viewed 9008 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

ค้นหา

โค้ด: เลือกทั้งหมด

            case 'profile_info':
 
เติมก่อน

โค้ด: เลือกทั้งหมด

            // 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
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 24