Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * @ Discord : PlayersMu#1991
- * @ Decoder version : 0.0.0.1
- */
- add_action("init", "lisans");
- include "functions-ek.php";
- include get_template_directory() . "/birbot/birbot.config.php";
- add_action("after_switch_theme", "birtema_aktivasyon");
- add_action("init", "bb_ust_menu_register");
- add_theme_support("post-thumbnails");
- if (function_exists("add_image_size")) {
- add_image_size("anasayfa_manset", 728, 468, true);
- add_image_size("anasayfa_manset_2", 728, 440, true);
- add_image_size("icerik_resim", 728, 440, true);
- add_image_size("anasayfa_manset_alt", 116, 78, true);
- add_image_size("anasayfa_mobil_manset", 275, 240, true);
- add_image_size("anasayfa_yan_manset", 300, 190, true);
- add_image_size("anasayfa_yan_manset_alt", 118, 80, true);
- add_image_size("anasayfa_bilesen", 242, 162, true);
- add_image_size("anasayfa_kategori_bilesen_ilk", 485, 428, true);
- add_image_size("anasayfa_kategori_bilesen_resim", 243, 163, true);
- add_image_size("anasayfa_icerik_bilesen_ilk", 598, 394, true);
- add_image_size("anasayfa_icerik_bilesen_iki", 446, 192, true);
- add_image_size("anasayfa_icerik_bilesen_thumb", 142, 96, true);
- add_image_size("ilgili_icerik", 159, 96, true);
- add_image_size("kategori_icerik", 226, 152, true);
- }
- add_theme_support("title-tag");
- show_admin_bar(false);
- add_action("wp_ajax_delete_message", "delete_message");
- add_action("wp_ajax_readed_message", "readed_message");
- require_once get_template_directory() . "/cs/codestar-framework.php";
- require_once get_template_directory() . "/inc/metabox/metabox.php";
- require_once get_template_directory() . "/inc/post-like.php";
- require_once get_template_directory() . "/inc/shortcode/shortcode.php";
- $bp_options = get_option("birbahis");
- register_sidebar(["name" => "Ana Sayfa (Üst)", "description" => "Buraya sadece Anasayfa (Üst) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Content)", "description" => "Buraya sadece Anasayfa (Content) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Üst Sidebar)", "description" => "Buraya sadece Anasayfa (Üst Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Manşet)", "description" => "Buraya sadece Anasayfa (Manşet) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Kategori (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Single)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Mobil - Üst)", "description" => "Buraya sadece (Anasayfa) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Ana Sayfa (Mobil - Alt)", "description" => "Buraya sadece (Anasayfa) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "İddaa Toplist (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Alt Üst (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Avrupa Top 10 (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Bilgisayar Tahminleri (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Değerli Oranlar (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Dünkü Maç Sonuçları (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Oranı Düşen Maçlar (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Tahmin (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Arama (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Üye Sayfası (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Canlı Sonuçlar (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- register_sidebar(["name" => "Fikstür (Sidebar)", "description" => "Buraya sadece (Sidebar) yazan bileşenleri eklemelisiniz.", "before_widget" => "", "after_widget" => "", "before_title" => "", "after_title" => ""]);
- add_action("wp", "update_online_users_status");
- if (!is_user_logged_in()) {
- add_action("init", "ajax_auth_init");
- }
- add_action("wp_ajax_nopriv_sunset_check_pagedNews", "sunset_check_pagedNews");
- add_action("wp_ajax_sunset_check_pagedNews", "sunset_check_pagedNews");
- add_action("wp_ajax_nopriv_sunset_load_moreNews", "sunset_load_moreNews");
- add_action("wp_ajax_sunset_load_moreNews", "sunset_load_moreNews");
- add_action("wp_ajax_nopriv_sunset_load_moreNewsMobile", "sunset_load_moreNewsMobile");
- add_action("wp_ajax_sunset_load_moreNewsMobile", "sunset_load_moreNewsMobile");
- add_action("wp_ajax_nopriv_sunset_load_moreAuthor", "sunset_load_moreAuthor");
- add_action("wp_ajax_sunset_load_moreAuthor", "sunset_load_moreAuthor");
- add_action("wp_ajax_iletisim", "iletisim");
- add_action("wp_ajax_nopriv_iletisim", "iletisim");
- add_action("wp_ajax_confirm_kupon", "confirm_kupon");
- add_action("wp_ajax_vip_kupon", "vip_kupon");
- add_action("wp_ajax_status_kupon", "status_kupon");
- add_action("wp_ajax_delete_kupon", "delete_kupon");
- add_action("wp_ajax_live_chat", "live_chat");
- add_action("wp_ajax_nopriv_live_chat", "live_chat");
- add_action("wp_ajax_get_live_chat", "get_live_chat");
- add_action("wp_ajax_nopriv_get_live_chat", "get_live_chat");
- add_action("wp_ajax_delete_live_chat", "delete_live_chat");
- add_action("wp_ajax_read_live_chat", "read_live_chat");
- add_action("show_user_profile", "my_user_profile_edit_action");
- add_action("edit_user_profile", "my_user_profile_edit_action");
- add_action("personal_options_update", "my_user_profile_update_action");
- add_action("edit_user_profile_update", "my_user_profile_update_action");
- add_action("init", "checkAccessed");
- add_filter("cron_schedules", "isa_add_every_three_minutes");
- if (!wp_next_scheduled("isa_add_every_three_minutes")) {
- wp_schedule_event(time(), "every_three_minutes", "isa_add_every_three_minutes");
- }
- add_action("isa_add_every_three_minutes", "data_cron");
- function lisans()
- {
- include "lisans.php";
- $domain = $_SERVER["HTTP_HOST"];
- $domain = str_replace("www.", "", $domain);
- $random = "3seas#fc0F6MRzgos3182";
- $h = "" . $random . "_" . $domain . "";
- $hash = md5($h);
- if ($hash != $lisans) {
- if ($hash != $lisans2) {
- if ($hash != $lisans3) {
- if ($hash != $lisans4) {
- if ($hash != $lisans5) {
- echo "Bu Tema Lisanssızdır. Lisansını almak için [email protected] mail adresinden iletişime geçebilirsiniz.";
- exit;
- }
- }
- }
- }
- }
- }
- function birtema_aktivasyon()
- {
- add_option("birbahis_versiyon", "1.0");
- require_once ABSPATH . "wp-admin/includes/upgrade.php";
- $sql3 = "CREATE TABLE `bt_follower` (\n `system_id` int(11) NOT NULL,\n `user_id` int(11) NOT NULL,\n `follow_id` int(11) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
- dbDelta($sql3);
- dbDelta("ALTER TABLE `bt_follower` ADD PRIMARY KEY (`system_id`);");
- dbDelta("ALTER TABLE `bt_follower` MODIFY `system_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;");
- $sql = "CREATE TABLE `bt_contact` (\n `contact_id` int(11) NOT NULL,\n `name` varchar(255) NOT NULL,\n `email` varchar(255) NOT NULL,\n `subject` varchar(255) NOT NULL,\n `message` longtext NOT NULL,\n `time` int(11) NOT NULL,\n `status` int(11) NOT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
- dbDelta($sql);
- dbDelta("ALTER TABLE `bt_contact` ADD PRIMARY KEY (`contact_id`);");
- dbDelta("ALTER TABLE `bt_contact` MODIFY `contact_id` int(11);");
- $sql2 = "CREATE TABLE `bt_live_chat` (\n `id` int(11) NOT NULL,\n `page_id` varchar(255) NOT NULL,\n `name` varchar(255) NOT NULL,\n `text` mediumtext NOT NULL,\n `status` int(11) NOT NULL,\n `time` int(11) NOT NULL\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n ALTER TABLE `bt_live_chat`\n ADD PRIMARY KEY (`id`);\n ALTER TABLE `bt_live_chat`\n MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;\n COMMIT;";
- dbDelta($sql2);
- dbDelta("CREATE TABLE `bt_odd` (\n `odd_id` int(11) NOT NULL,\n `user_id` int(11) NOT NULL,\n `data` json NOT NULL,\n `time` int(11) NOT NULL,\n `confirm` int(11) NOT NULL,\n `win` int(11) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\nALTER TABLE `bt_odd`\n ADD PRIMARY KEY (`odd_id`);\n\nALTER TABLE `bt_odd`\n MODIFY `odd_id` int(11) NOT NULL AUTO_INCREMENT;");
- }
- function bb_ust_menu_register()
- {
- register_nav_menus(["bbUstMenu" => __("Üst Menu", "theme_prefix")]);
- register_nav_menus(["bbMobileMenu1" => __("Mobil Menu 1", "theme_prefix"), "bbMobileMenu2" => __("Mobil Menu 2", "theme_prefix"), "bbMobileMenu3" => __("Mobil Menu 3", "theme_prefix")]);
- register_nav_menus(["bbFooter1" => __("Footer Menü 1", "theme_prefix"), "bbFooter2" => __("Footer Menü 2", "theme_prefix"), "bbFooter3" => __("Footer Menü 3", "theme_prefix"), "bbFooter4" => __("Footer Menü 4", "theme_prefix"), "bbFooter5" => __("Footer Menü 5", "theme_prefix"), "bbFooter6" => __("Footer Menü 6", "theme_prefix")]);
- }
- function bf_recent_post($limit)
- {
- $args = ["numberposts" => $limit, "offset" => 0, "orderby" => "post_date", "order" => "DESC", "include" => "", "exclude" => "", "meta_key" => "", "meta_value" => "", "post_type" => "post", "post_status" => "publish", "suppress_filters" => true];
- $recent_posts = wp_get_recent_posts($args, ARRAY_A);
- return $recent_posts;
- }
- 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 View";
- }
- return $count . " Views";
- }
- 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 delete_message()
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["contact_id"];
- $wpdb->delete("bt_contact", ["contact_id" => $id]);
- echo "Ok";
- wp_die();
- }
- }
- function readed_message()
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["contact_id"];
- $wpdb->update("bt_contact", ["status" => "0"], ["contact_id" => $id], ["%s"], ["%d"]);
- echo "Ok";
- wp_die();
- }
- }
- function kategori_listele($post_id)
- {
- $category_ids = wp_get_post_categories($post_id);
- $kategori_list = [];
- foreach ($category_ids as $key => $val) {
- $category_parent = get_category($category_ids[$key])->category_parent;
- if ($category_parent != 0 && !$kategori_list[0]) {
- $kategori_list[0] = $val;
- }
- if ($kategori_list[0]) {
- $category_parent = get_category($kategori_list[0])->category_parent;
- $kategori_list[1] = $category_parent;
- }
- }
- if (count($category_ids) == 1 || empty($kategori_list[1])) {
- $kategori_list[1] = $category_ids[0];
- }
- return $kategori_list;
- }
- function sinyor_comment($comment, $args, $depth)
- {
- $GLOBALS["comment"] = $comment;
- $PostAuthor = false;
- if ($comment->comment_author_email == get_the_author_email()) {
- $PostAuthor = true;
- } else {
- if ($comment->comment_author_email == "") {
- $PostAuthor = true;
- }
- }
- echo "\n<div class=\"comment ";
- if ($PostAuthor) {
- echo "authorcomment";
- }
- echo "\" id=\"li-yorum-";
- comment_ID();
- echo "\">\n\t<div class=\"avatar\">";
- echo get_avatar($comment, $size = "66");
- echo "</div>\n\t\t<div class=\"right\">\n\t\t\t<ul>\n\t\t\t\t<li>\n\t\t\t\t<div class=\"left\"><span class=\"commentAuthor\">";
- comment_author();
- echo "</span><span class=\"time\">";
- echo human_time_diff(get_comment_time("U"), current_time("timestamp")) . " önce";
- echo "</span></div>\n\t\t\t\t<div class=\"reply\">";
- comment_reply_link(array_merge($args, ["depth" => $depth, "max_depth" => $args["max_depth"]]));
- echo "</div>\n\t\t\t\t</li>\n\t\t\t\t<li><p>";
- comment_text();
- echo "</p></li>\n\n\t\t";
- if ("0" == $comment->comment_approved) {
- echo "\t\t<div class=\"yorumOnay\">* Yorumunuz onay bekliyor.</div>\n\t\t<script type=\"text/javascript\">\n\t\t setTimeout('Redirect()','1000');\n\t\t function Redirect()\n\t\t {\n\t\t\t\$('html, body').animate({\n\t\t\t\tscrollTop: \$('#li-yorum-";
- comment_ID();
- echo "').offset().top\n\t\t\t}, 1000);\n\t\t\treturn false;\n\t\t }\n\t\t</script>\n\t\t ";
- }
- echo "\t\t\t</ul>\n\t\t</div>\n</div>\n\n";
- }
- function get_snippet($str, $wordCount = 10)
- {
- $summary = strip_tags(implode("", array_slice(preg_split("/([\\s,\\.;\\?\\!]+)/", $str, $wordCount * 2 + 1, PREG_SPLIT_DELIM_CAPTURE), 0, $wordCount * 2 - 1)));
- preg_match_all("@\\[(.*?)\\]@si", $summary, $shortcode_regex);
- return str_replace($shortcode_regex[0], NULL, $summary);
- }
- function get_category_options()
- {
- $categories = get_categories(["orderby" => "name", "order" => "ASC"]);
- foreach ($categories as $category) {
- $category_data[$category->term_id] = $category->name;
- }
- return $category_data;
- }
- function permalink($str, $options = [])
- {
- $str = mb_convert_encoding((int) $str, "UTF-8", mb_list_encodings());
- $defaults = ["delimiter" => "-", "limit" => NULL, "lowercase" => true, "replacements" => [], "transliterate" => true];
- $options = array_merge($defaults, $options);
- $char_map = ["À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", "Æ" => "AE", "Ç" => "C", "È" => "E", "É" => "E", "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", "Ò" => "O", "Ó" => "o", "Ô" => "O", "Õ" => "O", "Ö" => "O", "Ő" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", "Û" => "U", "Ü" => "U", "Ű" => "U", "Ý" => "Y", "Þ" => "TH", "ß" => "ss", "à" => "a", "á" => "a", "â" => "a", "ã" => "a", "ä" => "a", "å" => "a", "æ" => "ae", "ç" => "c", "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", "ð" => "d", "ñ" => "n", "ò" => "o", "ó" => "o", "ô" => "o", "õ" => "o", "ö" => "o", "ő" => "o", "ø" => "o", "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", "ű" => "u", "ý" => "y", "þ" => "th", "ÿ" => "y", "©" => "(c)", "Α" => "A", "Β" => "B", "Γ" => "G", "Δ" => "D", "Ε" => "E", "Ζ" => "Z", "Η" => "H", "Θ" => "8", "Ι" => "I", "Κ" => "K", "Λ" => "L", "Μ" => "M", "Ν" => "N", "Ξ" => "3", "Ο" => "O", "Π" => "P", "Ρ" => "R", "Σ" => "S", "Τ" => "T", "Υ" => "Y", "Φ" => "F", "Χ" => "X", "Ψ" => "PS", "Ω" => "W", "Ά" => "A", "Έ" => "E", "Ί" => "I", "Ό" => "O", "Ύ" => "Y", "Ή" => "H", "Ώ" => "W", "Ϊ" => "I", "Ϋ" => "Y", "α" => "a", "β" => "b", "γ" => "g", "δ" => "d", "ε" => "e", "ζ" => "z", "η" => "h", "θ" => "8", "ι" => "i", "κ" => "k", "λ" => "l", "μ" => "m", "ν" => "n", "ξ" => "3", "ο" => "o", "π" => "p", "ρ" => "r", "σ" => "s", "τ" => "t", "υ" => "y", "φ" => "f", "χ" => "x", "ψ" => "ps", "ω" => "w", "ά" => "a", "έ" => "e", "ί" => "i", "ό" => "o", "ύ" => "y", "ή" => "h", "ώ" => "w", "ς" => "s", "ϊ" => "i", "ΰ" => "y", "ϋ" => "y", "ΐ" => "i", "Ş" => "S", "İ" => "I", "Ğ" => "G", "ş" => "s", "ı" => "i", "ğ" => "g", "А" => "A", "Б" => "B", "В" => "V", "Г" => "G", "Д" => "D", "Е" => "E", "Ё" => "Yo", "Ж" => "Zh", "З" => "Z", "И" => "I", "Й" => "J", "К" => "K", "Л" => "L", "М" => "M", "Н" => "N", "О" => "O", "П" => "P", "Р" => "R", "С" => "S", "Т" => "T", "У" => "U", "Ф" => "F", "Х" => "H", "Ц" => "C", "Ч" => "Ch", "Ш" => "Sh", "Щ" => "Sh", "Ъ" => "", "Ы" => "Y", "Ь" => "", "Э" => "E", "Ю" => "Yu", "Я" => "Ya", "а" => "a", "б" => "b", "в" => "v", "г" => "g", "д" => "d", "е" => "e", "ё" => "yo", "ж" => "zh", "з" => "z", "и" => "i", "й" => "j", "к" => "k", "л" => "l", "м" => "m", "н" => "n", "о" => "o", "п" => "p", "р" => "r", "с" => "s", "т" => "t", "у" => "u", "ф" => "f", "х" => "h", "ц" => "c", "ч" => "ch", "ш" => "sh", "щ" => "sh", "ъ" => "", "ы" => "y", "ь" => "", "э" => "e", "ю" => "yu", "я" => "ya", "Є" => "Ye", "І" => "I", "Ї" => "Yi", "Ґ" => "G", "є" => "ye", "і" => "i", "ї" => "yi", "ґ" => "g", "Č" => "C", "Ď" => "D", "Ě" => "E", "Ň" => "N", "Ř" => "R", "Š" => "S", "Ť" => "T", "Ů" => "U", "Ž" => "Z", "č" => "c", "ď" => "d", "ě" => "e", "ň" => "n", "ř" => "r", "š" => "s", "ť" => "t", "ů" => "u", "ž" => "z", "Ą" => "A", "Ć" => "C", "Ę" => "e", "Ł" => "L", "Ń" => "N", "Ś" => "S", "Ź" => "Z", "Ż" => "Z", "ą" => "a", "ć" => "c", "ę" => "e", "ł" => "l", "ń" => "n", "ś" => "s", "ź" => "z", "ż" => "z", "Ā" => "A", "Ē" => "E", "Ģ" => "G", "Ī" => "i", "Ķ" => "k", "Ļ" => "L", "Ņ" => "N", "Ū" => "u", "ā" => "a", "ē" => "e", "ģ" => "g", "ī" => "i", "ķ" => "k", "ļ" => "l", "ņ" => "n", "ū" => "u"];
- $str = preg_replace(array_keys($options["replacements"]), $options["replacements"], $str);
- if ($options["transliterate"]) {
- $str = str_replace(array_keys($char_map), $char_map, $str);
- }
- $str = preg_replace("/[^\\p{L}\\p{Nd}]+/u", $options["delimiter"], $str);
- $str = preg_replace("/(" . preg_quote($options["delimiter"], "/") . "){2,}/", "\$1", $str);
- $str = mb_substr($str, 0, $options["limit"] ? $options["limit"] : mb_strlen($str, "UTF-8"), "UTF-8");
- $str = trim($str, $options["delimiter"]);
- return $options["lowercase"] ? mb_strtolower($str, "UTF-8") : $str;
- }
- function month_eng_to_tr($str)
- {
- $ing_aylar = ["January", "February", "March", "May", "April", "June", "July", "August", "September", "October", "November", "December"];
- $tr_aylar = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
- return str_replace($ing_aylar, $tr_aylar, $str);
- }
- function month_perma_to_text($str)
- {
- $ing_aylar = ["January", "February", "March", "May", "April", "June", "July", "August", "September", "October", "November", "December"];
- $tr_aylar = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
- return str_replace($ing_aylar, $tr_aylar, $str);
- }
- function jpegImgCrop($target_url)
- {
- $image = imagecreatefromjpeg($target_url);
- $filename = $target_url;
- $width = imagesx($image);
- $height = imagesy($image);
- $image_type = imagetypes($image);
- if ($width == $height) {
- $thumb_width = $width;
- $thumb_height = $height;
- } else {
- if ($width < $height) {
- $thumb_width = $width;
- $thumb_height = $width;
- } else {
- if ($height < $width) {
- $thumb_width = $height;
- $thumb_height = $height;
- } else {
- $thumb_width = 150;
- $thumb_height = 150;
- }
- }
- }
- $original_aspect = $width / $height;
- $thumb_aspect = $thumb_width / $thumb_height;
- if ($thumb_aspect <= $original_aspect) {
- $new_height = $thumb_height;
- $new_width = $width / ($height / $thumb_height);
- } else {
- $new_width = $thumb_width;
- $new_height = $height / ($width / $thumb_width);
- }
- $thumb = imagecreatetruecolor($thumb_width, $thumb_height);
- imagecopyresampled($thumb, $image, 0 - ($new_width - $thumb_width) / 2, 0 - ($new_height - $thumb_height) / 2, 0, 0, $new_width, $new_height, $width, $height);
- imagejpeg($thumb, $filename, 80);
- }
- function get_user_role($id)
- {
- $user = new WP_User($id);
- return array_shift($user->roles);
- }
- function update_online_users_status()
- {
- if (is_user_logged_in()) {
- if (($logged_in_users = get_transient("users_online")) === false) {
- $logged_in_users = [];
- }
- $current_user = wp_get_current_user();
- $current_user = $current_user->ID;
- $current_time = current_time("timestamp");
- if (!isset($logged_in_users[$current_user]) || $logged_in_users[$current_user] < $current_time - 900) {
- $logged_in_users[$current_user] = $current_time;
- set_transient("users_online", $logged_in_users, 1800);
- }
- }
- }
- function is_user_online($user_id)
- {
- $logged_in_users = get_transient("users_online");
- return isset($logged_in_users[$user_id]) && current_time("timestamp") - 900 < $logged_in_users[$user_id];
- }
- function auth_user_login($user_login, $password, $login)
- {
- $info = [];
- $info["user_login"] = $user_login;
- $info["user_password"] = $password;
- $info["remember"] = true;
- $user_signon = wp_signon($info, "");
- if (is_wp_error($user_signon)) {
- echo json_encode(["loggedin" => false, "message" => __("Kullanıcı adı veya şifre yanlış.")]);
- } else {
- wp_set_current_user($user_signon->ID);
- echo json_encode(["loggedin" => true, "message" => __("Giriş başarılı, yönlendiriliyorsunuz...")]);
- }
- exit;
- }
- function ajax_auth_init()
- {
- wp_register_script("validate-script", get_template_directory_uri() . "/js/jquery.validate.js", ["jquery"]);
- wp_enqueue_script("validate-script");
- wp_register_script("ajax-auth-script", get_template_directory_uri() . "/js/ajax-auth-script.js", ["jquery"]);
- wp_enqueue_script("ajax-auth-script");
- wp_localize_script("ajax-auth-script", "ajax_auth_object", ["ajaxurl" => admin_url("admin-ajax.php"), "redirecturl" => home_url(), "loadingmessage" => __("Bilgiler gönderiliyor, lütfen bekleyin...")]);
- add_action("wp_ajax_nopriv_ajaxlogin", "ajax_login");
- add_action("wp_ajax_nopriv_ajaxregister", "ajax_register");
- }
- function ajax_login()
- {
- check_ajax_referer("ajax-login-nonce", "security");
- auth_user_login($_POST["username"], $_POST["password"], "Login");
- exit;
- }
- function ajax_register()
- {
- check_ajax_referer("ajax-register-nonce", "security");
- $info = [];
- $info["user_login"] = sanitize_user($_POST["username"]);
- $info["first_name"] = $info["user_login"];
- $info["display_name"] = $info["first_name"];
- $info["nickname"] = $info["display_name"];
- $info["user_nicename"] = $info["nickname"];
- $info["user_pass"] = sanitize_text_field($_POST["password"]);
- $info["user_email"] = sanitize_email($_POST["email"]);
- $user_register = wp_insert_user($info);
- if (is_wp_error($user_register)) {
- $error = $user_register->get_error_codes();
- if (in_array("empty_user_login", $error)) {
- echo json_encode(["loggedin" => false, "message" => __($user_register->get_error_message("empty_user_login"))]);
- } else {
- if (in_array("existing_user_login", $error)) {
- echo json_encode(["loggedin" => false, "message" => __("Bu kullanıcı adı kullanılıyor.")]);
- } else {
- if (in_array("existing_user_email", $error)) {
- echo json_encode(["loggedin" => false, "message" => __("Bu e-mail adresi kullanılıyor.")]);
- }
- }
- }
- } else {
- auth_user_login($info["nickname"], $info["user_pass"], "Registration");
- }
- exit;
- }
- function sunset_check_pagedNews($num = NULL)
- {
- $output = "";
- if (is_paged()) {
- $output = "page/" . get_query_var("paged");
- }
- if ($num == 1) {
- $paged = get_query_var("paged") == 0 ? 1 : get_query_var("paged");
- return $paged;
- }
- return $output;
- }
- function sunset_load_moreNews()
- {
- $paged = $_POST["page"] + 1;
- $prev = $_POST["prev"];
- $catID = $_POST["cat"];
- if ($prev == 1 && $_POST["page"] != 1) {
- $paged = $_POST["page"] - 1;
- }
- $query = new WP_Query(["post_status" => "publish", "paged" => $paged, "category__in" => $catID, "posts_per_page" => 15, "ignore_sticky_posts" => "-1", "order" => "desc"]);
- if ($query->have_posts()) {
- while ($query->have_posts()) {
- $query->the_post();
- $current_id = get_the_ID();
- $category_ids = kategori_listele($current_id);
- echo "<div class=\"post\" data-page=\"" . $paged . "\">";
- echo " <div class=\"thumb\"><a href=\"";
- the_permalink();
- echo "\">";
- the_post_thumbnail("kategori_icerik", ["alt" => get_the_title()]);
- echo "</a></div>\n <a href=\"";
- the_permalink();
- echo "\" class=\"title\">";
- echo the_title();
- echo "</a>\n </div>\n\n\t";
- }
- } else {
- echo 0;
- }
- wp_reset_postdata();
- exit;
- }
- function sunset_load_moreNewsMobile()
- {
- $paged = $_POST["page"] + 1;
- $prev = $_POST["prev"];
- $catID = $_POST["cat"];
- if ($prev == 1 && $_POST["page"] != 1) {
- $paged = $_POST["page"] - 1;
- }
- $query = new WP_Query(["post_status" => "publish", "paged" => $paged, "category__in" => $catID, "posts_per_page" => 16, "ignore_sticky_posts" => "-1", "order" => "desc"]);
- if ($query->have_posts()) {
- while ($query->have_posts()) {
- $query->the_post();
- $current_id = get_the_ID();
- $category_ids = kategori_listele($current_id);
- echo "<div class=\"post\" data-page=\"" . $paged . "\">";
- echo " <div class=\"thumb\"><a href=\"";
- the_permalink();
- echo "\">";
- the_post_thumbnail("kategori_icerik", ["alt" => get_the_title()]);
- echo "</a></div>\n <a href=\"";
- the_permalink();
- echo "\" class=\"title\">";
- echo the_title();
- echo "</a>\n </div>\n\n\t";
- }
- } else {
- echo 0;
- }
- wp_reset_postdata();
- exit;
- }
- function sunset_load_moreAuthor()
- {
- $paged = $_POST["page"] + 1;
- $prev = $_POST["prev"];
- $authorIn = $_POST["author"];
- if ($prev == 1 && $_POST["page"] != 1) {
- $paged = $_POST["page"] - 1;
- }
- $query = new WP_Query(["post_status" => "publish", "paged" => $paged, "author" => $authorIn, "posts_per_page" => "12"]);
- if ($query->have_posts()) {
- while ($query->have_posts()) {
- $query->the_post();
- $current_id = get_the_ID();
- $category_ids = kategori_listele($current_id);
- echo "<div class=\"post\" data-page=\"/page/" . $paged . "\">";
- echo "<div class=\"thumb\"><a href=\"";
- the_permalink();
- echo "\">";
- the_post_thumbnail("icerik_image", ["alt" => get_the_title()]);
- echo "</a></div>\n<a href=\"";
- the_permalink();
- echo "\" class=\"title\">";
- the_title();
- echo "</a>\n</div>\n";
- }
- } else {
- echo 0;
- }
- wp_reset_postdata();
- exit;
- }
- function sunset_check_pagedAuthor($num = NULL)
- {
- $output = "";
- if (is_paged()) {
- $output = "page/" . get_query_var("paged");
- }
- if ($num == 1) {
- $paged = get_query_var("paged") == 0 ? 1 : get_query_var("paged");
- return $paged;
- }
- return $output;
- }
- function security_post($data)
- {
- return htmlspecialchars(trim($data));
- }
- function iletisim()
- {
- global $wpdb;
- $wpdb->insert("bt_contact", ["name" => security_post($_POST["name"]), "email" => security_post($_POST["email"]), "subject" => security_post($_POST["subject"]), "message" => security_post($_POST["message"]), "time" => time(), "status" => 1]);
- echo "Ok";
- wp_die();
- }
- function confirm_kupon($coupon_id)
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $wpdb->update("bt_odd", ["confirm" => "1"], ["odd_id" => $id], ["%s"], ["%d"]);
- echo "Ok";
- wp_die();
- }
- }
- function vip_kupon($coupon_id)
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $wpdb->update("bt_odd", ["confirm" => "2"], ["odd_id" => $id], ["%s"], ["%d"]);
- echo "Ok";
- wp_die();
- }
- }
- function status_kupon($coupon_id)
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $status = $_POST["status"];
- $wpdb->update("bt_odd", ["status" => $status], ["odd_id" => $id], ["%s"], ["%d"]);
- echo "Ok";
- wp_die();
- }
- }
- function delete_kupon()
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $wpdb->delete("bt_odd", ["odd_id" => $id]);
- echo "Ok";
- wp_die();
- }
- }
- function live_chat()
- {
- global $wpdb;
- global $bp_options;
- $page_id = $_POST["page_id"];
- $name = $_POST["name"];
- $comment = $_POST["comment"];
- $kufurArray = explode(",", $bp_options["kufurText"]);
- $wpdb->insert("bt_live_chat", ["page_id" => security_post($page_id), "name" => security_post($name), "text" => security_post($comment), "status" => 1, "time" => time()]);
- $data_id = $wpdb->insert_id;
- echo "<div class=\"comment authorcomment newChat_" . $_POST["random_key"] . "\" style=\"border: 1px solid rgb(219, 223, 228);\" data-id=\"" . $data_id . "\">\n <div class=\"right\" style=\"width: calc(100% - 10px); padding-left: 10px;padding-right: 15px;padding-top:10px;padding-bottom:10px;\">\n <ul>\n <li><span class=\"social-avatar\">" . mb_strtoupper(mb_substr($name, 0, 1, "UTF-8")) . "</span><div class=\"left\" style=\"margin-top: 3px;\">\n <span class=\"commentAuthor\" style=\"color: #0f7c39;\">@" . $name . "</span>\n <span class=\"time\" style=\"font-weight: 400;\">Şimdi</span></div>\n </li><li style=\"font-weight: 500;word-wrap:break-word;position:relative; bottom: 5px;\">\n <p>" . str_replace($kufurArray, "***", $comment) . "</p></li></ul></div></div>";
- wp_die();
- }
- function get_live_chat()
- {
- global $wpdb;
- global $bp_options;
- $kufurArray = explode(",", $bp_options["kufurText"]);
- $page_id = $_POST["page_id"];
- $json_return = [];
- $live_chat = $wpdb->get_results("SELECT * FROM bt_live_chat WHERE page_id = '" . $page_id . "' ORDER BY id");
- foreach ($live_chat as $key => $value) {
- echo " ";
- $json_return[$value->id]["html"] = "<div class=\"comment authorcomment\" style=\"border: 1px solid #dbdfe4;\" data-id=\"" . $value->id . "\"><div class=\"right\" style=\"width: calc(100% - 10px); padding-left: 15px;padding-right: 15px;padding-top:10px;padding-bottom:10px;\">\n <ul style=\"height:auto!important;\">\n <li style=\"height: auto;\">\n <span class=\"social-avatar\">" . mb_strtoupper(mb_substr($value->name, 0, 1), "UTF-8") . "</span>\n <div class=\"left\"><span class=\"commentAuthor\" style=\"color: #0f7c39;\">@" . $value->name . "</span><span class=\"time\" style=\"font-weight: 400;\">" . timeConvert(date("Y-m-d H:i:s", $value->time)) . "</span></div>\n </li>\n <li style=\"padding:0 5px;font-weight: 500;word-wrap:break-word;height: auto;\"><p>" . str_replace($kufurArray, "***", strip_tags(html_entity_decode($value->text), "<br /><strong><b><u>")) . "</p></li>\n </ul>\n </div></div>";
- $json_return["search_id"][] = $value->id;
- }
- echo json_encode($json_return, true);
- wp_die();
- }
- function delete_live_chat()
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $wpdb->delete("bt_live_chat", ["id" => $id]);
- echo "Ok";
- wp_die();
- }
- }
- function read_live_chat()
- {
- if (is_admin()) {
- global $wpdb;
- $id = $_POST["id"];
- $wpdb->update("bt_live_chat", ["status" => "0"], ["id" => $id], ["%s"], ["%d"]);
- echo "Ok";
- wp_die();
- }
- }
- function timeConvert($zaman)
- {
- $zaman = strtotime($zaman);
- $zaman_farki = time() - $zaman;
- $saniye = $zaman_farki;
- $dakika = round($zaman_farki / 60);
- $saat = round($zaman_farki / 3600);
- $gun = round($zaman_farki / 86400);
- $hafta = round($zaman_farki / 604800);
- $ay = round($zaman_farki / 2419200);
- $yil = round($zaman_farki / 29030400);
- if ($saniye < 60) {
- if ($saniye == 0) {
- return "az önce";
- }
- return $saniye . " saniye önce";
- }
- if ($dakika < 60) {
- return $dakika . " dakika önce";
- }
- if ($saat < 24) {
- return $saat . " saat önce";
- }
- if ($gun < 7) {
- return $gun . " gün önce";
- }
- if ($hafta < 4) {
- return $hafta . " hafta önce";
- }
- if ($ay < 12) {
- return $ay . " ay önce";
- }
- return $yil . " yıl önce";
- }
- function percentageCalculator($a, $b)
- {
- $returnData = ceil(100 * $a / $b);
- if (is_nan($returnData)) {
- return 0;
- }
- return $returnData;
- }
- function shortContent($kelime, $str = 10)
- {
- if ($str < strlen($kelime)) {
- if (function_exists("mb_substr")) {
- $kelime = mb_substr($kelime, 0, $str, "UTF-8") . "...";
- } else {
- $kelime = substr($kelime, 0, $str) . "...";
- }
- }
- return $kelime;
- }
- function my_user_profile_edit_action($user)
- {
- $checked = isset($user->vip_uye) && $user->vip_uye ? " checked=\"checked\"" : "";
- if (current_user_can("administrator")) {
- echo " <h3>VIP Üye</h3>\n <label for=\"vip_uye\">\n <input name=\"vip_uye\" type=\"checkbox\" id=\"vip_uye\" value=\"1\"";
- echo $checked;
- echo ">\n Vip üye olmasını istiyorsanız işaretleyin.\n </label>\n";
- }
- }
- function my_user_profile_update_action($user_id)
- {
- if (current_user_can("administrator")) {
- update_user_meta($user_id, "vip_uye", isset($_POST["vip_uye"]));
- }
- }
- function checkAccessed()
- {
- if (!isset($_COOKIE["accessed"])) {
- setcookie("accessed", "yes", time() + 604800);
- define("ACCESSED", false);
- } else {
- define("ACCESSED", true);
- }
- }
- function wp_resim_ekle($t, $url, $pid, $bas = NULL, $ozelalan = NULL)
- {
- $filename = $bas . (int) $t;
- $filename = remove_accents($filename);
- if (function_exists("mb_strtolower")) {
- $filename = mb_strtolower($filename, "UTF-8");
- }
- $filename = utf8_uri_encode($filename);
- $filetype = wp_check_filetype($url);
- extract($filetype);
- if (!$type) {
- $type = "";
- }
- $upload = wp_upload_bits($filename, $filetype, @file_get_contents($url));
- if (!empty($upload["error"])) {
- return "Resim eklenemedi!<br />Hata: " . $upload["error"] . "<br />";
- }
- $neyim = $upload["file"];
- $attachment = ["guid" => $upload["url"], "post_mime_type" => $type, "post_title" => $bas, "post_content" => "", "post_type" => "attachment", "post_parent" => $pid];
- $attach_id = wp_insert_attachment($attachment, $neyim, $pid);
- $attach_data = wp_generate_attachment_metadata($attach_id, $neyim);
- wp_update_attachment_metadata($attach_id, $attach_data);
- add_post_meta($pid, "_thumbnail_id", $attach_id, true);
- update_post_meta($pid, "_wp_attachment_image_alt", $attach_id, true);
- $nane = $neyim;
- return $nane;
- }
- function upload_img($t, $url, $pid, $bas = NULL, $ozelalan = NULL)
- {
- $filename = $bas . (int) $t;
- $filename = remove_accents($filename);
- if (function_exists("mb_strtolower")) {
- $filename = mb_strtolower($filename, "UTF-8");
- }
- $filename = utf8_uri_encode($filename);
- $filetype = wp_check_filetype($url);
- extract($filetype);
- if (!$type) {
- $type = "";
- }
- $upload = wp_upload_bits($filename, $filetype, @file_get_contents($url));
- if (!empty($upload["error"])) {
- return "Resim eklenemedi!<br />Hata: " . $upload["error"] . "<br />";
- }
- $neyim = $upload["file"];
- $attachment = ["guid" => $upload["url"], "post_mime_type" => $type, "post_title" => $bas, "post_content" => "", "post_type" => "attachment", "post_parent" => $pid];
- $attach_id = wp_insert_attachment($attachment, $neyim, $pid);
- $attach_data = wp_generate_attachment_metadata($attach_id, $neyim);
- wp_update_attachment_metadata($attach_id, $attach_data);
- $nane = $neyim;
- return $upload["url"];
- }
- function isa_add_every_three_minutes($schedules)
- {
- $schedules["every_three_minutes"] = ["interval" => 900, "display" => __("Every 15 Minutes", "textdomain")];
- return $schedules;
- }
- function data_cron()
- {
- include get_template_directory() . "/api/api_helper.php";
- $bahisKaynak = get_url_curl("https://www.bahisanaliz8.com/iddaa-en-cok-oynanan-maclar/");
- preg_match_all("@<div class=\"fl Karsilasma\" style=\"width: 350px;\">(.*?)</div>@si", $bahisKaynak, $matchName);
- preg_match_all("@<div class=\"fl IddaaKodu Tahmin tc\" style=\"width: 60px;\">(.*?)</div>@si", $bahisKaynak, $tahmin);
- preg_match_all("@<div class=\"fl Oran tc\" style=\"width: 55px;\">(.*?)</div>@si", $bahisKaynak, $odd);
- preg_match_all("@<div class=\"fl tr Yuzde\" style=\"width: 55px;\">(.*?)</div>@si", $bahisKaynak, $yuzde);
- $data_json["matchName"] = $matchName;
- $data_json["tahmin"] = $tahmin;
- $data_json["odd"] = $odd;
- $data_json["yuzde"] = $yuzde;
- $bahisKaynak2 = get_url_curl("https://www.bahisanaliz8.com/avrupa-en-cok-oynanan-maclar/");
- preg_match_all("@<div class=\"fl Karsilasma\" style=\"width: 185px;\">(.*?)</div>@si", $bahisKaynak2, $matchName2);
- preg_match_all("@<div class=\"ThmTxt\" style=\"display:none;\">Tahmin: </div><div class=\"ThmDgr fl\"> (.*?)</div></div>@si", $bahisKaynak2, $tahmin2);
- preg_match_all("@<div class=\"OranDgr fl\"> (.*?)</div>@si", $bahisKaynak2, $odd2);
- preg_match_all("@<div class=\"fl tr Yuzde\" style=\"width: 55px;\">(.*?)</div>@si", $bahisKaynak2, $yuzde2);
- $data_json["matchName2"] = $matchName2;
- $data_json["tahmin2"] = $tahmin2;
- $data_json["odd2"] = $odd2;
- $data_json["yuzde2"] = $yuzde2;
- include get_template_directory() . "/api/puan_durumu.php";
- $data_json["team_tr"] = $team_tr;
- $bahisKaynak3 = get_url_curl("https://www.bahisanaliz8.com/orani-dusen-maclar/");
- preg_match_all("@<div class=\"fl LigAdi pt7\">(.*?)</div>@si", $bahisKaynak3, $ligAdi);
- preg_match_all("@<div class=\"fl GunTarih pt7\">(.*?)</div>@si", $bahisKaynak3, $gunTarih);
- preg_match_all("@<div class=\"fl Takim tr pt7\" style=\"width: 111px; overflow:hidden\">(.*?)</div>@si", $bahisKaynak3, $ev_sahibi);
- preg_match_all("@<div class=\"fl Takim pt7 tl\" style=\"width: 104px;\">(.*?)</div>@si", $bahisKaynak3, $deplasman);
- preg_match_all("@<div class=\"ODOranlarIc dnn\">(.*?)<div class=\"fl Takim pt7 tl\"@si", $bahisKaynak3, $oranlar);
- $data_json["ligAdi"] = $ligAdi;
- $data_json["gunTarih"] = $gunTarih;
- $data_json["ev_sahibi"] = $ev_sahibi;
- $data_json["deplasman"] = $deplasman;
- $data_json["oranlar"] = $oranlar;
- $dt = fopen("cron.json", "w");
- fwrite($dt, json_encode($data_json, true));
- fclose($dt);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement