Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Jan 2013, 07:43
geass geass is offline
 
Join Date: Jan 2013
Remote Post

Im working on remote new post . Im using vb5 ( http://www.akillihaber.com) , but i cant do that . a few said me about datamanagers but i couldnt setup the enviroment . Can u help me about that ?



--My Codes

<?php
/*======================================================================*\
|| #################################################################### ||
|| # Create a new thread # ||
|| # ---------------------------------------------------------------- # ||
|| # Hopefully this will help some of you people who are needing to # ||
|| # create a new thread externally using vBulletins API. Good luck! # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE & ~8192);
define('VB_AREA', 'External');
define('SKIP_SESSIONCREATE', 1);
define('SKIP_USERINFO', 1);

// Include vBulletin runtime files
require_once('./global.php');
require_once('./includes/functions_databuild.php');

require_once('./includes/init.php');
// Create a new datamanager for posting
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');

// Set some variable and information
$forumid = 7; // The id of the forum we are posting to
$userid = 1; // The user id of the person posting
$title = addslashes($_POST["test title bla bla test"]); // The title of the thread
$pagetext = addslashes($_POST["test content bla bla test 123 this is long enough"]); // The content of the thread
$allowsmilie = '1'; // Are we allowing smilies in our post
$visible = '1'; // If the post visible (ie, moderated or not)

// Parse, retrieve and process the information we need to post
$foruminfo = fetch_foruminfo($forumid);
$threadinfo = array();
$user = htmlspecialchars_uni( fetch_userinfo($userid) );

$threaddm->set_info('forum', $foruminfo);
$threaddm->set_info('thread', $threadinfo);
$threaddm->setr('forumid', $forumid);
$threaddm->setr('userid', $userid);
$threaddm->setr('pagetext', $pagetext);
$threaddm->setr('title', $title);
$threaddm->set('allowsmilie', $allowsmilie);
$threaddm->set('visible', $visible);

// Lets see what happens if we save the page
$threaddm->pre_save();
if(count($threaddm->errors) < 1) {
// Basically if the page will save without errors then let do it for real this time
$threadid = $threaddm->save();
unset($threaddm);
} else {
// There was errors in the practice run, so lets display them
var_dump ($threaddm->errors);
}

?>

--------------- Added 23 Jan 2013 at 07:47 ---------------

And the error : Fatal error: Class 'vB_DataManager_thread_firstpost' not found in /*/*/*/akillihaber.com/public_html/core/includes/functions.php on line 86
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 17:38.

Layout Options | Width: Wide Color: