Frage wurde ja schon oft gestellt, trotzdem bin ich einfach noch zu unerfahren um es hinzu bekommen.
Ich will einen Post in einem Forum erstellen und habe folgenden Code benutzt (zusammen geklaut):
Code: Alles auswählen
include ('http://localhost/pup-board/includes/functions_posting.php');
include ('http://localhost/pup-board/common.php');
//echo $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//weiß ich auch nicht genau wie ich das definiere, habe es oben direkt angegeben!
$user->session_begin(); // Session auslesen
$auth->acl($user->data); // Benutzer-Informationen laden
//hab ich aber gar nicht, was nun?
//Betreff erstellen
$topic="BLABLA";
//Post erstellen
$threat="BLUMBLUM";
$my_subject = $topic;
$my_text = $thread;
// 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);
$data = array(
'forum_id' => 83,
'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,
);
echo submit_post('post', $my_subject, '', POST_NORMAL, $poll, $data);
Es liegt wohl auch daran, dass ich gar keine User hab, den ich übergeben kann, wie mache ich das?
Viele Grüße
Sylvus
//editiert -> aktualisiert