Код: Выделить всё
<?php		
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require_once($phpbb_root_path . '/includes/functions_posting.' . $phpEx); 
	
$poll = $uid = $bitfield = $options = ''; 
generate_text_for_storage($topic_text, $uid, $bitfield, $options, true, true, true);
	
	$topic_title = "Шашал" ;
	$topic_text = "Как строить шалаши";
	$fid = 3;
	$user_id = 2;	
	
	$data = array(
			'topic_title'			=> $topic_title, // Subject
			'forum_id'				=> $fid, // тут ID форума
			'forum_name'			=> '',
			'icon_id'				=> 0,
			'poster_id'				=> $user_id, // Тут ID юзера, от имени которого размещается пост
			'enable_bbcode'			=> (bool) true,
			'enable_smilies'		=> (bool) true,
			'enable_urls'			=> (bool) true,
			'enable_sig' 			=> (bool) true,
			'notify'				=> 0,
			'notify_set'			=> '',
			'enable_indexing'		=> (bool) false,
			'message'				=> $topic_text,
			'message_md5'			=> (string) '',
			'bbcode_bitfield'		=> $bitfield,
			'bbcode_uid'			=> $uid,
			'post_edit_locked'		=> 0,
		);
submit_post('post', $topic_title, $username, 0, $poll, $data, false); //  $username -  ник юзера, от имени которого размещается пост	
?>Код: Выделить всё
SQL ERROR [ mysqli ]
Column 'topic_first_poster_name' cannot be null [1048]
An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
 ).
 ).


