Okay, I knew it wasn't that easy. Let me tell you what I'm doing. I want to add a custom admincp permissions.
In adminpermission.php there is:
PHP Code:
$permsphrase = array(
'canadminsettings' => $vbphrase['can_administer_settings'],
'canadminstyles' => $vbphrase['can_administer_styles'],
'canadminlanguages' => $vbphrase['can_administer_languages'],
'canadminforums' => $vbphrase['can_administer_forums'],
'canadminthreads' => $vbphrase['can_administer_threads'],
'canadmincalendars' => $vbphrase['can_administer_calendars'],
'canadminusers' => $vbphrase['can_administer_users'],
'canadminpermissions' => $vbphrase['can_administer_user_permissions'],
'canadminfaq' => $vbphrase['can_administer_faq'],
'canadminimages' => $vbphrase['can_administer_images'],
'canadminbbcodes' => $vbphrase['can_administer_bbcodes'],
'canadmincron' => $vbphrase['can_administer_cron'],
'canadminmaintain' => $vbphrase['can_run_maintenance'],
'canadminupgrade' => $vbphrase['can_run_upgrades'],
'canadminplugins' => $vbphrase['can_administer_plugins'],
);
($hook = vBulletinHook::fetch_hook('admin_permissions')) ? eval($hook) : false;
A few lines under is:
PHP Code:
if ($_REQUEST['do'] == 'edit')
{
print_form_header('adminpermissions', 'update');
construct_hidden_code('userid', $vbulletin->GPC['userid']);
construct_hidden_code('oldpermissions', $user['adminpermissions']);
print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['administrator_permissions'], $user['username'], $user['userid']));
print_label_row("$vbphrase[administrator]: <a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=" . $vbulletin->GPC['userid'] . "\">$user[username]</a>", '<div align="' . $stylevar['right'] .'"><input type="button" class="button" value=" ' . $vbphrase['all_yes'] . ' " onclick="js_check_all_option(this.form, 1);" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="js_check_all_option(this.form, 0);" /></div>', 'thead');
foreach (convert_bits_to_array($user['adminpermissions'], $ADMINPERMISSIONS) AS $field => $value)
{
if ($field == 'canadminupgrade')
{
construct_hidden_code("adminpermissions[$field]", $value);
}
else
{
print_yes_no_row($permsphrase["$field"], "adminpermissions[$field]", $value);
}
}
print_select_row($vbphrase['control_panel_style_choice'], 'cssprefs', array_merge(array('' => "($vbphrase[default])"), fetch_cpcss_options()), $user['cssprefs']);
print_submit_row();
}
As you can see my edit which would be:
PHP Code:
$permsphrase['canadmintextreplacements'] = $vbphrase['can_administer_text_replacements'];
I was hoping to figure out how to add custom admin perms using the hooks system for my modification, but it's not as easy as I thought. I thought I almost had it and was going make a tutorial, but I'm a little frustrated with this.
Do you plan on releasing such a tutorial?
I was alittle embarrassed at first.