I am running 3.7.4 PL1.
If I start with an empty php file and just put an echo statement, I see the message when I hit the page. Anything I echo before the line that includes class_dm_threadpost.php I see output, but anything after I don't. For example:
PHP Code:
<?php
require_once('global.php');
require_once('./includes/class_dm_threadpost.php');
echo "Hello world.";
?>
Shows nothing in the page. But
PHP Code:
<?php
require_once('global.php');
echo "Hello world.";
require_once('./includes/class_dm_threadpost.php');
?>
Shows "Hello world." on the page.
I am using godaddy, so I don't know how I can access the php error file. I tried using an set_error_handler as described on this page:
http://us3.php.net/set-error-handler , to catch any errors, but still I got no output. It is bizarre. It is like including that class_dm_threadpost is killing everything. I have not modified any of my vbulletin files, so it should be whatever came with 3.7.4.
var_export() behaves the same way as echo. Before that require_once line it works, after it, I see nothing.
--------------- Added [DATE]1251815891[/DATE] at [TIME]1251815891[/TIME] ---------------
Doh. I figured it out. I have to include another file as well (class_dm.php). It seems like without it, something in the class_dm_threadpost was unhappy.
This works:
PHP Code:
<?php
require_once('global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
$threadid=1565;
$forumid=5;
$symid='asdf';
$userid=2;
$message="Testing.Testing.Testing.Testing.Testing.";
$timenow = TIMENOW;
$threadinfo = fetch_threadinfo($threadid);
$foruminfo = fetch_foruminfo($forumid);
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $threadid);
$postdm->set('title', $symid);
$postdm->set('userid', $userid);
$postdm->set('pagetext', $message);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', $timenow);
$xxx = $postdm->save();
unset($postdm);
echo 'save returned:';
echo $xxx;
?>