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
  #2  
Old 03-11-2006, 03:03 AM
hiiped hiiped is offline
 
Join Date: Jan 2006
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is cool

thanks
Reply With Quote
  #3  
Old 03-11-2006, 03:41 AM
j883376 j883376 is offline
 
Join Date: Mar 2005
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hiiped
This is cool

thanks
If you install it, please click Install.
Reply With Quote
  #4  
Old 03-11-2006, 07:04 PM
OWNAGE TIME OWNAGE TIME is offline
 
Join Date: Feb 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good job man thanks.

~Ownage
Reply With Quote
  #5  
Old 03-12-2006, 05:37 PM
j883376 j883376 is offline
 
Join Date: Mar 2005
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wish there were hooks inside of those 2 spots so I wouldn't need to have a Code Modification for this and could use a plugin
Reply With Quote
  #6  
Old 03-16-2006, 08:20 PM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice! Thanks man!
Reply With Quote
  #7  
Old 03-28-2006, 11:45 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack. Thanks!
Reply With Quote
  #8  
Old 03-29-2006, 09:55 PM
j883376 j883376 is offline
 
Join Date: Mar 2005
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Aftermath
Cool hack. Thanks!
Please hit Install if you install this hack
Reply With Quote
  #9  
Old 04-09-2006, 11:59 AM
Deagle Man Deagle Man is offline
 
Join Date: Jan 2006
Location: Australia
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

GREAT hack. Thank you very much.

/me clicks install
Reply With Quote
  #10  
Old 04-29-2006, 10:28 PM
Sir Rb Sir Rb is offline
 
Join Date: Dec 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awsome
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 06:07 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04788 seconds
  • Memory Usage 2,326KB
  • Queries Executed 26 (?)
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
  • (2)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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