Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 07-08-2014, 08:07 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

https://members.vbulletin.com/api/vB...pdate_username

There you go.
Reply With Quote
  #12  
Old 07-08-2014, 08:07 PM
Shalom. Shalom. is offline
 
Join Date: Jun 2014
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
First, it would have been nice if you showed your code, when your asking for assistance time.
Second, where is your query_write?
Third, use the datamanager you will have less problems. See "class_user_dm.php". There are several examples here on the board on how to use the datamanagers. I will see if I can find you a reference.

1.i can send u the code on pm..
2.i cant find this file..
3.please give me one.
Reply With Quote
  #13  
Old 07-08-2014, 08:09 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update: I see in post #6, #8, this was already covered. I was on the phone so long my post is barely relevant anymore.
Reply With Quote
  #14  
Old 07-08-2014, 08:12 PM
Shalom. Shalom. is offline
 
Join Date: Jun 2014
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
update_username (integer $userid, [string $username = null])
>
update_username ($userid, $newusername)

its good ?
Reply With Quote
  #15  
Old 07-08-2014, 08:14 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Send or post your code, and you have already started to use the datamanager. That is the approach you should be taking.
Reply With Quote
  #16  
Old 07-08-2014, 08:14 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Shalom. View Post
update_username (integer $userid, [string $username = null])
>
update_username ($userid, $newusername)

its good ?
Exactly.
Now integrate it with the piece of code you posted earlier which uses the datamanager.
Reply With Quote
  #17  
Old 07-08-2014, 08:25 PM
Shalom. Shalom. is offline
 
Join Date: Jun 2014
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Exactly.
Now integrate it with the piece of code you posted earlier which uses the datamanager.
sry, but i dont understand u
Reply With Quote
  #18  
Old 07-08-2014, 08:48 PM
mokujin's Avatar
mokujin mokujin is offline
 
Join Date: Oct 2005
Location: Czech
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Run this query in phpmyadmin, hope it helps:

PHP Code:
UPDATE post SET username 'New  User Name Here' WHERE userid $userid 
Reply With Quote
  #19  
Old 07-08-2014, 09:18 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This should work:

PHP Code:
    global $vbulletin;

    
// error processing for the datamanager if needed.
    
require_once "d:/servers/z421/web/bbs/includes/adminfunctions.php";  
 
    
// Existing User
    
$userid  6;             // Existing User ID
    
$newusername 'david1';  // New user name string (cleaned)

    
$userdata =& datamanager_init('User'$vbulletinERRTYPE_CP);
    
$userinfo fetch_userinfo($userid);
    
$userdata->set_existing($userinfo);
    
$userdata->set('username'$newusername);
    
$userdata->save();
    unset(
$userdata); 
I ran a quick test.

Looking at what you were doing, I am guessing you can take it from here.
Reply With Quote
2 благодарности(ей) от:
ForceHSS, Shalom.
  #20  
Old 07-08-2014, 10:05 PM
Shalom. Shalom. is offline
 
Join Date: Jun 2014
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
This should work:

PHP Code:
    global $vbulletin;

    
// error processing for the datamanager if needed.
    
require_once "d:/servers/z421/web/bbs/includes/adminfunctions.php";  
 
    
// Existing User
    
$userid  6;             // Existing User ID
    
$newusername 'david1';  // New user name string (cleaned)

    
$userdata =& datamanager_init('User'$vbulletinERRTYPE_CP);
    
$userinfo fetch_userinfo($userid);
    
$userdata->set_existing($userinfo);
    
$userdata->set('username'$newusername);
    
$userdata->save();
    unset(
$userdata); 
I ran a quick test.

Looking at what you were doing, I am guessing you can take it from here.
thanks, it work's !
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:56 PM.


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.07793 seconds
  • Memory Usage 2,275KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete