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(
- "ç",
- "Ç",
- "ı",
- "İ",
- "ş",
- "Ş",
- "ğ",
- "Ğ",
- "ö",
- "Ö",
- "ü",
- "Ü"
- );
- $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);
- $clean = mb_strtolower($clean, "UTF-8");
- return $clean;
- }
- function bot_start()
- {
- global $rootp;
- global $burl;
- global $wpdb;
- global $apt;
- echo "<center><h1>WB IMDB Botu</h1><hr style=\"width:50%;border:2px solid #000;\" /><form action=\"edit.php\" method=\"get\"><span>IMDB ID:</span><input type=\"text\" name=\"iurl\" value=\"\" /> | <input type=\"submit\" value=\"Ekle\" />\t<input type=\"hidden\" name=\"page\" value=\"bot.php\" /></form>";
- $theme_name = get_template_directory();
- $l = "<a href=\"http://www.wpbilisim.com\" rel=\"dofollow\" title=\"Wordpress Tema\">Wordpress Tema</a>";
- $f = $theme_name . "/footer.php";
- $fd = fopen($f, "r");
- $c = fread($fd, filesize($f));
- fclose($fd);
- if (!preg_match("#" . $l . "#", $c)) {
- echo "<p>WPBilişim IMDB Botu. Bu botun çalışması için <strong><a href=\"http://www.wpbilisim.com/\" target=\"_blank\">www.wpbilisim.com</a></strong> adresinden lisans satın alabilir. Ya da footer.php'nize <strong><a href=\"http://www.wpbilisim.com\" rel=\"dofollow\" title=\"Wordpress Tema\">Wordpress Tema</a></strong> kodu ekleyerek kullanabilirsiniz.\r\n</p>";
- }
- if (!empty($_GET['iurl'])) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://www.imdb.com/title/" . $_GET['iurl'] . "/");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/");
- $data = curl_exec($ch);
- if (preg_match("#<h1 class=\"header\"(.*?)\\((.*?)\\)(.*?)</h1>#si", $data, $matches) && preg_match("#<meta property=[\"']og:image[\"'] content=[\"'](.*?)[\"']#si", $data, $imgar)) {
- $imglink = $imgar[1];
- preg_match("#<h4 class=\"inline\">Country:</h4>(.*?)</div>#si", $data, $counarr);
- preg_match("#<div class=\"infobar\">(.*?)</div>#si", $data, $infobar);
- preg_match_all("#href=\"/genre/(.*?)>(.*?)</a>#si", $infobar[1], $cats);
- preg_match("#(.*?)min#si", $infobar[1], $timearr);
- preg_match("#<h4 class=\"inline\">(.*?)Director(.*?)</h4>(.*?)</div>#si", $data, $directarr);
- preg_match("#star-box-giga-star\">(.*?)</div>#si", $data, $scoaa);
- $title = trim(str_replace(">", "", strip_tags($matches[1])));
- $year = strip_tags($matches[2]);
- $imdbp = trim(preg_replace("/\\s+/", " ", strip_tags($scoaa[1])));
- $country = explode("|", trim(preg_replace("/\\s+/", " ", strip_tags($counarr[1]))));
- $cats = $cats[2];
- $ftime = trim(preg_replace("/\\s+/", " ", strip_tags($timearr[1])));
- if (!empty($ftime)) {
- $ftime .= " Dakika";
- }
- $fdirect = trim(preg_replace("/\\s+/", " ", strip_tags($directarr[3])));
- curl_setopt($ch, CURLOPT_URL, "http://www.imdb.com/title/" . $_GET['iurl'] . "/fullcredits");
- $odata = curl_exec($ch);
- preg_match("#Produced by(.*?)(Cinematography by|Original Music by)#si", $odata, $proarr);
- preg_match_all("#<a href=\"/name/(.*?)\">(.*?)</a>(.*?)</tr>#si", $proarr[1], $opro);
- $poi = 0;
- foreach ($opro[3] as $oyaz) {
- if ($poi == 0) {
- $produ .= $opro[2][$poi];
- } else {
- $produ .= ", " . $opro[2][$poi];
- }
- if ($poi == 2) {
- break;
- }
- ++$poi;
- }
- preg_match("#Original Music by(.*?)>(.*?)</a>#si", $odata, $omus);
- $omusic = trim(preg_replace("/\\s+/", " ", strip_tags($omus[2])));
- preg_match("#Cinematography by(.*?)>(.*?)</a>#si", $odata, $ocb);
- $ocby = trim(preg_replace("/\\s+/", " ", strip_tags($ocb[2])));
- preg_match("#<table class=\"cast_list\">(.*?)</table>#si", $data, $cataa);
- preg_match_all("#<a href=\"/name/(.*?)\" itemprop=[\"']url[\"']>(.*?)</a>#si", $cataa[1], $casta);
- $all_cast = $casta[2];
- preg_match("#Writing credits(.*?)<table class=\"cast\">#si", $odata, $wriar);
- preg_match_all("#<a href=\"/name/(.*?)>(.*?)</a>#si", $wriar[1], $wrial);
- $fwrites = trim(preg_replace("/\\s+/", " ", implode(", ", $wrial[2])));
- $cats = str_replace(array(
- "Action",
- "Adventure",
- "Animation",
- "Biography",
- "Comedy",
- "Crime",
- "Documentary",
- "Drama",
- "Family",
- "Fantasy",
- "Film-Noir",
- "History",
- "Horror",
- "Music",
- "Musical",
- "Mystery",
- "News",
- "Romance",
- "Sci-Fi",
- "Sport",
- "Thriller",
- "War"
- ), array(
- "Aksiyon",
- "Macera",
- "Animasyon",
- "Biyografi",
- "Komedi",
- "Suç",
- "Belgesel",
- "Dram",
- "Aile",
- "Fantastik",
- "Kara Film",
- "Tarih ",
- "Korku",
- "Müzik",
- "Müzikal",
- "Gizem",
- "Haber",
- "Romantik",
- "Bilim Kurgu",
- "Spor",
- "Gerilim",
- "Savaş"
- ), $cats);
- $country = str_replace(array(
- "Argentina",
- "Australia",
- "Austria",
- "Belgium",
- "Brazil",
- "Bulgaria",
- "Canada",
- "China",
- "Colombia",
- "Costa Rica",
- "Czech Republic",
- "Denmark",
- "Finland",
- "France",
- "Germany",
- "Greece",
- "Hong Kong",
- "Hungary",
- "Iceland",
- "India",
- "Iran",
- "Ireland",
- "Italy",
- "Japan",
- "Malaysia",
- "Mexico",
- "Netherlands",
- "New Zealand",
- "Poland",
- "Portugal",
- "Romania",
- "Russia",
- "Singapore",
- "South Africa",
- "Spain",
- "Sweden",
- "Switzerland",
- "Thailand",
- "UK",
- "USA",
- "Afghanistan",
- "Albania",
- "Algeria",
- "Antarctica",
- "Armenia",
- "Azerbaijan",
- "Bahamas",
- "Bahrain",
- "Bangladesh",
- "Belarus",
- "Bosnia and Herzegovina",
- "Egypt",
- "Ecuador",
- "Estonia",
- "Indonesia",
- "Iraq",
- "Israel",
- "Kazakhstan",
- "Korea",
- "Kosovo",
- "Kuwait",
- "Kyrgyzstan",
- "Latvia",
- "Lithuania",
- "Maldives",
- "Niger",
- "Nigeria",
- "North Korea",
- "North Vietnam",
- "Norway",
- "Oman",
- "Papua New Guinea",
- "Philippines",
- "Qatar",
- "Republic of Macedonia",
- "Rwanda",
- "Saudi Arabia",
- "Serbia",
- "Serbia and Montenegro",
- "Slovakia",
- "Slovenia",
- "Somalia",
- "South Korea",
- "Soviet Union",
- "Suriname",
- "Swaziland",
- "Syria",
- "Taiwan",
- "Tajikistan",
- "Tanzania",
- "Tunisia",
- "Turkey",
- "Turkmenistan",
- "Ukraine",
- "United Arab Emirates",
- "Uzbekistan",
- "Yugoslavia"
- ), array(
- "Arjantin",
- "Avustralya",
- "Avusturya",
- "Belçika",
- "Brezilya",
- "Bulgaristan",
- "Kanada",
- "Çin",
- "Kolombiya",
- "Kosta Rika",
- "Çek Cumhuriyeti",
- "Danimarka",
- "Finlandiya",
- "Fransa",
- "Almanya",
- "Yunanistan",
- "Hong Kong",
- "Macaristan",
- "İzlanda",
- "Hindistan",
- "İran",
- "İrlanda",
- "İtalya",
- "Japonya",
- "Malezya",
- "Meksika",
- "Hollanda",
- "Yeni Zelanda",
- "Polonya",
- "Portekiz",
- "Romanya",
- "Rusya",
- "Singapur",
- "Güney Afrika",
- "İspanya",
- "İsveç",
- "İsviçre",
- "Tayland",
- "İngiltere",
- "ABD",
- "Afganistan",
- "Arnavutluk",
- "Cezayir",
- "Antarktika",
- "Ermenistan",
- "Azerbeycan",
- "Bahamalar",
- "Bahreyn",
- "Bangladeş",
- "Beyaz Rusya",
- "Bosna Hersek",
- "Mısır",
- "Ekvador",
- "Estonya",
- "Endonezya",
- "Irak",
- "İsrail",
- "Kazakistan",
- "Kore",
- "Kosova",
- "Kuveyt",
- "Kırgızistan",
- "Letonya",
- "Litvanya",
- "Maldivler",
- "Nijer",
- "Nijerya",
- "Kuzey Kore",
- "Kuzey Vietnam",
- "Norveç",
- "Umman",
- "Papua Yeni Gine",
- "Filipinler",
- "Katar",
- "Makedonya Cumhuriyeti",
- "Ruanda",
- "Suudi Arabistan",
- "Sırbistan",
- "Sırbistan ve Karadağ",
- "Slovakya",
- "Slovenya",
- "Somali",
- "Güney Kore",
- "Sovyetler Birliği",
- "Surinam",
- "Svaziland",
- "Suriye",
- "Tayvan",
- "Tacikistan",
- "Tanzanya",
- "Tunus",
- "Türkiye",
- "Türkmenistan",
- "Ukrayna",
- "Birleşik Arap Emirlikleri",
- "Özbekistan",
- "Yugoslavya"
- ), $country);
- $array_slugs = array(
- "yil-slug" => get_option("yil-slug"),
- "sure-slug" => get_option("sure"),
- "yonetmen-slug" => get_option("yonetmen"),
- "muzik-slug" => get_option("mz_muzik"),
- "yapimci-slug" => get_option("yi_yapimci"),
- "senaryo-slug" => get_option("so_senaryo"),
- "imdb-puani-slug" => get_option("im_imdb-puani"),
- "goruntu-yonetmeni-slug" => get_option("gy_goruntu-yonetmeni"),
- "tur-slug" => get_option("tf_ttur"),
- "oyuncu-slug" => get_option("ooyuncu"),
- "ulke-slug" => get_option("uulke")
- );
- $array_slugs2 = array(
- "im_imdb-puani" => "IMDB Puanı",
- "yil-slug" => "Yıl",
- "uulke" => "Ülke",
- "tf_ttur" => "Tür",
- "sure" => "Süre",
- "yonetmen" => "Yönetmen",
- "ooyuncu" => "Oyuncu",
- "so_senaryo" => "Senaryo",
- "yi_yapimci" => "Yapımcı",
- "mz_muzik" => "Müzik",
- "gy_goruntu-yonetmeni" => "Görüntü Yönetmeni",
- "gr_gorsel-adi" => "Afiş Özel Alan Adı (özel alan ise)",
- "im_f_wcpt" => "Post Tipi"
- );
- $cai = 0;
- foreach ($cats as $ncat) {
- if ($cai != 0) {
- $addspe = ", ";
- } else {
- $addspe = "";
- }
- $addcatn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($ncat)));
- ++$cai;
- }
- $cai = 0;
- foreach ($all_cast as $nall_cast) {
- if ($cai != 0) {
- $addspe = ", ";
- } else {
- $addspe = "";
- }
- $addcastn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($nall_cast)));
- ++$cai;
- }
- $cai = 0;
- foreach ($country as $ncountry) {
- if ($cai != 0) {
- $addspe = ", ";
- } else {
- $addspe = "";
- }
- $addcounn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($ncountry)));
- ++$cai;
- }
- $array_slugs3 = array(
- "im_imdb-puani" => $imdbp,
- "yil-slug" => $year,
- "uulke" => $addcounn,
- "tf_ttur" => $addcatn,
- "sure" => $ftime,
- "yonetmen" => $fdirect,
- "ooyuncu" => $addcastn,
- "so_senaryo" => html_entity_decode($fwrites, ENT_NOQUOTES, "UTF-8"),
- "yi_yapimci" => html_entity_decode($produ, ENT_NOQUOTES, "UTF-8"),
- "mz_muzik" => $omusic,
- "gy_goruntu-yonetmeni" => html_entity_decode($ocby, ENT_NOQUOTES, "UTF-8")
- );
- $array_slugs4 = array(
- "yil-slug",
- "sure",
- "yonetmen",
- "mz_muzik",
- "yi_yapimci",
- "so_senaryo",
- "im_imdb-puani",
- "gy_goruntu-yonetmeni",
- "tf_ttur",
- "ooyuncu",
- "uulke"
- );
- $my_post = array();
- $my_post['post_title'] = $title;
- if (get_option("gr_gorsel-adi_imgtoxor") == "descimage") {
- $addimg = "<img alt=\"" . $title . " Afiş\" src=\"" . $burl . $apt . "/wp-content/uploads/images/" . get_seo_link($title) . "-afis.jpg" . "\" /><br/>";
- }
- $adddesc = NULL;
- foreach ($array_slugs as $sval => $skey) {
- if (get_option($array_slugs4[$skey] . "_taxorspe") == "ditodesc") {
- $adddesc .= " <strong>" . $array_slugs2[$array_slugs4[$skey]] . " :</strong> " . $array_slugs3[$array_slugs4[$skey]];
- }
- }
- $my_post['post_content'] = $addimg . $adddesc;
- $my_post['post_status'] = "draft";
- $my_post['post_author'] = 1;
- $my_post['post_category'] = NULL;
- if (get_option("im_f_wcpt")) {
- $my_post['post_type'] = get_option("im_f_wcpt");
- } else {
- $my_post['post_type'] = "post";
- }
- $post_id = wp_insert_post($my_post);
- if ($post_id) {
- $doarray = array(
- get_option("yil-slug") => $year,
- get_option("sure") => $ftime,
- get_option("yonetmen") => $fdirect,
- get_option("mz_muzik") => $omusic,
- get_option("yi_yapimci") => $produ,
- get_option("so_senaryo") => $fwrites,
- get_option("im_imdb-puani") => $imdbp,
- get_option("gy_goruntu-yonetmeni") => $ocby
- );
- $doarray2 = array(
- "yil-slug",
- "sure",
- "yonetmen",
- "mz_muzik",
- "yi_yapimci",
- "so_senaryo",
- "im_imdb-puani",
- "gy_goruntu-yonetmeni"
- );
- foreach ($doarray as $value => $key) {
- if (get_option($doarray2[$value] . "_taxorspe") == "astax") {
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'")) == 0) {
- $wpdb->insert("{$wpdb->terms}", array(
- "name" => "" . $key . "",
- "slug" => "" . get_seo_link($key) . ""
- ), array(
- "%s",
- "%s"
- ));
- $yid = $wpdb->insert_id;
- } else {
- $ys = $wpdb->get_row("SELECT term_id FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'");
- $yid = $ys->term_id;
- }
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='{$value}'")) == 0) {
- $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id,taxonomy) VALUES ({$yid},'{$value}')");
- $ytid = $wpdb->insert_id;
- } else {
- $yts = $wpdb->get_row("SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='{$value}'");
- $ytid = $yts->term_taxonomy_id;
- }
- $wpdb->query("INSERT INTO {$wpdb->term_relationships} (object_id,term_taxonomy_id) VALUES (" . $post_id . "," . $ytid . ")");
- } else if (get_option($doarray2[$value] . "_taxorspe") == "asspe") {
- add_post_meta($post_id, $value, html_entity_decode($key, ENT_NOQUOTES, "UTF-8"));
- }
- }
- if (get_option("tf_ttur_taxorspe") == "astax") {
- foreach ($cats as $key) {
- $key = trim(preg_replace("/\\s+/", " ", strip_tags($key)));
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'")) == 0) {
- $wpdb->insert("{$wpdb->terms}", array(
- "name" => "" . $key . "",
- "slug" => "" . get_seo_link($key) . ""
- ), array(
- "%s",
- "%s"
- ));
- $yid = $wpdb->insert_id;
- } else {
- $ys = $wpdb->get_row("SELECT term_id FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'");
- $yid = $ys->term_id;
- }
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['tur-slug'] . "'")) == 0) {
- $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id,taxonomy) VALUES ({$yid},'" . $array_slugs['tur-slug'] . "')");
- $ytid = $wpdb->insert_id;
- } else {
- $yts = $wpdb->get_row("SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['tur-slug'] . "'");
- $ytid = $yts->term_taxonomy_id;
- }
- $wpdb->query("INSERT INTO {$wpdb->term_relationships} (object_id,term_taxonomy_id) VALUES (" . $post_id . "," . $ytid . ")");
- }
- } else if (get_option("tf_ttur_taxorspe") == "asspe") {
- $cai = 0;
- foreach ($cats as $ncat) {
- if ($cai != 0) {
- $addspe = ",";
- } else {
- $addspe = "";
- }
- $addcatn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($ncat)));
- ++$cai;
- }
- add_post_meta($post_id, get_option("tf_ttur"), $addcatn);
- }
- if (get_option("ooyuncu_taxorspe") == "astax") {
- foreach ($all_cast as $key) {
- $key = trim(strip_tags(str_replace(" ", "", $key)));
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'")) == 0) {
- $wpdb->insert("{$wpdb->terms}", array(
- "name" => "" . $key . "",
- "slug" => "" . get_seo_link($key) . ""
- ), array(
- "%s",
- "%s"
- ));
- $yid = $wpdb->insert_id;
- } else {
- $ys = $wpdb->get_row("SELECT term_id FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'");
- $yid = $ys->term_id;
- }
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['oyuncu-slug'] . "'")) == 0) {
- $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id,taxonomy) VALUES ({$yid},'" . $array_slugs['oyuncu-slug'] . "')");
- $ytid = $wpdb->insert_id;
- } else {
- $yts = $wpdb->get_row("SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['oyuncu-slug'] . "'");
- $ytid = $yts->term_taxonomy_id;
- }
- $wpdb->query("INSERT INTO {$wpdb->term_relationships} (object_id,term_taxonomy_id) VALUES (" . $post_id . "," . $ytid . ")");
- }
- } else if (get_option("ooyuncu_taxorspe") == "asspe") {
- $cai = 0;
- foreach ($all_cast as $nall_cast) {
- if ($cai != 0) {
- $addspe = ",";
- } else {
- $addspe = "";
- }
- $addcastn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($nall_cast)));
- ++$cai;
- }
- add_post_meta($post_id, get_option("ooyuncu"), $addcastn);
- }
- if (get_option("uulke_taxorspe") == "astax") {
- foreach ($country as $key) {
- $key = str_replace(" ", "", $key);
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'")) == 0) {
- $wpdb->insert("{$wpdb->terms}", array(
- "name" => "" . $key . "",
- "slug" => "" . get_seo_link($key) . ""
- ), array(
- "%s",
- "%s"
- ));
- $yid = $wpdb->insert_id;
- } else {
- $ys = $wpdb->get_row("SELECT term_id FROM {$wpdb->terms} WHERE slug='" . get_seo_link($key) . "'");
- $yid = $ys->term_id;
- }
- if ($wpdb->get_var($wpdb->prepare("SELECT COUNT(term_id) FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['ulke-slug'] . "'")) == 0) {
- $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id,taxonomy) VALUES ({$yid},'" . $array_slugs['ulke-slug'] . "')");
- $ytid = $wpdb->insert_id;
- } else {
- $yts = $wpdb->get_row("SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id=" . $yid . " AND taxonomy='" . $array_slugs['ulke-slug'] . "'");
- $ytid = $yts->term_taxonomy_id;
- }
- $wpdb->query("INSERT INTO {$wpdb->term_relationships} (object_id,term_taxonomy_id) VALUES (" . $post_id . "," . $ytid . ")");
- }
- } else if (get_option("uulke_taxorspe") == "asspe") {
- $cai = 0;
- foreach ($country as $ncountry) {
- if ($cai != 0) {
- $addspe = ",";
- } else {
- $addspe = "";
- }
- $addcounn .= $addspe . trim(preg_replace("/\\s+/", " ", strip_tags($ncountry)));
- ++$cai;
- }
- add_post_meta($post_id, get_option("uulke"), $addcounn);
- }
- if (get_option("gr_gorsel-adi_imgtoxor") == "fimage") {
- save_image($imglink, $rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($title) . "-afis.jpg");
- $thumbdir = "images/" . get_seo_link($title) . "-afis.jpg";
- $attachment = array(
- "post_mime_type" => "image/jpg",
- "post_title" => get_seo_link($title),
- "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($title) . "-afis.jpg");
- wp_update_attachment_metadata($attach_id, $attach_data);
- set_post_thumbnail($post_id, $attach_id);
- } else if (get_option("gr_gorsel-adi_imgtoxor") == "cimage") {
- $fthumb = $burl . $apt . "/wp-content/uploads/images/" . get_seo_link($title) . "-afis.jpg";
- add_post_meta($post_id, get_option("gr_gorsel-adi"), $fthumb);
- save_image($imglink, $rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($title) . "-afis.jpg");
- } else {
- save_image($imglink, $rootp . $apt . "/wp-content/uploads/images/" . get_seo_link($title) . "-afis.jpg");
- }
- echo "<p style=\"background-color:green;color:white;padding:10px;width:60%;\"><a style=\"color:white;\" href=\"post.php?post=" . $post_id . "&action=edit\">" . $title . "</a> başarıyla eklendi.</p>";
- }
- }
- curl_close($ch);
- }
- }
- function wbimdb_yonetime_ekle()
- {
- add_menu_page("WB IMDB Botu", "WB IMDB Botu", "administrator", basename(__FILE__), "bot_start");
- add_submenu_page(basename(__FILE__), "Bot Ayar Paneli", "Bot Ayar Paneli", "manage_options", "ffaimdbbotset", "ffaimdbbotset_function");
- }
- function ffaimdbbotset_function()
- {
- echo "<center><h1>Bot Ayar Paneli</h1><hr style=\"width:50%;border:2px solid #000;\" />";
- $array_slugs = array(
- "im_imdb-puani" => "IMDB Puanı",
- "yil-slug" => "Yıl",
- "uulke" => "Ülke",
- "tf_ttur" => "Tür",
- "sure" => "Süre",
- "yonetmen" => "Yönetmen",
- "ooyuncu" => "Oyuncu",
- "so_senaryo" => "Senaryo",
- "yi_yapimci" => "Yapımcı",
- "mz_muzik" => "Müzik",
- "gy_goruntu-yonetmeni" => "Görüntü Yönetmeni",
- "gr_gorsel-adi" => "Afiş Özel Alan Adı (özel alan ise)",
- "im_f_wcpt" => "Post Tipi"
- );
- echo "<h3>Film Bilgileri Ayarları</h3><p>Bu alandaki değerler, <b>taxonomy</b> ya da <b>custom field (özel alan)</b> isimleri olarak kullanılır.";
- if ($_POST['taxorspe'] == 1) {
- foreach ($_POST['optgo'] as $optyaz => $optval) {
- $optval = trim(preg_replace("/\\s+/", " ", strip_tags($optval)));
- if (get_option($optyaz)) {
- if (!empty($optval)) {
- update_option($optyaz, $optval);
- }
- } else if (!empty($optval)) {
- add_option($optyaz, $optval, "", "yes");
- }
- $selectname = $_POST[$optyaz . "_select"];
- if ($optyaz != "im_f_wcpt" && $optyaz != "gr_gorsel-adi") {
- if (get_option($optyaz . "_taxorspe")) {
- update_option($optyaz . "_taxorspe", $selectname);
- } else {
- add_option($optyaz . "_taxorspe", $selectname, "", "yes");
- }
- } else if ($optyaz == "gr_gorsel-adi") {
- if (get_option($optyaz . "_imgtoxor")) {
- update_option($optyaz . "_imgtoxor", $selectname);
- } else {
- add_option($optyaz . "_imgtoxor", $selectname, "", "yes");
- }
- }
- }
- echo "<p style=\"background-color:green;color:white;padding:10px;width:20%;\">Ad ayarları güncellendi.</p>";
- }
- echo "<form action=\"\" method=\"post\"><table>";
- foreach ($array_slugs as $abcyaz => $abckey) {
- if (get_option($abcyaz)) {
- $abcval = get_option($abcyaz);
- } else {
- $abcval = "";
- }
- echo "<tr><td>" . $abckey . " : </td><td><input type=\"text\" name=\"optgo[" . $abcyaz . "]\" value=\"" . $abcval . "\" />";
- if ($abcyaz != "im_f_wcpt") {
- if ($abcyaz == "gr_gorsel-adi") {
- echo "<select name=\"" . $abcyaz . "_select\">\r\n<option value=\"fimage\"" . (get_option($abcyaz . "_imgtoxor") == "fimage" ? " selected=\"selected\"" : "") . ">Öne Çıkarılmış Görsel</option>\r\n<option value=\"cimage\"" . (get_option($abcyaz . "_imgtoxor") == "cimage" ? " selected=\"selected\"" : "") . ">Özel Alana</option>\r\n<option value=\"descimage\"" . (get_option($abcyaz . "_imgtoxor") == "descimage" ? " selected=\"selected\"" : "") . ">Direkt Konu İçine</option>\r\n</select>";
- } else {
- echo "<select name=\"" . $abcyaz . "_select\">\r\n<option value=\"astax\"" . (get_option($abcyaz . "_taxorspe") == "astax" ? " selected=\"selected\"" : "") . ">Taxonomy Olarak</option>\r\n<option value=\"asspe\"" . (get_option($abcyaz . "_taxorspe") == "asspe" ? " selected=\"selected\"" : "") . ">Özel Alan</option>\r\n<option value=\"ditodesc\"" . (get_option($abcyaz . "_taxorspe") == "ditodesc" ? " selected=\"selected\"" : "") . ">Direkt Konu İçine</option></select>";
- }
- }
- echo "</td></tr>";
- }
- echo "<tr><td> </td><td align=\"right\"><input type=\"hidden\" name=\"taxorspe\" value=\"1\" /><input type=\"submit\" value=\"Güncelle!\" /></tr></table>Wordpress <b>Custom Post Type</b> kullanmıyorsanız <b>Post Tipi</b> alanını ellemeyiniz.</form>";
- }
- $rootp = $_SERVER['DOCUMENT_ROOT'];
- $burl = site_url();
- $apt = "";
- add_action("admin_menu", "wbimdb_yonetime_ekle");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement