Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2005, 12:54 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default using dm to create thread reply and can't figure out how to get forumdisplay updated.

This is the code I'm using to create a thread reply, but how do I get the forumdisplay updated?

PHP Code:
require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$bythreadid '4375';
//$byparentid = '4375'; //not sure what this is for
$byusername 'testing';
$byuserid '0';
//$bytitle = 'testing'; //dont want a post title
$bypagetext 'This is a test';
$byallowsmilie '1';
$byshowsignature '1';
$byvisible '1';

$postdm->do_set('threadid'$bythreadid);
$postdm->do_set('username'$byusername);
$postdm->do_set('userid'$byuserid);
$postdm->do_set('title'$bytitle);
$postdm->do_set('pagetext'$bypagetext);
$postdm->do_set('allowsmilie'$byallowsmilie);
$postdm->do_set('showsignature'$byshowsignature);
$postdm->do_set('visible'$byvisible);
$postdm->save();
unset(
$postdm); 
Reply With Quote
  #2  
Old 10-28-2005, 02:40 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #3  
Old 10-28-2005, 02:49 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, it should do that automatically.
Are you sure it doesn't?
Is the forum moderated?
Reply With Quote
  #4  
Old 10-28-2005, 02:59 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
Hmm, it should do that automatically.
Are you sure it doesn't?
Is the forum moderated?
Nope, it doesn't. And nope, it isn't moderated. The post is there, but the thread doesn't even get bumped.

(The DM to create threads was the same way. It required calling build_forum_counters($forumid) after creating the thread to update everything)
Reply With Quote
  #5  
Old 10-28-2005, 03:05 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try

PHP Code:
$threadinfo fetch_threadinfo($bythreadid);
$foruminfo fetch_foruminfo($thread['forumid');
$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo); 
Before setting anything to the DM.
Reply With Quote
  #6  
Old 10-28-2005, 03:09 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
Try

PHP Code:
$threadinfo fetch_threadinfo($bythreadid);
$foruminfo fetch_foruminfo($thread['forumid');
$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo); 
Before setting anything to the DM.
Same result.

edit: Fixed it by adding
PHP Code:
require_once('./includes/functions_databuild.php'); 
    
build_thread_counters($bythreadid); 
imho, it should do all that automatically tho...
Reply With Quote
  #7  
Old 10-28-2005, 03:33 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php
require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$bythreadid '4375';

$threadinfo fetch_threadinfo($bythreadid);
$foruminfo fetch_foruminfo($threadinfo['forumid']);
$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo);  

$postdm->set('threadid'$bythreadid);
$postdm->set('username''testing');
$postdm->set('pagetext''This is a test');
$postdm->set('allowsmilie'1);
$postdm->set('visible'1);
$postdm->set('dateline'TIMENOW);
$postdm->save();
unset(
$postdm);
?>
You should never call do_set() directly, also if you are making a post for a guest don't set the userid.
Reply With Quote
  #8  
Old 10-28-2005, 05:11 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
PHP Code:
<?php
require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$bythreadid '4375';

$threadinfo fetch_threadinfo($bythreadid);
$foruminfo fetch_foruminfo($threadinfo['forumid']);
$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo);  

$postdm->set('threadid'$bythreadid);
$postdm->set('username''testing');
$postdm->set('pagetext''This is a test');
$postdm->set('allowsmilie'1);
$postdm->set('visible'1);
$postdm->set('dateline'TIMENOW);
$postdm->save();
unset(
$postdm);
?>
You should never call do_set() directly, also if you are making a post for a guest don't set the userid.

Neat! As usual, thanks for the help! <3
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 04:06 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.03984 seconds
  • Memory Usage 2,268KB
  • 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
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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