
webweyer
By: a guest on Mar 9th, 2008 | syntax:
PHP | size: 1.81 KB | hits: 205 | expires: Never
function insert_forum($titre,$contenu) {
//Inclusion du fichier d'insertion phpBB
$phpbb_root_path='../forum/';
$phpEx='php';
global $auth;
global $user;
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
$robot_user_id=53;
$robot_username='Ski-karellis.net';
$backup_ip = $user->ip;
$user->ip = '0.0.0.0';
$backup_username = $user->data['username'];
$user->data['username'] = $robot_username;
$backup_user_id = $user->data['user_id'];
$user->data['user_id'] = $robot_user_id;
$auth->acl($user->data);
// note that multibyte support is enabled here
$my_subject = utf8_normalize_nfc($titre);
$my_text = utf8_normalize_nfc
(nl2br($contenu));
// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = '';
generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);
'forum_id' => 7,
'icon_id' => false,
'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => true,
'enable_sig' => true,
'message' => $my_text,
'message_md5' => md5($my_text),
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'post_edit_locked' => 0,
'topic_title' => $my_subject,
'notify_set' => false,
'notify' => false,
'post_time' => 0,
'forum_name' => '',
'enable_indexing' => true,
);
if(submit_post('post', $my_subject, '', POST_NORMAL, $poll, $data)) {
return TRUE;
}
else {
return FALSE;
}
}