هاست لینوکس

آخرین بسته‌ی MyBB: نسخه‌ی 1.8.27 MyBB منتشر شد


امتیاز موضوع:
  • 0 رأی - میانگین امتیازات: 0
  • 1
  • 2
  • 3
  • 4
  • 5
تغییر تکه کدی از پلاگین
#1
سلام

این کد:


+
کد php:
<?php

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("modcp_start""modchangeuser_modcpstart");

function 
modchangeuser_info()
{
    return array(
        
"name"            => "Moderators can change username",
        
"description"    => "Allows moderators to change usernames from ModCP",
        
"website"        => "http://www.galacticcode.com",
        
"author"        => "TimB.",
        
"authorsite"    => "http://www.galacticcode.com",
        
"version"        => "1.0",
        
"guid"             => "8f7a3cf97660cd446aa9013e132a6522",
        
"compatibility" => "18*"
    
);
}




function 
modchangeuser_modcpstart()
{
    global 
$templates$mybb$lang;
    
    
    if((
$mybb->input['action'] == "editprofile") or ($mybb->input['action'] == "do_editprofile")){
        
            
$user get_user($mybb->input['uid']);
            if(!
$user['uid'])
            {
                
error($lang->invalid_user);
            }
        
            if(!
$templates->cache['modcp_editprofile']) $templates->cache('modcp_editprofile');
                
$templates->cache['modcp_editprofile'] = str_replace('<strong>{$profile_link}</strong>'"
                <input type=\"text\" name=\"username\" value=\""
.$user['username']."\"/>"$templates->cache['modcp_editprofile']);
            }

    if(
$mybb->input['action'] == "do_editprofile"){
        require_once 
"inc/datahandlers/user.php";
        
$mcu_userhandler = new UserDataHandler("update");

        
$mcu_user = array(
            
"uid" => $mybb->input['uid'],
            
"username" => $mybb->input['username']
        );

        
$mcu_userhandler->set_data($mcu_user);
        
$errors '';
        
        if(!
$mcu_userhandler->validate_user())
        {
            
$errors $mcu_userhandler->get_friendly_errors();
            
error($errors[0]);
        }
        if(
$mybb->usergroup['canmodcp'] == 1){
            
$mcu_userhandler->update_user();
        }
    }
    
}
?>


مربوط به یه پلاگین هست که اجازه میده هرکی پنل ناظم داره بتونه نام کاربری هارو تغییر بده ..
میخواستم اینو جوری تغییر بدید که خودمون تعریف کنیم چه گروهی بتونه عمله تغییر نام کاربری رو انجام بده ..
کد های php رو هرجور تغییر دادم نتونستم این تغییر دلخواهم رو انجام بدم.
نصب مای بی بی - نصب قالب - ترجمه پلاگین - ترجمه قالب و پوسته - نصب انواع اسکریپت - پشتیبانی سایت شما -
نصب آپلودسنتر اختصاصی - شخصی سازی انجمن شما
پاسخ


پیام‌های داخل این موضوع
تغییر تکه کدی از پلاگین - توسط MISTER - ۱۳۹۹/۱۱/۲۲، ۱۵:۱۲:۴۷ عصر
RE: تغییر تکه کدی از پلاگین - توسط MISTER - ۱۳۹۹/۱۱/۲۴، ۲۲:۱۰:۰۷ عصر
RE: تغییر تکه کدی از پلاگین - توسط Mohammad-Za - ۱۳۹۹/۱۱/۲۵، ۰۰:۲۰:۲۰ صبح
RE: تغییر تکه کدی از پلاگین - توسط MISTER - ۱۳۹۹/۱۱/۲۶، ۰۳:۳۰:۴۲ صبح
RE: تغییر تکه کدی از پلاگین - توسط firstboy000 - ۱۳۹۹/۱۱/۲۶، ۱۳:۵۸:۳۸ عصر
RE: تغییر تکه کدی از پلاگین - توسط MISTER - ۱۳۹۹/۱۱/۲۶، ۱۹:۲۶:۱۱ عصر
RE: تغییر تکه کدی از پلاگین - توسط Mohammad-Za - ۱۳۹۹/۱۱/۳۰، ۱۸:۵۲:۴۴ عصر
RE: تغییر تکه کدی از پلاگین - توسط MISTER - ۱۳۹۹/۱۲/۱، ۰۱:۱۹:۰۹ صبح

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان