สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $boarddir/index.php
ค้นหา -->>
'activate' => array('Register.php', 'Activate'),
เพิ่มไว้หลัง -->>
'usercp' => array('usercp.php', 'usercp'),
file $themedir/index.template.php
ค้นหา -->>
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
เพิ่มไว้หลัง -->>
loadLanguage('usercp');
file $sourcedir/Subs.php
ค้นหา -->>
// Set up the menu privileges.
$context['allow_search'] = allowedTo('search_posts');
$context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys'));
$context['allow_edit_profile'] = !$user_info['is_guest'] && allowedTo(array('profile_view_own', 'profile_view_any', 'profile_identity_own', 'profile_identity_any', 'profile_extra_own', 'profile_extra_any', 'profile_remove_own', 'profile_remove_any', 'moderate_forum', 'manage_membergroups'));
แก้เป็น -->>
// Set up the menu privileges.
$context['allow_search'] = allowedTo('search_posts');
$context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys'));
$context['usercp_enable'] = !$user_info['is_guest'] && $modSettings['usercp_enable'] && allowedTo(array('profile_view_own', 'profile_view_any', 'profile_identity_own', 'profile_identity_any', 'profile_extra_own', 'profile_extra_any', 'profile_remove_own', 'profile_remove_any', 'moderate_forum', 'manage_membergroups'));
$context['allow_edit_profile'] = !$user_info['is_guest'] && !$modSettings['usercp_enable'] && allowedTo(array('profile_view_own', 'profile_view_any', 'profile_identity_own', 'profile_identity_any', 'profile_extra_own', 'profile_extra_any', 'profile_remove_own', 'profile_remove_any', 'moderate_forum', 'manage_membergroups'));
ค้นหา -->>
'pm' => array(
เพิ่มไว้ก่อน -->>
'usercp' => array(
'title' => $txt['usercp'],
'href' => $scripturl . '?action=usercp',
'show' => $context['usercp_enable'],
'sub_buttons' => array(
),
),
file $sourcedir/Admin.php
ค้นหา -->>
loadLanguage('Admin');
เพิ่มไว้หลัง -->>
loadLanguage('usercp');
ค้นหา -->>
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
เพิ่มไว้ก่อน -->>
'usercp' => array($txt['usercp']),
file $sourcedir/ManageSettings.php
ค้นหา -->>
// Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
เพิ่มไว้หลัง -->>
'usercp' => 'ModifyUserCPSettings',
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
function ModifyUserCPSettings($return_config = false)
{
global $txt, $scripturl, $context, $settings, $sc;
$config_vars = array(
array('check', 'usercp_enable'),
array('check', 'usercp_switchview'),
array ('check', 'usercp_enablecontactadmin'),
array('check', 'usercp_usepm'),
array('text', 'usercp_adminid'),
array('text', 'usercp_contact_email'),
'',
array ('check', 'usercp_enable_account'),
array ('check', 'usercp_enable_layout'),
array ('check', 'usercp_enable_theme'),
array ('check', 'usercp_enable_profile'),
array ('check', 'usercp_enable_stats'),
array ('check', 'usercp_enable_contributions'),
array ('check', 'usercp_enable_notifications'),
array ('check', 'usercp_enable_buddies'),
array ('check', 'usercp_enable_message_options'),
array ('check', 'usercp_enable_search'),
array ('check', 'usercp_enable_delete'),
array ('check', 'usercp_enable_authentication'),
array ('check', 'usercp_enable_group_membership'),
array ('check', 'usercp_enable_ignore_boards'),
'',
array('text', 'usercp_field1image'),
array('text', 'usercp_field1url'),
array('text', 'usercp_field1maintext'),
array('text', 'usercp_field1summary'),
array('check', 'usercp_field1enable'),
'',
array('text', 'usercp_field2image'),
array('text', 'usercp_field2url'),
array('text', 'usercp_field2maintext'),
array('text', 'usercp_field2summary'),
array('check', 'usercp_field2enable'),
'',
array('text', 'usercp_field3image'),
array('text', 'usercp_field3url'),
array('text', 'usercp_field3maintext'),
array('text', 'usercp_field3summary'),
array('check', 'usercp_field3enable'),
'',
array('text', 'usercp_field4image'),
array('text', 'usercp_field4url'),
array('text', 'usercp_field4maintext'),
array('text', 'usercp_field4summary'),
array('check', 'usercp_field4enable'),
'',
);
if ($return_config)
return $config_vars;
// Saving?
if (isset($_GET['save']))
{
checkSession();
saveDBSettings($config_vars);
redirectexit('action=admin;area=modsettings;sa=usercp');
}
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=usercp';
$context['settings_title'] = $txt['usercp'];
prepareDBSettingContext($config_vars);
}
ดาวน์โหลด: UserCP2.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Comแตกไฟล์แล้วอัพโหลดไปไว้ที่
folder usercp -->> $imagesdir
file usercp.php -->> $sourcedir
file usercp.template.php -->> $themedir
file name="usercp.english.php -->> $languagedir
file name="usercp.thai-utf8.php -->> $languagedir
สร้างไฟล์: install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install.php -->> Enter เสร็จแล้วลบทิ้ง
<?php
function doSettings($addSettings, $smf2 = true)
{
global $smcFunc, $db_prefix;
$update = array();
foreach ($addSettings as $variable => $s)
{
list ($value, $overwrite) = $s;
$result = $smcFunc['db_query']('', '
SELECT value
FROM {db_prefix}settings
WHERE variable = {string:variable}',
array(
'variable' => $variable,
)
);
if ($smcFunc['db_num_rows']($result) == 0 || $overwrite == false)
$update[$variable] = $value;
}
if (!empty($update))
updateSettings($update);
}
// USAGE
$addSettings = array(
'usercp_enable' => array(1, false),
'usercp_enablecontactadmin' => array(1, false),
'usercp_switchview' => array(1, false),
'usecp_showadminid' => array(1, false),
'usercp_contact_email' => array('Your Email Here', false),
'usercp_usepm' => array(0, false),
'usercp_adminid' => array('1', false),
'usercp_enable_account' => array(1, false),
'usercp_enable_layout' => array(1, false),
'usercp_enable_theme' => array(1, false),
'usercp_enable_profile' => array(1, false),
'usercp_enable_stats' => array(1, false),
'usercp_enable_contributions' => array(1, false),
'usercp_enable_notifications' => array(1, false),
'usercp_enable_buddies' => array(1, false),
'usercp_enable_message_options' => array(1, false),
'usercp_enable_search' => array(1, false),
'usercp_enable_delete' => array(1, false),
'usercp_enable_authentication' => array(1, false),
'usercp_enable_group_membership' => array(1, false),
'usercp_enable_ignore_boards' => array(1, false),
'usercp_field1image' => array('Your Image Here', false),
'usercp_field1url' => array('Your URL Here', false),
'usercp_field1maintext' => array('Your Text Here', false),
'usercp_field1summary' => array('Your Text Here', false),
'usercp_field1enable' => array('0', false),
'usercp_field2image' => array('Your Image Here', false),
'usercp_field2url' => array('Your URL Here', false),
'usercp_field2maintext' => array('Your Text Here', false),
'usercp_field2summary' => array('Your Text Here', false),
'usercp_field2enable' => array('0', false),
'usercp_field3image' => array('Your Image Here', false),
'usercp_field3url' => array('Your URL Here', false),
'usercp_field3maintext' => array('Your Text Here', false),
'usercp_field3summary' => array('Your Text Here', false),
'usercp_field3enable' => array('0', false),
'usercp_field4image' => array('Your Image Here', false),
'usercp_field4url' => array('Your URL Here', false),
'usercp_field4maintext' => array('Your Text Here', false),
'usercp_field4summary' => array('Your Text Here', false),
'usercp_field4enable' => array('0', false),
// 'variable name' => array(value, overwrite)
);
doSettings($addSettings);
?>
ลิงค์หัวข้อ:
http://dexmore.com/topic/1951