Guest User

Untitled

a guest
Apr 18th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.43 KB | None | 0 0
  1. <?php
  2.  
  3. $break_char = "\n";
  4.  
  5. define('IN_PHPBB', true);
  6. $phpbb_root_path = (defined('./localhost/phpbb3/')) ? PHPBB_ROOT_PATH : './';
  7. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  8. include($phpbb_root_path . 'common.' . $phpEx);
  9.  
  10. // Start session management
  11. $user->session_begin();
  12. $auth->acl($user->data);
  13. $user->setup('mods/application');
  14.  
  15. include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
  16.  
  17. // Let's set the configuration, this is the ID of the forum where the post goes to
  18. $forumid_send = 2;
  19. $USER_ID = 2;
  20.  
  21. $submit = (isset($_POST['submit'])) ? true : false;
  22.  
  23.    if ($submit)
  24.    {
  25.  
  26. // Setting the variables we need to submit the post to the forum where all the applications come in
  27. $firstname  =   utf8_normalize_nfc(request_var('firstname','', true));
  28. $lastname       =   utf8_normalize_nfc(request_var('lastname','', true));
  29. $age            =   utf8_normalize_nfc(request_var('age','', true));
  30. $country            =   utf8_normalize_nfc(request_var('country','', true));
  31.  
  32. //compiling the message
  33. $apply_post = '';
  34. $apply_post .= 'First Name: ' . $firstname . $break_char;
  35. $apply_post .= 'Last Name: ' . $lastname . $break_char;
  36. $apply_post .= 'Age: ' . $age . $break_char;
  37. $apply_post .= 'Country: ' . $country . $break_char;
  38. $apply_post .= 'Automatically posted by Bot!';
  39.  
  40. //making the subject
  41. $apply_subject = 'Application: ' . $firstname . ' (Pending)';
  42.  
  43. // variables to hold the parameters for submit_post
  44. $poll = $uid = $bitfield = $options = '';
  45.  
  46. generate_text_for_storage($apply_post, $uid, $bitfield, $options, true, true, true);
  47.  
  48. $data = array(
  49.    'forum_id'      => $forumid_send,
  50.    'icon_id'      => false,
  51.  
  52.    'enable_bbcode'      => true,
  53.    'enable_smilies'   => true,
  54.    'enable_urls'      => true,
  55.    'enable_sig'      => true,
  56.  
  57.    'message'      => $apply_post,
  58.    'message_md5'   => md5($apply_post),
  59.            
  60.    'bbcode_bitfield'   => $bitfield,
  61.    'bbcode_uid'      => $uid,
  62.  
  63.    'post_edit_locked'   => 0,
  64.    'topic_title'      => $apply_subject,
  65.    'notify_set'      => false,
  66.    'notify'         => false,
  67.    'post_time'       => 0,
  68.    'forum_name'      => '',
  69.    'enable_indexing'   => true,
  70. );
  71.  
  72. // Sending the post to the forum set in configuration above
  73. submit_post('post', $apply_subject, '', POST_NORMAL, $poll, $data);
  74. $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("../../wordpress/") . '">', '</a>');
  75. trigger_error($message);
  76.  
  77.    }
  78. ?>
Advertisement
Add Comment
Please, Sign In to add comment