Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 07-16-2005, 12:14 AM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default build_new_post posting with wrong userid??

I was trying to have a thread auto created. This was working fine, but the other day is created the post with the wrong userid.

PHP Code:
$userid 2746;
$forumid 84;
$foruminfo fetch_foruminfo($forumid);
$bbuserinfo fetch_userinfo($userid);
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo[userid] . $bbuserinfo[salt]);
       
build_new_post('thread'$foruminfo, array(), 0$post$errors); 
So instead of userid 2746 for the thread starter, it was someone else completely.

I thought maybe $userid was being updated elsewhere in some other script and just happened to mess up my script. So I figured I would change the userid to something unique.

PHP Code:
$x_userid 2746;
$x_forumid 84;
$x_foruminfo fetch_foruminfo($x_forumid);
$x_bbuserinfo fetch_userinfo($x_userid);
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $x_bbuserinfo[userid] . $x_bbuserinfo[salt]);
       
build_new_post('thread'$x_foruminfo, array(), 0$post$errors); 
I tried this with leaving $post as is, or changing it to a new variable as well. But no matter what, this code would not make the thread.

The old code works fine except for the one time when it posted under the wrong user name. So I am trying to understand what the problem could have been.

Any ideas?

Thanks

Jake
Reply With Quote
  #2  
Old 07-16-2005, 12:20 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The new code, for some reason, always uses $bbuserinfo to get the posterid - no matter what you pass it.

I solved this for myself by making the post and then immediately updating the post, thread, and forum info with the correct userid and username.

Check my automatic thread on registration mod to see what I mean.

Amy
Reply With Quote
  #3  
Old 07-16-2005, 12:24 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The old code should work - if this is for vBulletin 3.0.X.

For vBulletin 3.5, you must overwrite $vbulletin->userinfo instead of $bbuserinfo
Reply With Quote
  #4  
Old 07-16-2005, 01:10 AM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This if for 3.0.7.

If I need to update the thread and post after I make the message, how can I get their respective id numbers?

Thanks
Reply With Quote
  #5  
Old 07-16-2005, 01:35 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's in the post[postid] and post[threadid] values after the post is made.
Reply With Quote
  #6  
Old 07-16-2005, 02:03 AM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, thanks
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 07:59 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.03643 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete