Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $break_char = "\n";
- define('IN_PHPBB', true);
- $phpbb_root_path = (defined('./localhost/phpbb3/')) ? PHPBB_ROOT_PATH : './';
- $phpEx = substr(strrchr(__FILE__, '.'), 1);
- include($phpbb_root_path . 'common.' . $phpEx);
- // Start session management
- $user->session_begin();
- $auth->acl($user->data);
- $user->setup('mods/application');
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- // Let's set the configuration, this is the ID of the forum where the post goes to
- $forumid_send = 2;
- $USER_ID = 2;
- $submit = (isset($_POST['submit'])) ? true : false;
- if ($submit)
- {
- // Setting the variables we need to submit the post to the forum where all the applications come in
- $firstname = utf8_normalize_nfc(request_var('firstname','', true));
- $lastname = utf8_normalize_nfc(request_var('lastname','', true));
- $age = utf8_normalize_nfc(request_var('age','', true));
- $country = utf8_normalize_nfc(request_var('country','', true));
- //compiling the message
- $apply_post = '';
- $apply_post .= 'First Name: ' . $firstname . $break_char;
- $apply_post .= 'Last Name: ' . $lastname . $break_char;
- $apply_post .= 'Age: ' . $age . $break_char;
- $apply_post .= 'Country: ' . $country . $break_char;
- $apply_post .= 'Automatically posted by Bot!';
- //making the subject
- $apply_subject = 'Application: ' . $firstname . ' (Pending)';
- // variables to hold the parameters for submit_post
- $poll = $uid = $bitfield = $options = '';
- generate_text_for_storage($apply_post, $uid, $bitfield, $options, true, true, true);
- $data = array(
- 'forum_id' => $forumid_send,
- 'icon_id' => false,
- 'enable_bbcode' => true,
- 'enable_smilies' => true,
- 'enable_urls' => true,
- 'enable_sig' => true,
- 'message' => $apply_post,
- 'message_md5' => md5($apply_post),
- 'bbcode_bitfield' => $bitfield,
- 'bbcode_uid' => $uid,
- 'post_edit_locked' => 0,
- 'topic_title' => $apply_subject,
- 'notify_set' => false,
- 'notify' => false,
- 'post_time' => 0,
- 'forum_name' => '',
- 'enable_indexing' => true,
- );
- // Sending the post to the forum set in configuration above
- submit_post('post', $apply_subject, '', POST_NORMAL, $poll, $data);
- $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("../../wordpress/") . '">', '</a>');
- trigger_error($message);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment