finally i made it work...here is how i did it..
PHP Code:
$vbpath = "/var/www/html";
define("CSRF_PROTECTION", false);
require_once($vbpath . "/includes/vb5/autoloader.php");
vB5_Autoloader::register($vbpath);
vB5_Frontend_Application::init("config.php");
vB::getDbAssertor()->delete("session", array("sessionhash" => vB::getCurrentSession()->get("dbsessionhash")));
$username = vB_String::htmlSpecialCharsUni("ADMIN");
$userinfo = vB::getDbAssertor()->getRow("user", array("username" => $username));
$auth = array_intersect_key($userinfo, array_flip(["userid","secret","lastvisit", "lastactivity"]));
$loginInfo = vB_User::processNewLogin($auth);
vB5_Auth::setLoginCookies($loginInfo,"",false);
$api = Api_InterfaceAbstract::instance();
$options = [];
$wakht = time();
$input = [
"publisheddate" =>$wakht,
"userid" => 1,
"authorname" => "ADMIN",
"description" => "dsdf",
"pagetext" => "",
"rawtext" => "OK OK OK OK ",
"title" => "j TEA TIME!",
"htmltitle" => "BLAAAAH BLAAH!",
"parentid" => 3,
"created" => $wakht,
"lastcontent" => $wakht,
"lastcontentauthor" => "ADMIN",
"lastauthorid" => 1,
"hvinput"=>"",
];
$nodee = $api->callApi("content_text", "add", [$input, $options]);
// for some reasons that i was not able to figure out the post is added as guest so i had to updated the node.
$changes = array(
'authorname'=> $username,
'lastcontentauthor'=> $username,
);
vB::getDbAssertor()->update('vBForum:node', $changes, array('nodeid' => $nodee));
vB_Cache::allCacheEvent("nodeChg_" .$nodee);