Advertisement
plas71k

Decoded file 1

Nov 13th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. <?php
  2. function wp_posts_sender()
  3. {
  4. if (!session_id())
  5. {
  6. echo "<div style=\"display:none;\">";
  7. session_start();
  8. echo "</div>";
  9. }
  10. include ("form.php");
  11. global $current_user;
  12. if ($_POST["secCode"] != $_SESSION["secCode"])
  13. {
  14. $step["capcha"] = false;
  15. }
  16. else
  17. {
  18. $_SESSION["secCode"] = rand(100000, 999999);
  19. $step["capcha"] = true;
  20. }
  21. if ($_POST["name_author"])
  22. {
  23. $step["auhtor"] = true;
  24. }
  25. if ($_POST["email_auhtor"])
  26. {
  27. $step["email"] = true;
  28. }
  29. if ($_POST["site_author"])
  30. {
  31. $step["site"] = true;
  32. }
  33. if ($_POST["post_name"])
  34. {
  35. $step["title"] = true;
  36. }
  37. if ($_POST["post_content"])
  38. {
  39. $step["content"] = true;
  40. }
  41. if (isset($_POST["send_post"]))
  42. {
  43. if (($step["capcha"] && $step["title"] && $step["content"]) == true)
  44. {
  45. $all_separator = array(",",".",",","+","-","_"," ","?");
  46. $standars_separator = array(",",",",",",",",",",",",",",",");
  47. $final_tags = str_replace($all_separator, $standars_separator, $_POST["post_tags"]);
  48. if (is_user_logged_in())
  49. {
  50. $get_userid = $current_user->ID;
  51. }
  52. else
  53. {
  54. $get_userid = "1";
  55. }
  56. $new_post   = array("ID" => "","post_author" => $get_userid,"post_category" => array($_POST["cat"]),"post_content" => $_POST["post_content"],"post_title" => $_POST["post_name"],"tags_input" => $final_tags,"post_status" => get_option("type_publish"));
  57. $post_id = wp_insert_post($new_post);
  58. if ($_POST["name_author"])
  59. {
  60. add_post_meta($post_id, "name", $_POST["name_author"]);
  61. }
  62. if ($_POST["email_auhtor"])
  63. {
  64. add_post_meta($post_id, "email", $_POST["email_auhtor"]);
  65. }
  66. if ($_POST["site_author"])
  67. {
  68. add_post_meta($post_id, "site", $_POST["site_author"]);
  69. }
  70. for ($i = 1; $i <= get_option("sum_custom_field"); $i++)
  71. {
  72. $cfn[$i] = $_POST["cn_$i"];
  73. $cfv[$i] = $_POST["cv_$i"];
  74. add_post_meta($post_id, $cfn[$i], $cfv[$i]);
  75. }
  76. //==========================================================PAYMENT=================================================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement