vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   post a reply using build_new_post function (https://vborg.vbsupport.ru/showthread.php?t=74484)

lowspeed 01-16-2005 11:54 PM

post a reply using build_new_post function
 
I have a thread lets say # 1091

How do i submit a reply to that thread using build_new_post ?


I tried doing something like this ...

PHP Code:

chdir('../vb'); 
$phrasegroups = array(); 

// get special data templates from the datastore 
$specialtemplates = array(); 

// pre-cache templates used by all actions 
$globaltemplates = array(); 

// pre-cache templates used by specific actions 
$actiontemplates = array(); 
 
require_once(
'global.php');
require_once(
'includes/functions_newpost.php');
$post = array();

$userid 1;    // i picked this
$forumid 8;   // i picked this

$foruminfo fetch_foruminfo($forumid); 
$bbuserinfo fetch_userinfo($userid); 

 
//$post[title] = '';   // dont want new title for reply
$post[message] = 'The reply body'
$post[poststarttime] = TIMENOW
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']); 

build_new_post('reply'$foruminfo, array(), 1091$post$errors);    // theard 1091 which i picked

echo ("<br>*********************** ".$post['threadid']);

chdir('../outside'); 


But it doesn't work :( can someone please help ?

Thanks a bunch !

lowspeed 01-17-2005 05:18 PM

Ok i found how to do it

You need these added:

$threadid=1091; // the thread you want to reply to
$threadinfo = fetch_threadinfo($threadid);

build_new_post('reply', $foruminfo, $threadinfo, $_POST['postid'], $post, $errors);

Cibox.de 02-04-2005 12:24 AM

Hi,
I tried your code including your corrections, but it didn't work.
Could it be, that I forgot something?
It would be great, if you could post the whole working code.

Thanks in advance

Commander-X 01-19-2010 11:00 AM

Hello are you submitting a reply outside vb pages?


All times are GMT. The time now is 06:22 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.01073 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete