Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Supermods can edit user's custom titles via the ModCP Details »»
Supermods can edit user's custom titles via the ModCP
Version: 1.00, by j883376 j883376 is offline
Developer Last Online: Mar 2014 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 03-10-2006 Last Update: Never Installs: 15
Code Changes  
No support by the author.

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.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-24-2007, 02:25 PM
Soonerdude Soonerdude is offline
 
Join Date: Mar 2007
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need something like this for 3.6.x
Reply With Quote
  #13  
Old 04-24-2007, 02:30 PM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Soonerdude View Post
I need something like this for 3.6.x
Why don't you give it a try if it works for 3.6.x or not.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03820 seconds
  • Memory Usage 2,256KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete