Advertisement
plas71k

Decoded file 1..

Nov 13th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.15 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=================================================================//
  77. echo "<p class='publish'>????? ?????? ??.</p>";
  78. }
  79. else
  80. {
  81. echo "???";
  82. echo "<ul>";
  83. echo $step["capcha"] == false ? "<li>???? ?? ?????? ?? ???? ???? ????.</li>" : "";
  84. echo $step["title"] == false ? "<li>???? ????? ?? ???? ????.</li>" : "";
  85. echo $step["content"] == false ? "<li>???? ?????? ????? ?? ???? ????.</li>" : "";
  86. echo "</ul>";
  87. echo "<a Onclick=\"javascript:history.back();\">?????? ?? ???</a>";
  88. }
  89. }
  90. }
  91.  
  92. function wp_post_sender_menu()
  93. {
  94. if (function_exists("add_options_page"))
  95. {
  96. add_options_page("????? ?????", "????? ?????", "manage_options", "wp-post-sender", "wp_post_sender_config_permission");
  97. }
  98. }
  99.  
  100. function wp_post_sender_config_permission()
  101. {
  102. if (!current_user_can("manage_options"))
  103. {
  104. wp_die(__("You do not have sufficient permissions to access this page.", "wp_post_sender"));
  105. settings_fields("wp_post_sender_options");
  106. function register_mysettings()
  107. {
  108. register_setting("wp_post_sender_options", "type_publish");
  109. register_setting("wp_post_sender_options", "sum_custom_field");
  110. register_setting("wp_post_sender_options", "cat_id");
  111. }
  112. }
  113. echo "<div class=\"wrap\"><h2>??????? ????? ?????</h2><table class=\"form-table\"><form method=\"post\" action=\"options.php\">";
  114. wp_nonce_field("update-options");
  115. echo "<tr><th><h3>??????? ?????</h4></th></tr><tr><td>??? ?????? ?????:</td><td><select name=\"type_publish\">";
  116. $get_type_publish = get_option("type_publish");
  117. echo "<option name=\"draft\" value=\"draft\" ";
  118. echo $get_type_publish == "draft" ? "selected='selected'" : "";
  119. echo ">???????</option><option name=\"publish\" value=\"publish\" ";
  120. echo $get_type_publish == "publish" ? "selected='selected'" : "";
  121. echo ">??????</option><option name=\"pending\" value=\"pending\" ";
  122. echo $get_type_publish == "pending" ? "selected='selected'" : "";
  123. echo ">?? ?????? ?????</option><option name=\"private\" value=\"private\" ";
  124. echo $get_type_publish == "private" ? "selected='selected'" : "";
  125. echo ">?????</option></select><span style=\"font-size:11px;\">(??????? ????? ????? ?? ??????.)</span></td></tr><tr><td>????? ????? ????????? ??????</td><td><input type=\"text\" name=\"sum_custom_field\" value=\"";
  126. echo get_option("sum_custom_field");
  127. echo "\"/><span style=\"font-size:11px;\">(?? ????? ???? ??? ?? ??? ????? ???????????? ????? ???? ??????.)</span></td></tr><tr><td>???? ??? ????? ?????</td><td><input type=\"text\" name=\"cat_id\" value=\"";
  128. echo get_option("cat_id");
  129. echo "\"/><span style=\"font-size:11px;\">(????? ???? ???? ?? ?? ???????? ??? ????? ???? ??? ?? ?? ?????? ????? ???? ????. ????: 1,4)</span></td></tr><tr><td><p class=\"submit\"><input type=\"hidden\" name=\"action\" value=\"update\" /><input type=\"hidden\" name=\"page_options\" value=\"type_publish,sum_custom_field,cat_id\" /><input type=\"submit\" class=\"button-primary\" name=\"Submit\" value=\"?? ??? ?????\" /></p></td></tr></form></table></div>";
  130. }
  131.  
  132. if (get_bloginfo("url") != "http://4print.ir/" && get_bloginfo("url") != "http://4print.ir" && get_bloginfo("url") != "http://www.4print.ir/" && get_bloginfo("url") != "http://www.4print.ir")
  133. {
  134. wp_die(__("?????? ?????? ???? ??? ???? ????? ????!"));
  135. }
  136. load_plugin_textdomain("wp_post_sender", "wp-content/plugins/wp-post-sender-custom/langs");
  137. add_action("admin_menu", "wp_post_sender_menu");
  138. add_shortcode("postsender", "wp_posts_sender");
  139. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement