vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Create New Thread with Non-vB Script (https://vborg.vbsupport.ru/showthread.php?t=207400)

myHybridcar.com 03-08-2009 04:34 PM

It's there. All 20 pages of it.

Dismounted 03-09-2009 05:06 AM

Instead of the current data manager call, try:
PHP Code:

$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost'); 


myHybridcar.com 03-09-2009 05:40 AM

No dice.

Would it matter at all that I'm defining $threaddm twice?
PHP Code:

error_reporting(E_ALL & ~E_NOTICE); 

        require_once(
'/home/myhybrid/www/forums/includes/functions_misc.php');
        require_once(
'/home/myhybrid/www/forums/includes/class_dm.php');
        require_once(
'/home/myhybrid/www/forums/includes/class_dm_threadpost.php');
        
        
$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost'); 

        
$forumid=36;
        
$vb_username=$vbulletin->userinfo['username'];
        
$body="Comments for $vb_username\'s $year $make $model, <a href=\'/fueleconomy/view_car.php?cid=$cid\'>\"$name\"</a>.";
        
        global 
$vbulletin$botpermissons$vbphrase;
        
$userinfo=fetch_userinfo($vb_uid);
        
$threadinfo=array(); 
        
$foruminfo=fetch_foruminfo($forumid); 
        
$threaddm=new vB_DataManager_Thread_FirstPost($vbulletinERRTYPE_STANDARD); 
        
$threaddm->set_info('forum'$foruminfo); 
        
$threaddm->set('forumid'$forumid);
        
$threaddm->set('userid'1); 
        
$threaddm->set('title'$name); 
        
$threaddm->set('pagetext'$body);  
        
$threaddm->set('open'1); 
        
$threaddm->set('allowsmilie'1); 
        
$threaddm->set('visible'1); 
        
$threaddm->pre_save(); 
        
$threadid $threaddm->save(); 
        unset(
$threaddm); 


Dismounted 03-09-2009 06:07 AM

Ah, I missed that. You should not instantiate the DM by yourself - datamanager_init() does this for you.

myHybridcar.com 03-13-2009 11:18 PM

*sigh* Still can't get it working :(
PHP Code:

error_reporting(E_ALL & ~E_NOTICE); 

        require_once( 
'/home/myhybrid/www/forums/includes/functions_misc.php' );
        require_once( 
'/home/myhybrid/www/forums/includes/class_dm.php' );
        require_once( 
'/home/myhybrid/www/forums/includes/class_dm_threadpost.php' );
        
        
$threaddm =& datamanager_init'Thread_FirstPost', &$vbulletinERRTYPE_ARRAY'threadpost' ); 

        
$forumid=36;
        
$vb_username=$vbulletin->userinfo['username'];
        
$body="Comments for $vb_username\'s $year $make $model, <a href=\'/fuel-economy/$mms[$mid]/$cidstrtolowercleanMRURL$name ) ) . ".html\'>\"$name\"</a>.";
        
        global 
$vbulletin$botpermissons$vbphrase;
        
$userinfo=fetch_userinfo($vb_uid);
        
$threadinfo=array(); 
        
$foruminfo=fetch_foruminfo($forumid); 
        
$threaddm->set_info'forum'$foruminfo); 
        
$threaddm->set'forumid'$forumid);
        
$threaddm->set'userid'1); 
        
$threaddm->set'title'$name); 
        
$threaddm->set'pagetext'$body);  
        
$threaddm->set'open'1); 
        
$threaddm->set'allowsmilie'1); 
        
$threaddm->set'visible'1); 
        
$threaddm->pre_save(); 
        
$threadid $threaddm->save(); 
        unset(
$threaddm); 


Dismounted 03-14-2009 04:01 AM

Try getting rid the the by-ref operator (&) in front of $vbulletin.

myHybridcar.com 03-14-2009 04:38 AM

Tried that too.

myHybridcar.com 03-25-2009 05:24 AM

I'm still having one heluvatime trying to get this to work. I'm not the only one, either. Any other thoughts on what might be the problem?


All times are GMT. The time now is 07:39 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.01703 seconds
  • Memory Usage 1,760KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete