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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-28-2009, 01:41 PM
mouth mouth is offline
 
Join Date: Jun 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using Data Manager to create thread from outside vBulletin

Hi,

New vBulletin user, having just converted from phpBB with ~15,000 users and ~1million posts. Impex worked great No mods (yet), just 3.8.4 out of the box. I'm good with PHP, but not enough to get my head around the data managers

I've read the official docs for the data mangers, read and searched through this site, and even googled and found a few examples. Spent several hours trying to get my data managers usage working, but after still failing I thought I'd ask my first post on here.

My site has an external (to vBulletin) event calendar that users can add events too (after moderation). A thread/topic was then created in phpBB for that new calendar entry with some initial text and a link back to the calendar entry details. I am trying to replicate this functionality through to vBulletin.

Is there a full and working example code available for using the data managers from outside vBulletin to create a new thread in vBulletin? I think my issue in getting this working is a combination of lacking information in the officials doc's teamed with outdated/wrong examples found in here and via google.

For your giggles, here's the code I'm currently have (after many iterations and changes) but which I still can't get to create a new thread ....

PHP Code:
<?php

$forums_path 
$_SERVER['DOCUMENT_ROOT'] . '/forums';
define('CWD'$forums_path);

require_once(
CWD '/global.php');
require_once(
CWD '/includes/class_dm.php');
require_once(
CWD '/includes/class_dm_threadpost.php');
require_once(
CWD '/includes/functions_databuild.php');

$threaddm = new vB_DataManager_Thread_FirstPost($vbulletinERRTYPE_STANDARD);
$post_userid 1// Admin
$userid 1;
$user_name 'Admin';
$allow_smilie '1';
$visible '1';

$forum_id 65;
$title strip_tags("Testing 1-2-3");
$post_text strip_tags("abc 123");

$threaddm->do_set('forumid'$forum_id);
$threaddm->do_set('postuserid'$post_userid);
$threaddm->do_set('userid'$userid);
$threaddm->do_set('username'$user_name);
$threaddm->do_set('posttext'$post_text);
$threaddm->do_set('title'$title);
$threaddm->do_set('allowsmilie'$allow_smilie);
$threaddm->do_set('visible'$visible);
$threaddm->save();

build_forum_counters($forum_id);

?>
When I run the above, I get a standard forums (template) page with a message of "A required field called pagetext is missing or has an invalid value."


Thanks.
Reply With Quote
 


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:24 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.11512 seconds
  • Memory Usage 2,287KB
  • Queries Executed 12 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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