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 yakutlisans()
- {
- $site = get_bloginfo("home");
- $site1 = "http://www.gameschrome.net";
- $site2 = "http://gameschrome.net";
- if ($site != $site1 && $site != $site2) {
- echo "Lutfen lisans al?n?z, Msn: ahmetozdemir@mail.com.";
- exit();
- }
- }
- function display_oynanmis()
- {
- $oynanma = getpostviews(get_the_id());
- return $oynanma;
- }
- function oyun_baslik($text)
- {
- $chars_limit = 15;
- $chars_text = strlen($text);
- $text = $text . " ";
- $text = substr($text, 0, $chars_limit);
- $text = substr($text, 0, strrpos($text, " "));
- if ($chars_limit < $chars_text) {
- $text = $text . "";
- }
- return $text;
- }
- function getpostviews($postID)
- {
- $count_key = "post_views_count";
- $count = get_post_meta($postID, $count_key, true);
- if ($count == "") {
- delete_post_meta($postID, $count_key);
- add_post_meta($postID, $count_key, "0");
- return "0";
- }
- return $count . "";
- }
- function setpostviews($postID)
- {
- $count_key = "post_views_count";
- $count = get_post_meta($postID, $count_key, true);
- if ($count == "") {
- $count = 0;
- delete_post_meta($postID, $count_key);
- add_post_meta($postID, $count_key, "0");
- } else {
- ++$count;
- update_post_meta($postID, $count_key, $count);
- }
- }
- function posts_column_views($defaults)
- {
- $defaults['post_views'] = __("Incelendi");
- return $defaults;
- }
- function posts_custom_column_views($column_name, $id)
- {
- if ($column_name === "post_views") {
- echo getpostviews(get_the_id());
- }
- }
- function fb_search_filter($query)
- {
- if (!$query->is_admin && $query->is_search) {
- $query->set("post_type", array(
- "post"
- ));
- }
- return $query;
- }
- function get_paged_navigation($number_of_pages_to_show = 9)
- {
- $current_page_number = ( integer ) $GLOBALS['paged'];
- $number_of_pages = ( integer ) $GLOBALS['wp_query']->max_num_pages;
- $first_txt = "«";
- $previous_txt = "‹";
- $next_txt = "›";
- $last_txt = "»";
- if ($number_of_pages < 2) {
- return true;
- }
- if (!$current_page_number) {
- $current_page_number = 1;
- }
- $last_head_page_number = ceil($number_of_pages_to_show / 2);
- $firt_tail_page_number = $number_of_pages - floor($number_of_pages_to_show / 2);
- if ($current_page_number <= $last_head_page_number) {
- $page_first_shown = 1;
- } else if ($firt_tail_page_number <= $current_page_number) {
- $page_first_shown = $number_of_pages - $number_of_pages_to_show + 1;
- } else {
- $page_first_shown = $current_page_number - ceil($number_of_pages_to_show / 2) + 1;
- }
- if ($page_first_shown != 1) {
- echo "<span>";
- echo get_previous_posts_link($previous_txt);
- echo " ";
- echo "</span>";
- }
- $i = 0;
- while ($i < $number_of_pages_to_show && $i < $number_of_pages) {
- echo "<span><a class=\"current\" href=\"";
- echo get_pagenum_link($page_first_shown + $i);
- echo "\">";
- echo $page_first_shown + $i;
- echo "</a></span> ";
- ++$i;
- }
- if ($page_first_shown + $number_of_pages_to_show < $number_of_pages + 1) {
- echo "<span>";
- echo get_next_posts_link($next_txt);
- echo " ";
- echo "</span>";
- }
- }
- function mytheme_add_box()
- {
- global $meta_box;
- add_meta_box($meta_box['id'], $meta_box['title'], "mytheme_show_box", $meta_box['page'], $meta_box['context'], $meta_box['priority']);
- }
- function mytheme_show_box()
- {
- global $meta_box;
- global $post;
- echo "<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"";
- echo wp_create_nonce(basename(__FILE__));
- echo "\" />";
- foreach ($meta_box['fields'] as $field) {
- $meta = get_post_meta($post->ID, $field['id'], true);
- echo "<tr>";
- echo "<th style=\"width:20%\"><label for=\"";
- echo $field['id'];
- echo "\">";
- echo $field['name'];
- echo "</label></th>";
- echo "<td>";
- switch ($field['type']) {
- case "checkbox":
- echo "<input type=\"checkbox\" name=\"";
- echo $field['id'];
- echo "\" id=\"";
- echo $field['id'];
- echo "\"";
- echo $meta ? " checked=\"checked\"" : "";
- echo " />";
- }
- echo "<td>";
- echo "</tr>";
- }
- }
- function mytheme_save_data($post_id)
- {
- global $meta_box;
- if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {
- return $post_id;
- }
- if (defined("DOING_AUTOSAVE") && DOING_AUTOSAVE) {
- return $post_id;
- }
- if ("page" == $_POST['post_type']) {
- return $post_id;
- }
- if (!current_user_can("edit_page", $post_id) && !current_user_can("edit_post", $post_id)) {
- return $post_id;
- }
- foreach ($meta_box['fields'] as $field) {
- $old = get_post_meta($post_id, $field['id'], true);
- $new = $_POST[$field['id']];
- if ($new && $new != $old) {
- update_post_meta($post_id, $field['id'], $new);
- } else if ("" == $new && $old) {
- delete_post_meta($post_id, $field['id'], $old);
- }
- }
- }
- function ii_create_meta_box()
- {
- add_meta_box("post-meta-boxes", __("Oyun Ekleme"), "post_meta_boxes", "post", "normal", "core");
- }
- function ii_post_meta_boxes()
- {
- $meta_boxes = array(
- "resim" => array(
- "name" => "resim",
- "title" => __("Resim Adresi:"),
- "type" => "text",
- "desc" => ""
- ),
- "oyun" => array(
- "name" => "oyun",
- "title" => __("Oyun Swf Adresi:"),
- "type" => "text",
- "desc" => "Eklediginiz oyun swf uzant?l? ise buraya ekleyin."
- ),
- "dcr" => array(
- "name" => "dcr",
- "title" => __("Oyun DCR Adresi:"),
- "type" => "text",
- "desc" => "Eklediginiz oyun dcr uzant?l? ise buraya ekleyin."
- ),
- "unity" => array(
- "name" => "unity",
- "title" => __("Oyun Unity Adresi:"),
- "type" => "text",
- "desc" => "Eklediginiz oyun .unidy3d uzant?l? ise buraya ekleyin."
- ),
- "frame" => array(
- "name" => "frame",
- "title" => __("Oyun Iframe Adresi:"),
- "type" => "text",
- "desc" => "Oyunu iframe olarak ekleyecekseniz buraya ekleyin."
- )
- );
- return apply_filters("ii_post_meta_boxes", $meta_boxes);
- }
- function ii_page_meta_boxes()
- {
- $meta_boxes = array(
- "teaser_text" => array(
- "name" => "teaser_text",
- "title" => __("Teaser"),
- "type" => "text",
- "desc" => "Here you can enter some short text for header teaser on a page."
- )
- );
- return apply_filters("ii_page_meta_boxes", $meta_boxes);
- }
- function post_meta_boxes()
- {
- global $post;
- $meta_boxes = ii_post_meta_boxes();
- echo "\t<table class=\"form-table\">\r\n\t";
- foreach ($meta_boxes as $meta) {
- $value = get_post_meta($post->ID, $meta['name'], true);
- if ($meta['type'] == "text") {
- get_meta_text_input($meta, $value);
- } else if ($meta['type'] == "textarea") {
- get_meta_textarea($meta, $value);
- } else if ($meta['type'] == "select") {
- get_meta_select($meta, $value);
- }
- }
- echo "\t</table>\r\n";
- }
- function page_meta_boxes()
- {
- global $post;
- $meta_boxes = ii_page_meta_boxes();
- echo "\t<table class=\"form-table\">\r\n\t";
- foreach ($meta_boxes as $meta) {
- $value = stripslashes(get_post_meta($post->ID, $meta['name'], true));
- if ($meta['type'] == "text") {
- get_meta_text_input($meta, $value);
- } else if ($meta['type'] == "textarea") {
- get_meta_textarea($meta, $value);
- } else if ($meta['type'] == "select") {
- get_meta_select($meta, $value);
- }
- }
- echo "\t</table>\r\n";
- }
- function get_meta_text_input($args = array(), $value = false)
- {
- extract($args);
- echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
- echo $name;
- echo "\">";
- echo $title;
- echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t<input type=\"text\" name=\"";
- echo $name;
- echo "\" id=\"";
- echo $name;
- echo "\" value=\"";
- echo wp_specialchars($value, 1);
- echo "\" size=\"30\" tabindex=\"30\" style=\"width: 97%;margin-top:-3px;\" />\r\n\t\t\t<input type=\"hidden\" name=\"";
- echo $name;
- echo "_noncename\" id=\"";
- echo $name;
- echo "_noncename\" value=\"";
- echo wp_create_nonce(plugin_basename(__FILE__));
- echo "\" />\r\n\t\t\t<br />\r\n\t\t\t<p class=\"description\">";
- echo $desc;
- echo "</p>\r\n\t\t</td>\r\n\t</tr>\r\n\t";
- }
- function get_meta_select($args = array(), $value = false)
- {
- extract($args);
- echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
- echo $name;
- echo "\">";
- echo $title;
- echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t";
- echo "<s";
- echo "elect name=\"";
- echo $name;
- echo "\" id=\"";
- echo $name;
- echo "\">\r\n\t\t\t";
- foreach ($options as $option) {
- echo "\t\t\t\t<option ";
- if (htmlentities($value, ENT_QUOTES) == $option) {
- echo " selected=\"selected\"";
- }
- echo ">\r\n\t\t\t\t\t";
- echo $option;
- echo "\t\t\t\t</option>\r\n\t\t\t";
- }
- echo "\t\t\t</select>\r\n\t\t\t<input type=\"hidden\" name=\"";
- echo $name;
- echo "_noncename\" id=\"";
- echo $name;
- echo "_noncename\" value=\"";
- echo wp_create_nonce(plugin_basename(__FILE__));
- echo "\" />\r\n\t\t</td>\r\n\t</tr>\r\n\t";
- }
- function get_meta_textarea($args = array(), $value = false)
- {
- extract($args);
- echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
- echo $name;
- echo "\">";
- echo $title;
- echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t<textarea name=\"";
- echo $name;
- echo "\" id=\"";
- echo $name;
- echo "\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;margin-top:-3px;\">";
- echo wp_specialchars($value, 1);
- echo "</textarea>\r\n\t\t\t<input type=\"hidden\" name=\"";
- echo $name;
- echo "_noncename\" id=\"";
- echo $name;
- echo "_noncename\" value=\"";
- echo wp_create_nonce(plugin_basename(__FILE__));
- echo "\" />\r\n\t\t</td>\r\n\t</tr>\r\n\t";
- }
- function ii_save_meta_data($post_id)
- {
- global $post;
- if ("page" == $_POST['post_type']) {
- $meta_boxes = array_merge(ii_page_meta_boxes());
- } else {
- $meta_boxes = array_merge(ii_post_meta_boxes());
- }
- foreach ($meta_boxes as $meta_box) {
- if (!wp_verify_nonce($_POST[$meta_box['name'] . "_noncename"], plugin_basename(__FILE__))) {
- return $post_id;
- }
- if ("page" == $_POST['post_type'] && !current_user_can("edit_page", $post_id)) {
- return $post_id;
- }
- if ("post" == $_POST['post_type'] && !current_user_can("edit_post", $post_id)) {
- return $post_id;
- }
- $data = stripslashes($_POST[$meta_box['name']]);
- if (get_post_meta($post_id, $meta_box['name']) == "") {
- add_post_meta($post_id, $meta_box['name'], $data, true);
- } else if ($data != get_post_meta($post_id, $meta_box['name'], true)) {
- update_post_meta($post_id, $meta_box['name'], $data);
- } else if ($data == "") {
- delete_post_meta($post_id, $meta_box['name'], get_post_meta($post_id, $meta_box['name'], true));
- }
- }
- }
- include("includes/update_notifier.php");
- add_shortcode("oynanma", "display_oynanmis");
- add_filter("manage_posts_columns", "posts_column_views");
- add_action("manage_posts_custom_column", "posts_custom_column_views", 5, 2);
- add_filter("pre_get_posts", "fb_search_filter");
- require_once(TEMPLATEPATH . "/admin/admin-functions.php");
- require_once(TEMPLATEPATH . "/admin/admin-interface.php");
- require_once(TEMPLATEPATH . "/admin/theme-settings.php");
- $prefix = "tus_";
- $meta_box = array(
- "id" => "my-meta-box",
- "title" => "Tuslar",
- "page" => "post",
- "context" => "normal",
- "priority" => "high",
- "fields" => array(
- array(
- "name" => "<center> TUSLAR AKTIF ",
- "id" => $prefix . "key_aktif",
- "type" => "checkbox"
- ),
- array(
- "name" => "</center><br/> YON ",
- "id" => $prefix . "key_yon",
- "type" => "checkbox"
- ),
- array(
- "name" => " FARE ",
- "id" => $prefix . "key_fare",
- "type" => "checkbox"
- ),
- array(
- "name" => " AWSD ",
- "id" => $prefix . "key_awsd",
- "type" => "checkbox"
- ),
- array(
- "name" => " BOSLUK ",
- "id" => $prefix . "key_bosluk",
- "type" => "checkbox"
- ),
- array(
- "name" => " SHIFT ",
- "id" => $prefix . "key_shift",
- "type" => "checkbox"
- ),
- array(
- "name" => " ALT ",
- "id" => $prefix . "key_alt",
- "type" => "checkbox"
- ),
- array(
- "name" => " CTRL ",
- "id" => $prefix . "key_ctrl",
- "type" => "checkbox"
- ),
- array(
- "name" => " 0 ",
- "id" => $prefix . "key_0",
- "type" => "checkbox"
- ),
- array(
- "name" => " 1 ",
- "id" => $prefix . "key_1",
- "type" => "checkbox"
- ),
- array(
- "name" => " 2 ",
- "id" => $prefix . "key_2",
- "type" => "checkbox"
- ),
- array(
- "name" => " 3 ",
- "id" => $prefix . "key_3",
- "type" => "checkbox"
- ),
- array(
- "name" => " 4 ",
- "id" => $prefix . "key_4",
- "type" => "checkbox"
- ),
- array(
- "name" => " 5 ",
- "id" => $prefix . "key_5",
- "type" => "checkbox"
- ),
- array(
- "name" => " 6 ",
- "id" => $prefix . "key_6",
- "type" => "checkbox"
- ),
- array(
- "name" => " 7 ",
- "id" => $prefix . "key_7",
- "type" => "checkbox"
- ),
- array(
- "name" => " 8 ",
- "id" => $prefix . "key_8",
- "type" => "checkbox"
- ),
- array(
- "name" => " 9 ",
- "id" => $prefix . "key_9",
- "type" => "checkbox"
- ),
- array(
- "name" => " A ",
- "id" => $prefix . "key_a",
- "type" => "checkbox"
- ),
- array(
- "name" => " B ",
- "id" => $prefix . "key_b",
- "type" => "checkbox"
- ),
- array(
- "name" => " C ",
- "id" => $prefix . "key_c",
- "type" => "checkbox"
- ),
- array(
- "name" => " D ",
- "id" => $prefix . "key_d",
- "type" => "checkbox"
- ),
- array(
- "name" => " E ",
- "id" => $prefix . "key_e",
- "type" => "checkbox"
- ),
- array(
- "name" => " F ",
- "id" => $prefix . "key_f",
- "type" => "checkbox"
- ),
- array(
- "name" => " G ",
- "id" => $prefix . "key_g",
- "type" => "checkbox"
- ),
- array(
- "name" => " H ",
- "id" => $prefix . "key_h",
- "type" => "checkbox"
- ),
- array(
- "name" => " I ",
- "id" => $prefix . "key_i",
- "type" => "checkbox"
- ),
- array(
- "name" => " J ",
- "id" => $prefix . "key_j",
- "type" => "checkbox"
- ),
- array(
- "name" => " K ",
- "id" => $prefix . "key_k",
- "type" => "checkbox"
- ),
- array(
- "name" => " L ",
- "id" => $prefix . "key_l",
- "type" => "checkbox"
- ),
- array(
- "name" => " M ",
- "id" => $prefix . "key_m",
- "type" => "checkbox"
- ),
- array(
- "name" => " N ",
- "id" => $prefix . "key_n",
- "type" => "checkbox"
- ),
- array(
- "name" => " O ",
- "id" => $prefix . "key_o",
- "type" => "checkbox"
- ),
- array(
- "name" => " P ",
- "id" => $prefix . "key_p",
- "type" => "checkbox"
- ),
- array(
- "name" => " Q ",
- "id" => $prefix . "key_q",
- "type" => "checkbox"
- ),
- array(
- "name" => " R ",
- "id" => $prefix . "key_r",
- "type" => "checkbox"
- ),
- array(
- "name" => " S ",
- "id" => $prefix . "key_s",
- "type" => "checkbox"
- ),
- array(
- "name" => " T ",
- "id" => $prefix . "key_t",
- "type" => "checkbox"
- ),
- array(
- "name" => " U ",
- "id" => $prefix . "key_u",
- "type" => "checkbox"
- ),
- array(
- "name" => " V ",
- "id" => $prefix . "key_v",
- "type" => "checkbox"
- ),
- array(
- "name" => " W ",
- "id" => $prefix . "key_w",
- "type" => "checkbox"
- ),
- array(
- "name" => " X ",
- "id" => $prefix . "key_x",
- "type" => "checkbox"
- ),
- array(
- "name" => " Y ",
- "id" => $prefix . "key_y",
- "type" => "checkbox"
- ),
- array(
- "name" => " Z ",
- "id" => $prefix . "key_z",
- "type" => "checkbox"
- )
- )
- );
- add_action("admin_menu", "mytheme_add_box");
- add_action("save_post", "mytheme_save_data");
- add_action("admin_menu", "ii_create_meta_box");
- add_action("save_post", "ii_save_meta_data");
- yakutlisans();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement