Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * @ Pirate-Sky Crew :: PHP Decoder v2
- * @ Author: pLa$71k
- * @ Web: http://pirate-sky.com
- * @ Pirate-Sky Crew © 2008 - 2013
- */
- function save_image($inPath, $outPath)
- {
- $in = fopen($inPath, "rb");
- $out = fopen($outPath, "wb");
- while ($chunk = fread($in, 8192)) {
- fwrite($out, $chunk, 8192);
- }
- fclose($in);
- fclose($out);
- }
- function get_seo_link($str, $replace = array(), $delimiter = "-")
- {
- setlocale(LC_ALL, "en_US.UTF8");
- if (!empty($replace)) {
- $str = str_replace(( array ) $replace, " ", $str);
- } else {
- $trArr = array(
- "c",
- "C",
- "?",
- "I",
- "s",
- "S",
- "g",
- "G",
- "o",
- "O",
- "u",
- "U"
- );
- $toArr = array(
- "c",
- "c",
- "i",
- "i",
- "s",
- "s",
- "g",
- "g",
- "o",
- "o",
- "u",
- "u"
- );
- $str = str_replace($trArr, $toArr, $str);
- }
- $clean = iconv("UTF-8", "ASCII//TRANSLIT", $str);
- $clean = preg_replace("/[^a-zA-Z0-9\\/_|+ -]/", "", $clean);
- $clean = trim($clean, "-");
- $clean = preg_replace("/[\\/_|+ -]+/", $delimiter, $clean);
- return $clean;
- }
- function hayalbotlisans()
- {
- $site = get_bloginfo("home");
- $site1 = "http://www.freechromegames.net";
- $site2 = "http://freechromegames.net";
- if ($site != $site1 && $site != $site2) {
- echo "Lutfen Bot icin lisans al?n. Msn: ahmetozdemir@mail.com.";
- exit();
- }
- }
- function bot_start()
- {
- global $xpdirpath;
- global $abcxxa;
- echo "<center><h1>HayalOyun Botu</h1><hr style=\"width:50%;border:1px solid #ccc;\" />";
- if (empty($_GET['site'])) {
- echo "<form action=\"\" method=\"get\"><table>";
- echo "<tr><td>Site: </td><td><select name=\"site\">";
- echo $abcxxa;
- echo "</select></td></tr><tr><td> </td><td><input type=\"submit\" value=\"Cal?st?r!\" /></tr>";
- echo "</table><input type=\"hidden\" name=\"page\" value=\"" . $xpdirpath . "\" /></form>";
- } else {
- require_once(dirname(__FILE__) . "/Bots/" . $_GET['site'] . ".php");
- }
- echo "</center>";
- }
- function yonetime_ekle()
- {
- add_submenu_page("edit.php", "HayalOyun Botu", "HayalOyun Botu", 10, __FILE__, "bot_start");
- }
- date_default_timezone_set("Europe/Istanbul");
- include("ayar.php");
- $xpdirpath = plugin_basename(__FILE__);
- $rootp = $_SERVER['DOCUMENT_ROOT'];
- $burl = site_url();
- if (!is_dir($rootp . $apt . "/wp-content/uploads/images/")) {
- mkdir($rootp . $apt . "/wp-content/uploads/images/");
- }
- if (!is_dir($rootp . $apt . "/wp-content/uploads/swf/")) {
- mkdir($rootp . $apt . "/wp-content/uploads/swf/");
- }
- if ($_GET['do'] == "add") {
- $ptitle = $_POST['vtitle'];
- $pimg = $_POST['vimg'];
- $purl = $_POST['vurl'];
- $ptags = $_POST['vtags'];
- $phowto = $_POST['vhowto'];
- $pstatus = $_POST['vpstatus'];
- $pcatid = $_POST['catid'];
- $ybotcheck = $_POST['ybotcheckurl'];
- if (!$wpdb->get_row("SELECT meta_id FROM wp_postmeta WHERE meta_key='YBotCheckURL' AND meta_value = '" . $ybotcheck . "'", "ARRAY_N")) {
- $fthumb = $burl . "/wp-content/uploads/images/" . get_seo_link($ptitle) . ".jpg";
- $my_post = array();
- $my_post['post_title'] = $ptitle;
- $my_post['post_content'] = $phowto;
- if ($pstatus != "future") {
- $my_post['post_status'] = $pstatus;
- } else {
- $my_post['post_status'] = $pstatus;
- if ($_POST['ypason'] != 1) {
- $abc = $wpdb->get_row("SELECT post_date FROM wp_posts WHERE post_status='future' ORDER BY post_date DESC", "ARRAY_N");
- if (time() < strtotime($abc[0])) {
- $my_post['post_date'] = date("Y-m-d H:i:s", strtotime($abc[0]) + $ptimin * 60);
- } else {
- $my_post['post_date'] = date("Y-m-d H:i:s", time() + $ptimin * 60);
- }
- } else {
- $cfpost = $wpdb->get_var("SELECT COUNT(ID) FROM wp_posts WHERE post_status='future'");
- if ($cfpost < 5) {
- echo "S?k?st?rma Icin Yeterli Zamanlanm?s Oyun Yok";
- exit();
- } else {
- $mi = 1;
- $p5date = null;
- foreach ($wpdb->get_results("SELECT post_date FROM wp_posts WHERE post_status='future' ORDER BY post_date ASC") as $key => $row) {
- if ($mi == 5) {
- $p5date = date("Y-m-d H:i:s", strtotime($row->post_date) - 1020);
- }
- ++$mi;
- }
- $my_post['post_date'] = $p5date;
- }
- }
- }
- $my_post['post_author'] = 1;
- if ($pcatid != "null") {
- $my_post['post_category'] = $pcatid;
- } else {
- $my_post['post_category'] = array(
- 0
- );
- }
- $my_post['tags_input'] = $ptags;
- $post_ids = wp_insert_post($my_post);
- if ($post_ids) {
- add_post_meta($post_ids, $cfimage, $fthumb);
- $ff_parts = pathinfo($purl);
- if ($ff_parts['extension'] == "dcr") {
- if (!$gswf) {
- add_post_meta($post_ids, $cfdcr, $purl);
- } else {
- save_image($purl, $rootp . $apt . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".dcr");
- add_post_meta($post_ids, $cfdcr, $burl . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".dcr");
- }
- } else if ($ff_parts['extension'] == "unity3d") {
- if (!$gswf) {
- add_post_meta($post_ids, $cfunity, $purl);
- } else {
- save_image($purl, $rootp . $apt . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".unity3d");
- add_post_meta($post_ids, $cfunity, $burl . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".unity3d");
- }
- } else if (!$gswf) {
- add_post_meta($post_ids, $cfswf, $purl);
- } else {
- save_image($purl, $rootp . $apt . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".swf");
- add_post_meta($post_ids, $cfswf, $burl . "/wp-content/uploads/swf/" . get_seo_link($ptitle) . ".swf");
- }
- save_image($pimg, $rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($ptitle) . ".jpg");
- include("r-class.php");
- $Var_7128->resize($rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($ptitle) . ".jpg");
- $resizeObj = $Var_7128;
- $resizeObj->resizeImage($rwidth, $rheight, 0);
- $resizeObj->saveImage($rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($ptitle) . ".jpg", $rquality);
- if (!empty($ybotcheck)) {
- add_post_meta($post_ids, "YBotCheckURL", $ybotcheck);
- }
- $thumbdir = "images/" . get_seo_link($ptitle) . ".jpg";
- $attachment = array(
- "post_mime_type" => "image/jpg",
- "post_title" => get_seo_link($ptitle),
- "post_content" => "",
- "post_status" => "inherit"
- );
- $attach_id = wp_insert_attachment($attachment, $thumbdir, $post_ids);
- require_once(ABSPATH . "wp-admin" . "/includes/image.php");
- $attach_data = wp_generate_attachment_metadata($attach_id, $rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($ptitle) . ".jpg");
- wp_update_attachment_metadata($attach_id, $attach_data);
- set_post_thumbnail($post_ids, $attach_id);
- echo "1";
- } else {
- echo "Oyun eklenemedi.";
- }
- } else {
- echo "Bu oyun zaten ekli gozukuyor.";
- }
- exit();
- }
- add_action("admin_menu", "yonetime_ekle");
- hayalbotlisans();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement