Back to vBulletin 3.5 Add-ons

Supermods can edit user's custom titles via the ModCP
Mod Version: 1.00, by j883376

This modification is in the archives.
vB Version: 3.5.4 Rating: (1 vote - 5.00 average) Installs: 15
Released: 11 Mar 2006 Last Update: Never Downloads: 1
Not Supported Code Changes  

As some of you may or may not know, a Supermod has a couple of good, but also very limited tools when it comes to editing a user. The built in functions are as follows

[Ban User] [View Profile] [Change Signature] [Change Avatar] [Change Profile Picture]

Now, if they can ban them, edit their sig, their avatar, and their profile picture, why shouldn't they be able to edit the member's custom title?
Once installed, Supermods will have a new option in their ModCP when they search for a user labeled [Change Custom Title]

This hack requires 3 edits to the file user.php which can be found in the modcp directory of your forums.

Find
PHP Code:
print_table_header(construct_phrase($vbphrase['showing_users_x_to_y_of_z'], '1'$db->num_rows($users), $db->num_rows($users)), 7); 
And change it to
PHP Code:
print_table_header(construct_phrase($vbphrase['showing_users_x_to_y_of_z'], '1'$db->num_rows($users), $db->num_rows($users)), 8); 
Next, you must find
PHP Code:
$cell[] = iif($caneditavatar'<span class="smallfont">' construct_link_code($vbphrase['change_avatar'], 'user.php?' $vbulletin->session->vars['sessionurl'] . "do=avatar&amp;u=$user[userid]") . '</span>'); 
Below that add:
PHP Code:
$cell[] = iif($caneditavatar'<span class="smallfont">' construct_link_code($vbphrase['change_title'], "user.php?$session[sessionurl]do=usertitle&amp;u=$user[userid]") . '</span>'); 
Finally, find
PHP Code:
// ###################### Start editsig ####################### 
Above it add:
PHP Code:
// ###################### Start usertitle ######################

if ($_REQUEST['do'] == 'usertitle')
{

if (!
can_moderate(0'caneditavatar'))
{
print_stop_message('no_permission_avatars');
}
$noalter explode(','$vbulletin->config['SpecialUsers']['undeletableusers']);
if (!empty(
$noalter[0]) AND in_array($vbulletin->GPC['userid'], $noalter))
{
print_stop_message('user_is_protected_from_alteration_by_undeletableusers_var');
}
print_form_header('user','dousertitle');
print_table_header('Change usertitle');
if (empty(
$vbulletin->GPC['userid']))
{
print_stop_message('invalid_user_specified');
}
construct_hidden_code('userid'$vbulletin->GPC['userid']);
print_input_row($vbphrase['user_title'], 'usertitle'$user['usertitle']);
print_select_row($vbphrase['custom_user_title'], 'customtitle', array(=> $vbphrase['no'], => $vbphrase['yes'], => $vbphrase['yes_but_not_parsing_html']), $user['customtitle']);
print_submit_row('Save','Reset');
print_table_footer();
}

// ###################### Start dousertitle ######################

if ($_REQUEST['do'] == 'dousertitle')
{
$vbulletin->input->clean_array_gpc('p', array(
        
'usertitle'      => TYPE_STR,
        
'customtitle'      => TYPE_INT
));

if (!
can_moderate(0'caneditavatar'))
{
print_stop_message('no_permission_avatars');
}
$noalter explode(','$vbulletin->config['SpecialUsers']['undeletableusers']);
if (!empty(
$noalter[0]) AND in_array($vbulletin->GPC['userid'], $noalter))
{
print_stop_message('user_is_protected_from_alteration_by_undeletableusers_var');
}

$userinfo fetch_userinfo($vbulletin->GPC['userid']);


# silent error type -- none of the functions used here can actually produce errors, so :)
$userdm =& datamanager_init('User'$vbulletinERRTYPE_SILENT);
# load the user into the datamanager
$userdm->set_existing($userinfo); 
# call the usertitle function with appropriate parameters
$userdm->set_usertitle($vbulletin->GPC['usertitle'], false$vbulletin->usergroupcache["$userinfo[usergroupid]"], true$permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] );
$userdm->save(); 
if (
can_moderate(0'canviewprofile'))
{
define('CP_REDIRECT'"user.php?do=viewuser&amp;u=" $vbulletin->GPC['userid']);
}
else
{
define('CP_REDIRECT'"index.php?do=home");
}

print_stop_message('saved_user_title_x_successfully'$vbulletin->GPC['usertitle']);

You need also make a phrase for it to display the words Custom Title in the ModCP

ACP > Languages & Phrases > Phrase Manager > Add New Phrase

Phrase Type: Control Panel User Management
Product: vBulletin
Varname: change_title
Text: Change Title

You're all done! Now go check the ModCP and you should have a nice new option to change the custom title.

Download

No files for download.

Supporters / CoAuthors

  • Soup

Similar Mods

SuperMods can Unban from ModCP! vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2025