Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* * @ https://EasyToYou.eu - IonCube v11 Decoder Online * @ PHP 7.2 & 7.3 * ..
Decoded Output download
<?php
/*
* @ https://EasyToYou.eu - IonCube v11 Decoder Online
* @ PHP 7.2 & 7.3
* @ Decoder version: 1.0.6
* @ Release: 10/08/2022
*/
global $pagenow;
if (is_admin() && "admin.php" == $pagenow && isset($_GET["activated"])) {
wp_redirect(admin_url("themes.php?page=tv-lisans-ayarlari"));
}
if (!defined("ABSPATH")) {
exit;
}
add_action("admin_notices", "TemaVadisi_admin_mesaji");
add_action("admin_init", "TemaVadisi_admin_mesaji_kapat");
require_once get_parent_theme_file_path("/inc/temapanel/cs-framework.php");
require_once get_parent_theme_file_path("/functions-custom.php");
require_once get_parent_theme_file_path("/inc/update_notifier.php");
require_once get_parent_theme_file_path("/inc/eklentiler.php");
require_once get_parent_theme_file_path("/inc/galeri-metabox/gallery.php");
require_once get_parent_theme_file_path("/inc/navigasyon.php");
require_once get_parent_theme_file_path("/inc/iconfilter.php");
require_once get_parent_theme_file_path("/inc/menu-image/menu-image.php");
require_once get_parent_theme_file_path("/inc/metaboxes.php");
require_once get_parent_theme_file_path("/inc/comment_review.php");
require_once get_parent_theme_file_path("/inc/bilesenler.php");
define("CS_ACTIVE_METABOX", true);
define("CS_ACTIVE_TAXONOMY", false);
define("CS_ACTIVE_SHORTCODE", false);
define("CS_ACTIVE_CUSTOMIZE", false);
add_action("wp_enqueue_scripts", "TemaVadisi_js_dosyalari");
add_action("admin_enqueue_scripts", "TemaVadisi_adminjs_dosyalari");
add_action("init", "TemaVadisi_admin_js_ekle");
add_action("get_header", "TemaVadisi_custom_css");
add_theme_support("html5", ["search-form", "comment-form", "comment-list", "gallery", "caption"]);
add_theme_support("post-thumbnails");
register_nav_menus(["anamenu" => __("Ana Men", "temavadisi"), "mobilmenu" => __("Mobil Men", "temavadisi")]);
add_filter("pt-ocdi/import_files", "ocdi_import_files");
add_action("pt-ocdi/after_import", "ocdi_after_import_setup");
add_action("after_setup_theme", "TemaVadisi_setup");
add_image_size("ilanimg", 273, 180, ["center", "top"]);
add_image_size("galeriL", 535, 423, ["center", "top"]);
add_image_size("galeriT", 100, 75, ["center", "top"]);
add_image_size("benzerimg", 385, 254, ["center", "top"]);
add_image_size("ilanlar", 550, 412, ["center", "top"]);
add_action("widgets_init", "TemaVadisi_Bilesen_Destegi");
class TemaVadisi_Walker_Menu extends Walker
{
public $db_fields = ["parent" => "menu_item_parent", "id" => "db_id"];
public function start_lvl(&$output, $depth = 0, $args = [])
{
$indent = str_repeat(" ", $depth);
$output .= "
" . $indent . "<ul>
";
}
public function end_lvl(&$output, $depth = 0, $args = [])
{
$indent = str_repeat(" ", $depth);
$output .= $indent . "</ul>
";
}
public function start_el(&$output, $item, $depth = 0, $args = [], $id = 0)
{
global $wp_query;
$indent = $depth ? str_repeat(" ", $depth) : "";
$class_names = $value = "";
$classes = empty($item->classes) ? [] : (array) $item->classes;
if (in_array("current-menu-item", $classes)) {
$classes[] = "active";
unset($classes["current-menu-item"]);
}
$children = get_posts(["post_type" => "nav_menu_item", "nopaging" => true, "numberposts" => 1, "meta_key" => "_menu_item_menu_item_parent", "meta_value" => $item->ID]);
if (!empty($children)) {
$classes[] = "has-sub";
}
$class_names = join(" ", apply_filters("nav_menu_css_class", array_filter($classes), $item, $args));
$class_names = $class_names ? " class=\"" . esc_attr($class_names) . "\"" : "";
$id = apply_filters("nav_menu_item_id", "menu-item-" . $item->ID, $item, $args);
$id = $id ? " id=\"" . esc_attr($id) . "\"" : "";
$output .= $indent . "<li" . $id . $value . $class_names . ">";
$attributes = !empty($item->attr_title) ? " title=\"" . esc_attr($item->attr_title) . "\"" : "";
$attributes .= !empty($item->target) ? " target=\"" . esc_attr($item->target) . "\"" : "";
$attributes .= !empty($item->xfn) ? " rel=\"" . esc_attr($item->xfn) . "\"" : "";
$attributes .= !empty($item->url) ? " href=\"" . esc_attr($item->url) . "\"" : "";
$item_output = $args->before;
$item_output .= "<a" . $attributes . "><span>";
$item_output .= $args->link_before . apply_filters("the_title", $item->title, $item->ID) . $args->link_after;
$item_output .= "</span></a>";
$item_output .= $args->after;
$output .= apply_filters("walker_nav_menu_start_el", $item_output, $item, $depth, $args);
}
public function end_el(&$output, $item, $depth = 0, $args = [])
{
$output .= "</li>
";
}
}
add_filter("excerpt_more", "TemaVadisi_ozet_devami");
add_filter("siteorigin_widgets_icon_families", "ikonlari_cikar");
add_filter("siteorigin_widgets_icon_families", "TemaVadisi_font_ailesi");
add_filter("siteorigin_widgets_widget_folders", "Temavadisi_widget_paketi");
add_filter("siteorigin_panels_general_style_groups", "siteorigin_bilesen_stilleri", 10, 2);
add_filter("siteorigin_panels_row_style_fields", "siteorigin_bilesen_ekleme");
add_filter("siteorigin_panels_row_style_attributes", "backblack_row_style_attributes", 10, 2);
add_filter("siteorigin_panels_widget_style_fields", "siteorigin_bilesen_ekleme2");
add_filter("siteorigin_widgets_active_widgets", "Temavadisi_widget_paketi_aktif");
add_filter("siteorigin_panels_widget_dialog_tabs", "Temavadisi_add_widget_tabs", 20);
add_filter("siteorigin_widgets_field_class_prefixes", "Temavadisi_fields_class_prefixes");
add_filter("siteorigin_widgets_field_class_paths", "Temavadisi_fields_class_paths");
add_action("admin_bar_menu", "adminbar_link_ekle", 999);
add_action("wp_ajax_sendmail", "Temavadisi_ilanmail");
add_action("wp_ajax_nopriv_sendmail", "Temavadisi_ilanmail");
if (!is_user_logged_in()) {
add_action("init", "ajax_auth_init");
}
if (current_user_can("administrator")) {
add_action("show_user_profile", "uyelik_profile_fields");
add_action("edit_user_profile", "uyelik_profile_fields");
}
add_action("personal_options_update", "save_uyelik_profile_fields");
add_action("edit_user_profile_update", "save_uyelik_profile_fields");
add_action("init", "uye_wpadmin_yonlendirme");
add_action("init", "uye_bitis_sorgulama");
add_action("init", "one_cikan_bitis");
add_filter("manage_users_columns", "uyelik_gostergesi_ekle", 10, 1);
add_filter("manage_users_custom_column", "uyelik_gosterge_tablosu", 10, 3);
add_action("after_setup_theme", "remove_admin_bar");
add_action("admin_init", "yukleme_izni_verme");
add_filter("wp_handle_upload_prefilter", "limit_upload_size", 10, 1);
add_filter("add_menu_classes", "onay_bekleyen_yazilar");
add_filter("posts_where", "resim_gorme_izni");
add_action("init", "custom_rewrite_basic");
add_filter("query_vars", "prefix_register_query_var");
add_action("template_redirect", "prefix_url_rewrite_templates");
add_filter("login_headerurl", "wpgiris_logo_url");
add_filter("login_headertitle", "wpgiris_logo_url_title");
add_action("template_redirect", "jquery_sil");
add_filter("style_loader_tag", "style_tag_sil", 10, 2);
add_filter("script_loader_tag", "style_tag_sil", 10, 2);
if (cs_get_option("wp-surum")) {
remove_action("wp_head", "wlwmanifest_link");
remove_action("wp_head", "rsd_link");
remove_action("wp_head", "wp_generator");
}
if (cs_get_option("wp-emoji")) {
function TemaVadisi_emoji_kaldir()
{
remove_action("admin_print_styles", "print_emoji_styles");
remove_action("wp_head", "print_emoji_detection_script", 7);
remove_action("admin_print_scripts", "print_emoji_detection_script");
remove_action("wp_print_styles", "print_emoji_styles");
remove_filter("wp_mail", "wp_staticize_emoji_for_email");
remove_filter("the_content_feed", "wp_staticize_emoji");
remove_filter("comment_text_rss", "wp_staticize_emoji");
add_filter("tiny_mce_plugins", "TemaVadisi_emojitiny_kaldir");
}
add_action("init", "TemaVadisi_emoji_kaldir");
function TemaVadisi_emojitiny_kaldir($emojitiny)
{
if (is_array($emojitiny)) {
return array_diff($emojitiny, ["wpemoji"]);
}
return [];
}
}
add_filter("script_loader_src", "TemaVadisi_query_strings1", 15, 1);
add_filter("script_loader_src", "TemaVadisi_query_strings3", 15, 1);
add_filter("style_loader_src", "TemaVadisi_query_strings1", 15, 1);
add_filter("style_loader_src", "TemaVadisi_query_strings2", 15, 1);
if (cs_get_option("json-api")) {
remove_action("wp_head", "rest_output_link_wp_head", 10);
remove_action("wp_head", "wp_oembed_add_discovery_links", 10);
}
if (cs_get_option("tarayici_bellek")) {
function TemaVadisi_tarayici_cache($kurallar)
{
return $kurallar . "## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg \"access plus 1 year\"
ExpiresByType image/jpeg \"access plus 1 year\"
ExpiresByType image/gif \"access plus 1 year\"
ExpiresByType image/png \"access plus 1 year\"
ExpiresByType text/css \"access plus 1 month\"
ExpiresByType application/pdf \"access plus 1 month\"
ExpiresByType text/x-javascript \"access plus 1 month\"
ExpiresByType application/x-shockwave-flash \"access plus 1 month\"
ExpiresByType image/x-icon \"access plus 1 year\"
ExpiresDefault \"access plus 1 seconds\"
## EXPIRES CACHING ##
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
#Gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
</IfModule>
#End Gzip
####Turn ETags Off
<ifmodule mod_headers.c>
Header unset ETag
</ifmodule>
#ETags
FileETag None
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
<ifmodule mod_expires.c>
<filesmatch \"\.(jpg|gif|png|css|js)\$\">
ExpiresActive on
ExpiresDefault \"access plus 1 year\"
</filesmatch>
</ifmodule>
";
}
add_filter("mod_rewrite_rules", "TemaVadisi_tarayici_cache");
}
class TemaVadisi_Lisans_Fonksiyonu
{
public $api_server = "https://www.temavadisi.com";
public $product_code = "vadimarketv3";
public $license_key = NULL;
public function __construct()
{
$this->license_key = get_option("wpls_" . $this->product_code . "_license_key");
add_filter("cron_schedules", [$this, "vadilisans_add_cron_interval"]);
add_action("vadilisans_cron_hook", [$this, "vadilisans_cron_exec"]);
if (!wp_next_scheduled("vadilisans_cron_hook")) {
wp_schedule_event(time(), "one_week", "vadilisans_cron_hook");
}
add_action("admin_menu", [$this, "vadilisans_theme_menu"]);
}
public function vadilisans_add_cron_interval($schedules)
{
$schedules["one_week"] = ["interval" => 2592000, "display" => __("Every a Week")];
return $schedules;
}
public function vadilisans_cron_exec()
{
$this->vadilisans_api_call($this->license_key);
}
public function vadilisans_cek_api()
{
$status = get_option("wpls_" . $this->product_code . "_license_key_status");
if ($status === "valid") {
return true;
}
return false;
}
public function vadilisans_api_call($license = "")
{
global $wp_version;
$lisans_url = home_url();
$lisansurl = parse_url($lisans_url);
$api_params = ["wpls-verify" => $license, "product" => urlencode($this->product_code), "domain" => $lisansurl["host"], "validip" => isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : $_SERVER["LOCAL_ADDR"]];
$response = wp_remote_get(add_query_arg($api_params, $this->api_server), ["timeout" => 15, "sslverify" => false, "httpversion" => "1.0"]);
if (is_wp_error($response)) {
return false;
}
$license_data = json_decode(wp_remote_retrieve_body($response));
if (empty($license_data) || $license_data === NULL || $license_data === false) {
return false;
}
update_option("wpls_" . $this->product_code . "_license_key", $license);
update_option("wpls_" . $this->product_code . "_license_key_status", $license_data->valid == "true" ? "valid" : "invalid");
if ($license_data->valid == "true") {
return true;
}
return false;
}
public function vadilisans_theme_menu()
{
add_theme_page("Lisans Onaylama", "Tema Lisans", "manage_options", "tv-lisans-ayarlari", [$this, "vadilisans_license_page"]);
}
public function vadilisans_license_page()
{
$license = get_option("wpls_" . $this->product_code . "_license_key");
$status = get_option("wpls_" . $this->product_code . "_license_key_status");
if (isset($_POST[$this->product_code . "_action"])) {
$license = $_POST[$this->product_code . "_license_key"] != $license ? $_POST[$this->product_code . "_license_key"] : $license;
$this->vadilisans_api_call($license);
}
echo "
<div class=\"wrap nosubsub\">
<h2>";
_e("Tema Lisans Ayar", "tvlisans");
echo "</h2>
<form method=\"post\" action=\"";
echo admin_url("themes.php?page=tv-lisans-ayarlari");
echo "\">
<table class=\"form-table\">
<tbody>
<tr valign=\"top\">
<th scope=\"row\" valign=\"top\">
<label for=\"wpls_sample_license_url\">";
_e("Tema Yapmcs", "tvlisans");
echo "</label>
</th>
<td>
Bedicoup
</td>
</tr>
<tr valign=\"top\">
<th scope=\"row\" valign=\"top\">
<label for=\"";
echo $this->product_code . "_license_key";
echo "\">";
_e("Lisans Anahtarnz:", "tvlisans");
echo "</label>
</th>
<td>
<input id=\"";
echo $this->product_code . "_license_key";
echo "\" name=\"";
echo $this->product_code . "_license_key";
echo "\" type=\"text\" class=\"regular-text\" value=\"";
echo esc_attr($license);
echo "\" />
<p class=\"description\">";
_e("Satn aldnz lisans anahtarnz girin", "tvlisans");
echo "</p>
<p class=\"description\">";
_e("Deiiklikleri kaydet butonu yenilendiginde tekrar tklamalsnz.", "tvlisans");
echo "</p>
</td>
</tr>
</tbody>
</table>
<input type=\"hidden\" name=\"";
echo $this->product_code . "_action";
echo "\" value=\"update\" />
";
submit_button();
echo "
</form>
";
}
}
function TemaVadisi_admin_mesaji()
{
global $current_user;
$user_id = $current_user->ID;
if (!get_user_meta($user_id, "TemaVadisi_admin_mesaji_kapat")) {
echo "<div class=\"notice notice-warning\" style=\"position:relative;\">
<p>" . __("Tema kullanm hakknda bilgi almak iin <a href=\"http://demo.temavadisi.com/dokuman/vadiilan\" target=\"_blank\"><strong>Kullanm Dkmanna buradan</strong></a> bakabilirsiniz. Yardm almak iin ltfen <a href=\"https://www.temavadisi.com\" target=\"_blank\">www.temavadisi.com</a> adresindeki <strong>Destek sistemini</strong> kullannz.") . " <a style=\"text-decoration:none;\" href=\"?bildirimi-kapat\"><i class=\"dashicons dashicons-no-alt\"></i>tekrar gsterme!</a></p>
</div>";
}
}
function TemaVadisi_admin_mesaji_kapat()
{
global $current_user;
$user_id = $current_user->ID;
if (isset($_GET["bildirimi-kapat"])) {
add_user_meta($user_id, "TemaVadisi_admin_mesaji_kapat", "true", true);
}
}
function TemaVadisi_js_dosyalari()
{
wp_enqueue_script("slickslider", get_template_directory_uri() . "/js/slick.min.js", ["jquery"], NULL, true);
wp_enqueue_script("superfish", get_template_directory_uri() . "/js/superfish.min.js", ["jquery"], NULL, true);
wp_enqueue_script("magnific-popup", get_template_directory_uri() . "/js/jquery.magnific-popup.min.js", ["jquery"], NULL, true);
wp_enqueue_script("tv-scripts", get_template_directory_uri() . "/js/scripts.js", ["jquery"], NULL, true);
if (is_single() || is_home("ilanduzenle")) {
wp_enqueue_script("yandex-map", "https://api-maps.yandex.ru/2.1/?lang=tr_TR", ["jquery"], NULL, true);
}
if (is_home("ilanduzenle")) {
wp_enqueue_media();
wp_enqueue_script("gallery-metabox", get_template_directory_uri() . "/inc/galeri-metabox/js/gallery-metabox.js", ["jquery", "jquery-ui-sortable"], NULL, true);
wp_enqueue_style("gallery-metabox", get_template_directory_uri() . "/inc/galeri-metabox/css/gallery-metabox.css");
}
}
function TemaVadisi_adminjs_dosyalari()
{
global $pagenow;
if ($pagenow == "post.php" || get_post_type() == "post") {
wp_enqueue_script("yandex-map", "https://api-maps.yandex.ru/2.1/?lang=tr_TR", ["jquery"], NULL, true);
}
}
function TemaVadisi_admin_js_ekle()
{
if (is_admin()) {
wp_enqueue_script("ililce", get_template_directory_uri() . "/inc/ililce/ililce.js", ["jquery"]);
}
}
function TemaVadisi_custom_css()
{
if (!is_admin()) {
wp_enqueue_style("TemaVadisi_custom_css", get_template_directory_uri() . "/css/custom.css", [], NULL);
ob_start();
include get_template_directory() . "/css/custom_css.php";
$custom_css = ob_get_clean();
$custom_css = str_replace(["
", "
"], "
", $custom_css);
$lines = explode("
", $custom_css);
$new_lines = [];
foreach ($lines as $i => $line) {
if (!empty($line)) {
$new_lines[] = trim($line);
}
}
wp_add_inline_style("TemaVadisi_custom_css", implode($new_lines));
}
}
function varsayilan_menulink()
{
echo "<ul id=\"menu-ust\" class=\"sf-menu\"><li class=\"menu-item current-menu-item current_page_item\"><a href=" . get_option("home") . "/wp-admin/nav-menus.php>" . __("Yeni bir men ayarlamak iin tklaynz.", "temavadisi") . "</a></li></ul>";
}
function ocdi_import_files()
{
return [["import_file_name" => "Demo Ykle", "categories" => ["Vadi lan Temas"], "import_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan.xml", "import_widget_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan-widgets.wie", "import_customizer_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan-export.dat", "import_preview_image_url" => get_template_directory_uri() . "/screenshot.png", "import_notice" => __("e aktarma esnasnda hata yada yarda kesilme sorunu yaarsanz <b>hosting</b> firmanza bavurunuz.", "tema-vadisi"), "preview_url" => "http://demo.temavadisi.com/vadiilan"]];
}
function ocdi_after_import_setup()
{
$ana_menu = get_term_by("name", "anamenu", "nav_menu");
$mobil_menu = get_term_by("name", "mobilmenu", "nav_menu");
$footer_menu = get_term_by("name", "footermenu", "nav_menu");
set_theme_mod("nav_menu_locations", ["anamenu" => $ana_menu->term_id, "mobilmenu" => $mobil_menu->term_id, "footermenu" => $footer_menu->term_id]);
}
function TemaVadisi_setup()
{
load_theme_textdomain("temavadisi", get_template_directory_uri() . "/lang");
}
function TemaVadisi_Bilesen_Destegi()
{
register_sidebar(["name" => "Sidebar", "id" => "sidebar1", "before_widget" => "<div class=\"temayan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"yankapsa\"><div class=\"yanbaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Kategori Sidebar", "id" => "sidebar-kat", "before_widget" => "<div class=\"temayan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"yankapsa\"><div class=\"yanbaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 1", "id" => "footer1", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 2", "id" => "footer2", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 3", "id" => "footer3", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 4", "id" => "footer4", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
}
function TemaVadisi_onresimurl()
{
$resim_url = get_the_post_thumbnail_url(get_the_ID(), "full");
if (has_post_thumbnail()) {
echo $resim_url;
}
}
function TemaVadisi_onresim($size, $width = "", $height = "", $class = "")
{
$html = "";
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), $size);
if ($image_url) {
$html .= "" . get_the_post_thumbnail(get_the_ID(), $size, ["class" => $class, "alt" => get_the_title(), "itemprop" => "image"]) . "";
} else {
if (get_post_meta(get_the_ID(), "resim", true)) {
$html .= "<img src=\"" . get_post_meta(get_the_ID(), "resim", true) . "\" alt=\"" . get_the_title() . "\" itemprop=\"image\" ";
if ($class) {
$html .= "class=\"" . $class . "\" ";
}
if ($width) {
$html .= "width=\"" . $width . "\" ";
}
if ($height) {
$html .= "height=\"" . $height . "\" ";
}
$html .= "/>";
} else {
if (cs_get_option("varsayilan")) {
$html .= "<img src=\"" . cs_get_option("varsayilan") . "\" alt=\"" . get_the_title() . "\" itemprop=\"image\" ";
if ($class) {
$html .= "class=\"" . $class . "\" ";
}
if ($width) {
$html .= "width=\"" . $width . "\" ";
}
if ($height) {
$html .= "height=\"" . $height . "\" ";
}
$html .= "/>";
}
}
}
return $html;
}
function TemaVadisi_ozet($string, $word_limit)
{
$words = explode(" ", $string, $word_limit + 1);
if ($word_limit < count($words)) {
array_pop($words);
}
return implode(" ", $words) . "..";
}
function TemaVadisi_ozet_devami($more)
{
return "..";
}
function TemaVadisi_sayfalama($pages = "", $range = 2)
{
echo "<div class=\"sayfalama col-lg-12 aligncenter\"><ul>";
$showitems = $range * 2 + 1;
global $paged;
if (empty($paged)) {
$paged = 1;
}
if ($pages == "") {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
if (2 < $paged && $range + 1 < $paged && $showitems < $pages) {
echo "<li><a href=\"" . get_pagenum_link(1) . "\"></a></li>";
}
if (1 < $paged && $showitems < $pages) {
echo "<li class=\"pOnce\"><a href=\"" . get_pagenum_link($paged - 1) . "\">« nceki</a></li>";
}
for ($i = 1; $i <= $pages; $i++) {
if (1 != $pages && (!($paged + $range + 1 <= $i || $i <= $paged - $range - 1) || $pages <= $showitems)) {
echo $paged == $i ? "<li class=\"active\"><span>" . $i . "</span></li>" : "<li><a href=\"" . get_pagenum_link($i) . "\">" . $i . "</a></li>";
}
}
if ($paged < $pages && $showitems < $pages) {
echo "<li class=\"pSonra\"><a href=\"" . get_pagenum_link($paged + 1) . "\">Sonraki »</a></li>";
}
if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) {
echo "<li><a href=\"" . get_pagenum_link($pages) . "\"></a></li>";
}
}
echo "</ul></div>";
}
function Temavadisi_sayfalar($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = "/", $pagestring = "?sayfa=")
{
if (!$adjacents) {
$adjacents = 1;
}
if (!$limit) {
$limit = 15;
}
if (!$page) {
$page = 1;
}
if (!$targetpage) {
$targetpage = "/";
}
$prev = $page - 1;
$next = $page + 1;
$lastpage = ceil($totalitems / $limit);
$lpm1 = $lastpage - 1;
$pagination = "";
if (1 < $lastpage) {
$pagination .= "<div class=\"sayfalama col-lg-12 aligncenter\"";
if ($margin || $padding) {
$pagination .= " style=\"";
if ($margin) {
$pagination .= "margin: " . $margin . ";";
}
if ($padding) {
$pagination .= "padding: " . $padding . ";";
}
$pagination .= "\"";
}
$pagination .= "><ul>";
if (1 < $page) {
$pagination .= "<li class=\"pOnce\"><a href=\"" . $targetpage . $pagestring . $prev . "\">« nceki</a></li>";
} else {
$pagination .= "<li class=\"pOnce\"><span class=\"gizle\">« nceki</span></li>";
}
if ($lastpage < 7 + $adjacents * 2) {
for ($counter = 1; $counter <= $lastpage; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
} else {
if (7 + $adjacents * 2 <= $lastpage) {
if ($page < 1 + $adjacents * 3) {
for ($counter = 1; $counter < 4 + $adjacents * 2; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
$pagination .= "<li><span class=\"elipses\">...</span></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lpm1 . "\">" . $lpm1 . "</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lastpage . "\">" . $lastpage . "</a></li>";
} else {
if ($page < $lastpage - $adjacents * 2 && $adjacents * 2 < $page) {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "1\">1</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "2\">2</a></li>";
$pagination .= "<li><span class=\"elipses\">...</span></li>";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
$pagination .= "<li><span class=\"elipses\">...</span></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lpm1 . "\">" . $lpm1 . "</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lastpage . "\">" . $lastpage . "</a></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "1\">1</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "2\">2</a></li>";
$pagination .= "<li><span class=\"elipses\">...</span></li>";
for ($counter = $lastpage - (1 + $adjacents * 3); $counter <= $lastpage; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
}
}
}
}
if ($page < $counter - 1) {
$pagination .= "<li class=\"pSonra\"><a href=\"" . $targetpage . $pagestring . $next . "\">Sonraki »</a></li>";
} else {
$pagination .= "<li class=\"pSonra\"><span class=\"gizle\">Sonraki »</span></li>";
}
$pagination .= "</ul></div>
";
}
return $pagination;
}
function TemaVadisi_comment($comment, $args, $depth)
{
$GLOBALS["comment"] = $comment;
extract($args, EXTR_SKIP);
if ("article" == $args["style"]) {
$tag = "article";
$add_below = "comment";
} else {
$tag = "article";
$add_below = "comment";
}
echo "<li ";
comment_class(empty($args["has_children"]) ? "nochild" : "parent");
echo " id=\"comment-";
comment_ID();
echo "\">
<";
echo $tag;
echo " itemprop=\"comment\" itemscope itemtype=\"https://schema.org/Comment\">
<div class=\"comment-avatar\">
";
echo get_avatar($comment, 100, "", "Avatar");
echo " </div>
<div class=\"comment-body\">
<div class=\"comment-author vcard\">
<cite class=\"fn\">";
comment_author();
echo "</cite>
<span class=\"comS\">/</span>
<div class=\"comment-meta\">
<a href=\"#comment-";
comment_ID();
echo "\">";
comment_date("j F Y");
echo ", ";
comment_time();
echo "</a>
</div>
</div>
";
edit_comment_link("<p class=\"comment-edit\">dzenle</p>", "", "");
if ($comment->comment_approved == "0") {
echo " <p class=\"yorum_kontrol\">";
echo __("Yorumunuz kontrol edildikten sonra yaynlanacaktr.", "temavadisi");
echo "</p>
";
}
echo "
<div class=\"comment-content\">
";
comment_text();
echo " <div class=\"comment-reply\">
";
comment_reply_link(array_merge($args, ["add_below" => $add_below, "depth" => $depth, "max_depth" => $args["max_depth"]]));
echo " </div>
</div>
</div>
";
}
function TemaVadisi_comment_close()
{
echo "</article></li>";
}
function ikonlari_cikar($ikonlar)
{
unset($ikonlar["elegantline"]);
unset($ikonlar["fontawesome"]);
unset($ikonlar["genericons"]);
unset($ikonlar["icomoon"]);
unset($ikonlar["typicons"]);
unset($ikonlar["ionicons"]);
return $ikonlar;
}
function TemaVadisi_font_ailesi($icon_ailesi)
{
$icon_ailesi["icon"] = ["name" => __("Tema Font Paketi", "temavadisi"), "style_uri" => get_template_directory_uri() . "/css/sow-temavadisi.css?v=1.0", "icons" => temakutuphanesi()];
return $icon_ailesi;
}
function Temavadisi_widget_paketi($folders)
{
$folders[] = get_template_directory() . "/inc/widget-paketi/";
return $folders;
}
function siteorigin_bilesen_stilleri($groups)
{
unset($groups["attributes"]);
unset($groups["layout"]);
return $groups;
}
function siteorigin_bilesen_ekleme($fields)
{
$fields["row_stretch"] = ["name" => __("Row Layout", "siteorigin-panels"), "type" => "select", "group" => "design", "options" => ["" => __("Standard", "siteorigin-panels"), "full" => __("Tam Genilik", "siteorigin-panels"), "full-stretched" => __("Tam Genilik (erik)", "siteorigin-panels")], "priority" => 10];
$fields["backblack"] = ["name" => __("Karartma Efektini Kaldr", "siteorigin-panels"), "type" => "checkbox", "group" => "design", "label" => __("Kaldrlsn m?", "siteorigin-panels"), "description" => __("Arkaplan karartma efektini satrdan kaldrabilirsiniz.", "siteorigin-panels"), "priority" => 8];
$fields["padding"] = ["name" => __("Padding", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Satrn etrafnda boluk brakmak iin bu alan kullanabilirsiniz.", "siteorigin-panels"), "priority" => 7, "multiple" => true];
return $fields;
}
function backblack_row_style_attributes($attributes, $args)
{
if (!empty($args["backblack"])) {
array_push($attributes["class"], "backbefore");
}
return $attributes;
}
function siteorigin_bilesen_ekleme2($fields)
{
$fields["margin"] = ["name" => __("Kenar Boluklar", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Bileen kenar boluklarn buradan ayarlayabilirsiniz.", "siteorigin-panels"), "priority" => 6, "multiple" => true];
$fields["mobile_padding"] = ["name" => __("Kenar Boluklar (Mobil)", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Mobil iin bileen kenar boluklarn buradan ayarlayabilirsiniz.", "siteorigin-panels"), "priority" => 6, "multiple" => true];
return $fields;
}
function Temavadisi_FMenu_Select()
{
$menus = wp_get_nav_menus();
if (!is_wp_error($menus) && !empty($menus)) {
foreach ($menus as $menu) {
$options[$menu->term_id] = $menu->name;
}
}
return $options;
}
function Temavadisi_widget_paketi_aktif($active)
{
$active["button"] = false;
$active["editor"] = false;
$active["google-map"] = false;
$active["slider"] = false;
$active["image"] = false;
$active["post-carousel"] = false;
$active["baslik-widget"] = true;
$active["fmenu-widget"] = true;
$active["onecikan-widget"] = true;
$active["goldilanlar-widget"] = true;
$active["soneklenen-widget"] = true;
$active["ikategori-widget"] = true;
$active["sayilar-widget"] = true;
$active["bilgi-widget"] = true;
$active["fiyat-tablo-widget"] = true;
$active["blog-widget"] = true;
return $active;
}
function Temavadisi_add_widget_tabs($tabs)
{
$tabs[] = ["title" => __("Tema Bileenleri", "temavadisi"), "filter" => ["groups" => ["vadiwidget"]]];
unset($tabs["page_builder"]);
unset($tabs["recommended"]);
unset($tabs["widgets_bundle"]);
return $tabs;
}
function Temavadisi_fields_class_prefixes($class_prefixes)
{
$class_prefixes[] = "Temavadisi_Custom_Field_";
return $class_prefixes;
}
function Temavadisi_fields_class_paths($class_paths)
{
$class_paths[] = get_template_directory() . "/inc/form-fields/";
return $class_paths;
}
function adminbar_link_ekle($wp_admin_bar)
{
global $pagenow;
if ($pagenow == "post-new.php" && isset($_GET["post_type"]) == "page" || isset($_GET["action"]) == "edit") {
$args = ["id" => "sayfaolusturucu", "title" => "Sayfa Oluturucu Modu", "href" => $_SERVER["REQUEST_URI"] . "&siteorigin-page-builder", "meta" => ["class" => "sayfaduzeni"]];
$wp_admin_bar->add_node($args);
}
}
function Temavadisi_ilanmail()
{
if (isset($_POST["submitted"])) {
if (trim($_POST["adsoyad"]) === "") {
$nameError = "Ltfen Adnz ve Soyadnz yazn.";
$hasError = true;
} else {
$name = trim($_POST["adsoyad"]);
}
if (trim($_POST["telefon"]) === "") {
$nameError = "Ltfen telefonunuzu yazn.";
$hasError = true;
} else {
$name = trim($_POST["telefon"]);
}
if (trim($_POST["mesajiniz"]) === "") {
$commentError = "Ltfen mesajnz yazn.";
$hasError = true;
} else {
if (function_exists("stripslashes")) {
$mesajiniz = stripslashes(trim($_POST["mesajiniz"]));
} else {
$mesajiniz = trim($_POST["mesajiniz"]);
}
}
if (!isset($hasError)) {
$emailTo = $_POST["gonderilecek"];
if (!isset($emailTo) || $emailTo == "") {
$emailTo = $_POST["gonderilecek"];
}
$subject = get_bloginfo("name") . " zerinden " . $name . " size mail gnderdi.";
$body = "Ad: " . $name . " nnEmail: " . $email . " nnKonu: " . $mesajiniz;
$headers = "Reply-To: " . $name . " <" . $email . ">rn";
if (wp_mail($emailTo, $subject, $body, $headers)) {
echo "<div class='success'>Mesajnz baaryla gnderilmitir.</div>";
} else {
echo "<div class='error'>Mail gnderilemedi, ltfen daha sonra tekrar deneyin!</div>";
}
} else {
$error = "<ul>";
if ($nameError != "") {
$error = $error . "<li>" . $nameError . "</li>";
}
if ($emailError != "") {
$error = $error . "<li>" . $emailError . "</li>";
}
if ($commentError != "") {
$error = $error . "<li>" . $commentError . "</li>";
}
$error = $error . "</ul>";
echo $error;
}
} else {
$error = "Hata!";
}
exit;
}
function ajax_auth_init()
{
wp_register_script("validate-script", get_template_directory_uri() . "/js/jquery.validate.js", ["jquery"], NULL, true);
wp_enqueue_script("validate-script");
wp_register_script("ajax-auth-script", get_template_directory_uri() . "/js/ajaxlogin.js", ["jquery"], NULL, true);
wp_enqueue_script("ajax-auth-script");
wp_localize_script("ajax-auth-script", "ajax_auth_object", ["ajaxurl" => admin_url("admin-ajax.php"), "redirecturl" => home_url("hesabim"), "loadingmessage" => __("Bilgiler kontrol ediliyor, Ltfen bekleyiniz..", "temavadisi")]);
add_action("wp_ajax_nopriv_ajaxlogin", "ajax_login");
add_action("wp_ajax_nopriv_ajaxregister", "ajax_register");
add_action("wp_ajax_nopriv_ajaxforgotpassword", "ajax_forgotPassword");
}
function ajax_login()
{
check_ajax_referer("ajax-login-nonce", "security");
auth_user_login($_POST["username"], $_POST["password"], "Giri");
exit;
}
function ajax_register()
{
check_ajax_referer("ajax-register-nonce", "security");
$info = [];
$info["user_login"] = sanitize_user($_POST["username"]);
$info["nickname"] = $info["user_login"];
$info["user_nicename"] = $info["nickname"];
$info["first_name"] = sanitize_text_field($_POST["first_name"]);
$info["last_name"] = sanitize_text_field($_POST["last_name"]);
$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 kullanc ad zaten kaytl.", "temavadisi")]);
} else {
if (in_array("existing_user_email", $error)) {
echo json_encode(["loggedin" => false, "message" => __("Bu e-posta adresi zaten kaytl.", "temavadisi")]);
}
}
}
} else {
auth_user_login($info["nickname"], $info["user_pass"], "Kayt");
}
exit;
}
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" => __("Hatal kullanc ad ya da parola", "temavadisi")]);
} else {
wp_set_current_user($user_signon->ID);
echo json_encode(["loggedin" => true, "message" => __($login . " baarl, ynlendiriliyorsunuz..", "temavadisi")]);
}
exit;
}
function ajax_forgotPassword()
{
check_ajax_referer("ajax-forgot-nonce", "security");
global $wpdb;
$account = $_POST["user_login"];
if (empty($account)) {
$error = __("Bir kullanc ad veya e-posta adresi girin.", "temavadisi");
} else {
if (is_email($account)) {
if (email_exists($account)) {
$get_by = "email";
} else {
$error = __("Bu e-posta adresine kaytl kullanc bulunamad.", "temavadisi");
}
} else {
if (validate_username($account)) {
if (username_exists($account)) {
$get_by = "login";
} else {
$error = __("Bu kullanc adna kaytl kullanc bulunamad.", "temavadisi");
}
} else {
$error = __("Geersiz kullanc ad veya e-posta adresi.", "temavadisi");
}
}
}
if (empty($error)) {
$random_password = wp_generate_password();
$user = get_user_by($get_by, $account);
$update_user = wp_update_user(["ID" => $user->ID, "user_pass" => $random_password]);
if ($update_user) {
$from = get_option("admin_email");
if (!(isset($from) && is_email($from))) {
$sitename = strtolower($_SERVER["SERVER_NAME"]);
if (substr($sitename, 0, 4) == "www.") {
$sitename = substr($sitename, 4);
}
$from = "admin@" . $sitename;
}
$to = $user->user_email;
$subject = __("ifre Yenileme", "temavadisi");
$message = __("Yeni ifreniz: ", "temavadisi") . $random_password;
$headers = ["Content-Type: text/html; charset=UTF-8"];
$mail = wp_mail($to, $subject, $message, $headers);
if ($mail) {
$success = __("Yeni parolanz e-posta adresinize gnderildi.Ltfen kontrol edin.", "temavadisi");
} else {
$error = __("Site zerinden mail gnderilemiyor. Ltfen site yneticisine bavurun.", "temavadisi");
}
} else {
$error = __("Hata! Bilgileriniz kontrol edilirken bir sorun olutu.", "temavadisi");
}
}
if (!empty($error)) {
echo json_encode(["loggedin" => false, "message" => __($error)]);
}
if (!empty($success)) {
echo json_encode(["loggedin" => false, "message" => __($success)]);
}
exit;
}
function uyelik_profile_fields($user)
{
echo "<script>
jQuery( document ).ready(function() {
jQuery('#uyetipi').change(function() {
jQuery(\"#showuye\").show();
});
});
</script>
<h3 style=\"margin-top:40px;\">";
echo __("yelik Ayar", "temavadisi");
echo "</h3>
<table class=\"form-table\">
<tr>
<th><label for=\"uyetipi\">";
echo __("ye Tipi", "temavadisi");
echo "</label></th>
<td>
";
$uyetipi = get_the_author_meta("uyetipi", $user->ID);
echo " <select name=\"uyetipi\" id=\"uyetipi\">
<option value=\"0\"";
if (!$uyetipi) {
echo " selected";
}
echo ">";
echo __("yelik Tipi Seiniz", "temavadisi");
echo "</option>
<option value=\"golduye\"";
if ($uyetipi == "golduye") {
echo " selected";
}
echo ">";
echo __("Gold ye", "temavadisi");
echo "</option>
<option value=\"platinuye\"";
if ($uyetipi == "platinuye") {
echo " selected";
}
echo ">";
echo __("Platin ye", "temavadisi");
echo "</option>
</select>
<input id=\"showuye\" style=\"display:none;\" type=\"datetime-local\" min=\"";
echo date("Y-m-d\TH:i");
echo "\" value=\"";
echo date("Y-m-d\TH:i");
echo "\" name=\"uyebitis\">
";
if (get_the_author_meta("uyetipi", $user->ID) != "0" && get_the_author_meta("uyebitis", $user->ID)) {
echo " <label>";
echo date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user->ID)));
echo "</label>
";
}
echo " </td>
</tr>
</table>
";
}
function save_uyelik_profile_fields($user_id)
{
if (!current_user_can("edit_user", $user_id)) {
return false;
}
if ($_POST["uyetipi"]) {
update_user_meta($user_id, "uyebitis", $_POST["uyebitis"]);
} else {
delete_user_meta($user_id, "uyetipi");
}
update_user_meta($user_id, "uyetipi", $_POST["uyetipi"]);
}
function uye_bitis_sorgulama()
{
if (!is_admin()) {
return NULL;
}
if (!current_user_can("manage_options")) {
return false;
}
$users = get_users();
foreach ($users as $result) {
$userId = $result->ID;
if ($userId != "") {
$all_meta_for_user = get_user_meta($userId);
if (is_array($all_meta_for_user)) {
foreach ($all_meta_for_user as $key => $value) {
if (strtotime(get_the_author_meta("uyebitis", $userId)) <= strtotime(date("Y-m-d\TH:i"))) {
delete_user_meta($userId, "uyetipi");
delete_user_meta($userId, "uyebitis");
}
}
}
}
}
}
function one_cikan_bitis()
{
if (!is_admin()) {
return NULL;
}
global $pagenow;
if ($pagenow == "post-new.php" || isset($_GET["action"]) == "edit") {
$post_id = $_GET["post"];
if ($post_id != "") {
$all_meta_for_post = get_post_meta($post_id);
if (is_array($all_meta_for_post)) {
foreach ($all_meta_for_post as $key => $value) {
if ($key == "onecikantime") {
list($sure) = get_post_meta($post_id, "onecikantime");
$suan = date_i18n("Y-m-d\TH:i");
if (strtotime($sure) <= strtotime($suan)) {
delete_post_meta($post_id, "onecikan");
delete_post_meta($post_id, "onecikantime");
}
}
}
}
}
}
}
function uyelik_gostergesi_ekle($uyelik)
{
$uyelik["uyetipi"] = "yelik";
return $uyelik;
}
function uyelik_gosterge_tablosu($val, $column_name, $user_id)
{
switch ($column_name) {
case "uyetipi":
if (get_the_author_meta("uyetipi", $user_id) == "golduye") {
return "<i style=\"color:#FFD700;\" class=\"icon-star\"></i> Gold (" . date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user_id))) . ")";
}
if (get_the_author_meta("uyetipi", $user_id) == "platinuye") {
return "<i style=\"color:#FFD700;\" class=\"icon-star\"></i> Platin (" . date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user_id))) . ")";
}
return NULL;
break;
default:
return $val;
}
}
function uye_tipi_sorgula($user_id)
{
$uyelikgenel = cs_get_option("uyelikaktif");
if (!$uyelikgenel) {
$durum = true;
} else {
if ($uyelikgenel && get_the_author_meta("uyetipi", $user_id)) {
$durum = true;
} else {
if ($uyelikgenel && !get_the_author_meta("uyetipi", $user_id)) {
$durum = false;
}
}
}
return $durum;
}
function uye_wpadmin_yonlendirme()
{
if (current_user_can("manage_options")) {
return "";
}
if (strpos($_SERVER["REQUEST_URI"], "wp-admin/profile.php")) {
wp_redirect(home_url("hesabim"));
exit;
}
}
function remove_admin_bar()
{
if (!current_user_can("administrator") && !is_admin()) {
show_admin_bar(false);
}
}
function urlto_dosyaid($resim_url)
{
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $wpdb->posts . " WHERE guid='%s';", $resim_url));
return $attachment[0];
}
function yukleme_izni_verme()
{
$role = "subscriber";
if (!current_user_can($role) || current_user_can("upload_files")) {
return NULL;
}
$subscriber = get_role($role);
$subscriber->add_cap("upload_files");
}
function limit_upload_size($file)
{
$file_size_limit = cs_get_option("imagesize", "500");
if (!current_user_can("manage_options")) {
$current_size = $file["size"];
$current_size = $current_size / cs_get_option("imagesize", "500");
if ($file_size_limit < $current_size) {
$file["error"] = sprintf(__("HATA: Yklediiniz resmin boyutu maximum %d KB olmaldr."), $file_size_limit);
}
}
return $file;
}
function onay_bekleyen_yazilar($menu)
{
$types = ["post", "urunler", "ilanlar", "haberler"];
$status = "pending";
foreach ($types as $type) {
$num_posts = wp_count_posts($type, "readable");
$pending_count = 0;
if (!empty($num_posts->{$status})) {
$pending_count = $num_posts->{$status};
}
if ($type == "post") {
$menu_str = "edit.php";
} else {
$menu_str = "edit.php?post_type=" . $type;
}
foreach ($menu as $menu_key => $menu_data) {
if ($menu_str == $menu_data[2]) {
$menu[$menu_key][0] .= " <span class='update-plugins count-" . $pending_count . "'><span class='plugin-count'>" . number_format_i18n($pending_count) . "</span></span>";
}
}
}
return $menu;
}
function resim_gorme_izni($resimfiltre)
{
global $current_user;
if (is_user_logged_in() && isset($_POST["action"]) && $_POST["action"] == "query-attachments" && !current_user_can("manage_options")) {
$resimfiltre .= " AND post_author=" . $current_user->data->ID;
}
return $resimfiltre;
}
function custom_rewrite_basic()
{
add_rewrite_rule("^hesabim/([a-z\d_-]+)/?\$", "index.php?sayfa=hesabim&islem=\$matches[1]", "top");
add_rewrite_rule("^hesabim/?", "index.php?sayfa=hesabim", "top");
add_rewrite_rule("^user/([a-z\d_-]+)/?\$", "index.php?sayfa=user&islem=\$matches[1]", "top");
add_rewrite_rule("^user/?", "index.php?sayfa=user", "top");
}
function prefix_register_query_var($vars)
{
$vars[] = "sayfa";
$vars[] = "islem";
return $vars;
}
function prefix_url_rewrite_templates()
{
if (get_query_var("sayfa") == "hesabim") {
add_filter("template_include", function () {
return get_template_directory() . "/inc/hesabim/index.php";
});
} else {
if (get_query_var("sayfa") == "user") {
add_filter("template_include", function () {
return get_template_directory() . "/inc/user/index.php";
});
}
}
}
function wpgiris_logo_url()
{
return home_url();
}
function wpgiris_logo_url_title()
{
return get_bloginfo("name", "display");
}
function jquery_sil()
{
if (!is_admin()) {
wp_deregister_script("jquery");
wp_register_script("jquery", "", false, "1.6.4");
wp_enqueue_script("jquery");
}
}
function style_tag_sil($tag, $handle)
{
return preg_replace("/type=['\"]text\/(javascript|css)['\"]/", "", $tag);
}
function TemaVadisi_query_strings1($src)
{
$vargs = explode("?ver", $src);
return $vargs[0];
}
function TemaVadisi_query_strings2($src)
{
$vargs = explode("&ver", $src);
return $vargs[0];
}
function TemaVadisi_query_strings3($src)
{
$vargs = explode("&rev", $src);
return $vargs[0];
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* @ https://EasyToYou.eu - IonCube v11 Decoder Online
* @ PHP 7.2 & 7.3
* @ Decoder version: 1.0.6
* @ Release: 10/08/2022
*/
global $pagenow;
if (is_admin() && "admin.php" == $pagenow && isset($_GET["activated"])) {
wp_redirect(admin_url("themes.php?page=tv-lisans-ayarlari"));
}
if (!defined("ABSPATH")) {
exit;
}
add_action("admin_notices", "TemaVadisi_admin_mesaji");
add_action("admin_init", "TemaVadisi_admin_mesaji_kapat");
require_once get_parent_theme_file_path("/inc/temapanel/cs-framework.php");
require_once get_parent_theme_file_path("/functions-custom.php");
require_once get_parent_theme_file_path("/inc/update_notifier.php");
require_once get_parent_theme_file_path("/inc/eklentiler.php");
require_once get_parent_theme_file_path("/inc/galeri-metabox/gallery.php");
require_once get_parent_theme_file_path("/inc/navigasyon.php");
require_once get_parent_theme_file_path("/inc/iconfilter.php");
require_once get_parent_theme_file_path("/inc/menu-image/menu-image.php");
require_once get_parent_theme_file_path("/inc/metaboxes.php");
require_once get_parent_theme_file_path("/inc/comment_review.php");
require_once get_parent_theme_file_path("/inc/bilesenler.php");
define("CS_ACTIVE_METABOX", true);
define("CS_ACTIVE_TAXONOMY", false);
define("CS_ACTIVE_SHORTCODE", false);
define("CS_ACTIVE_CUSTOMIZE", false);
add_action("wp_enqueue_scripts", "TemaVadisi_js_dosyalari");
add_action("admin_enqueue_scripts", "TemaVadisi_adminjs_dosyalari");
add_action("init", "TemaVadisi_admin_js_ekle");
add_action("get_header", "TemaVadisi_custom_css");
add_theme_support("html5", ["search-form", "comment-form", "comment-list", "gallery", "caption"]);
add_theme_support("post-thumbnails");
register_nav_menus(["anamenu" => __("Ana Men", "temavadisi"), "mobilmenu" => __("Mobil Men", "temavadisi")]);
add_filter("pt-ocdi/import_files", "ocdi_import_files");
add_action("pt-ocdi/after_import", "ocdi_after_import_setup");
add_action("after_setup_theme", "TemaVadisi_setup");
add_image_size("ilanimg", 273, 180, ["center", "top"]);
add_image_size("galeriL", 535, 423, ["center", "top"]);
add_image_size("galeriT", 100, 75, ["center", "top"]);
add_image_size("benzerimg", 385, 254, ["center", "top"]);
add_image_size("ilanlar", 550, 412, ["center", "top"]);
add_action("widgets_init", "TemaVadisi_Bilesen_Destegi");
class TemaVadisi_Walker_Menu extends Walker
{
public $db_fields = ["parent" => "menu_item_parent", "id" => "db_id"];
public function start_lvl(&$output, $depth = 0, $args = [])
{
$indent = str_repeat("\t", $depth);
$output .= "\n" . $indent . "<ul>\n";
}
public function end_lvl(&$output, $depth = 0, $args = [])
{
$indent = str_repeat("\t", $depth);
$output .= $indent . "</ul>\n";
}
public function start_el(&$output, $item, $depth = 0, $args = [], $id = 0)
{
global $wp_query;
$indent = $depth ? str_repeat("\t", $depth) : "";
$class_names = $value = "";
$classes = empty($item->classes) ? [] : (array) $item->classes;
if (in_array("current-menu-item", $classes)) {
$classes[] = "active";
unset($classes["current-menu-item"]);
}
$children = get_posts(["post_type" => "nav_menu_item", "nopaging" => true, "numberposts" => 1, "meta_key" => "_menu_item_menu_item_parent", "meta_value" => $item->ID]);
if (!empty($children)) {
$classes[] = "has-sub";
}
$class_names = join(" ", apply_filters("nav_menu_css_class", array_filter($classes), $item, $args));
$class_names = $class_names ? " class=\"" . esc_attr($class_names) . "\"" : "";
$id = apply_filters("nav_menu_item_id", "menu-item-" . $item->ID, $item, $args);
$id = $id ? " id=\"" . esc_attr($id) . "\"" : "";
$output .= $indent . "<li" . $id . $value . $class_names . ">";
$attributes = !empty($item->attr_title) ? " title=\"" . esc_attr($item->attr_title) . "\"" : "";
$attributes .= !empty($item->target) ? " target=\"" . esc_attr($item->target) . "\"" : "";
$attributes .= !empty($item->xfn) ? " rel=\"" . esc_attr($item->xfn) . "\"" : "";
$attributes .= !empty($item->url) ? " href=\"" . esc_attr($item->url) . "\"" : "";
$item_output = $args->before;
$item_output .= "<a" . $attributes . "><span>";
$item_output .= $args->link_before . apply_filters("the_title", $item->title, $item->ID) . $args->link_after;
$item_output .= "</span></a>";
$item_output .= $args->after;
$output .= apply_filters("walker_nav_menu_start_el", $item_output, $item, $depth, $args);
}
public function end_el(&$output, $item, $depth = 0, $args = [])
{
$output .= "</li>\n";
}
}
add_filter("excerpt_more", "TemaVadisi_ozet_devami");
add_filter("siteorigin_widgets_icon_families", "ikonlari_cikar");
add_filter("siteorigin_widgets_icon_families", "TemaVadisi_font_ailesi");
add_filter("siteorigin_widgets_widget_folders", "Temavadisi_widget_paketi");
add_filter("siteorigin_panels_general_style_groups", "siteorigin_bilesen_stilleri", 10, 2);
add_filter("siteorigin_panels_row_style_fields", "siteorigin_bilesen_ekleme");
add_filter("siteorigin_panels_row_style_attributes", "backblack_row_style_attributes", 10, 2);
add_filter("siteorigin_panels_widget_style_fields", "siteorigin_bilesen_ekleme2");
add_filter("siteorigin_widgets_active_widgets", "Temavadisi_widget_paketi_aktif");
add_filter("siteorigin_panels_widget_dialog_tabs", "Temavadisi_add_widget_tabs", 20);
add_filter("siteorigin_widgets_field_class_prefixes", "Temavadisi_fields_class_prefixes");
add_filter("siteorigin_widgets_field_class_paths", "Temavadisi_fields_class_paths");
add_action("admin_bar_menu", "adminbar_link_ekle", 999);
add_action("wp_ajax_sendmail", "Temavadisi_ilanmail");
add_action("wp_ajax_nopriv_sendmail", "Temavadisi_ilanmail");
if (!is_user_logged_in()) {
add_action("init", "ajax_auth_init");
}
if (current_user_can("administrator")) {
add_action("show_user_profile", "uyelik_profile_fields");
add_action("edit_user_profile", "uyelik_profile_fields");
}
add_action("personal_options_update", "save_uyelik_profile_fields");
add_action("edit_user_profile_update", "save_uyelik_profile_fields");
add_action("init", "uye_wpadmin_yonlendirme");
add_action("init", "uye_bitis_sorgulama");
add_action("init", "one_cikan_bitis");
add_filter("manage_users_columns", "uyelik_gostergesi_ekle", 10, 1);
add_filter("manage_users_custom_column", "uyelik_gosterge_tablosu", 10, 3);
add_action("after_setup_theme", "remove_admin_bar");
add_action("admin_init", "yukleme_izni_verme");
add_filter("wp_handle_upload_prefilter", "limit_upload_size", 10, 1);
add_filter("add_menu_classes", "onay_bekleyen_yazilar");
add_filter("posts_where", "resim_gorme_izni");
add_action("init", "custom_rewrite_basic");
add_filter("query_vars", "prefix_register_query_var");
add_action("template_redirect", "prefix_url_rewrite_templates");
add_filter("login_headerurl", "wpgiris_logo_url");
add_filter("login_headertitle", "wpgiris_logo_url_title");
add_action("template_redirect", "jquery_sil");
add_filter("style_loader_tag", "style_tag_sil", 10, 2);
add_filter("script_loader_tag", "style_tag_sil", 10, 2);
if (cs_get_option("wp-surum")) {
remove_action("wp_head", "wlwmanifest_link");
remove_action("wp_head", "rsd_link");
remove_action("wp_head", "wp_generator");
}
if (cs_get_option("wp-emoji")) {
function TemaVadisi_emoji_kaldir()
{
remove_action("admin_print_styles", "print_emoji_styles");
remove_action("wp_head", "print_emoji_detection_script", 7);
remove_action("admin_print_scripts", "print_emoji_detection_script");
remove_action("wp_print_styles", "print_emoji_styles");
remove_filter("wp_mail", "wp_staticize_emoji_for_email");
remove_filter("the_content_feed", "wp_staticize_emoji");
remove_filter("comment_text_rss", "wp_staticize_emoji");
add_filter("tiny_mce_plugins", "TemaVadisi_emojitiny_kaldir");
}
add_action("init", "TemaVadisi_emoji_kaldir");
function TemaVadisi_emojitiny_kaldir($emojitiny)
{
if (is_array($emojitiny)) {
return array_diff($emojitiny, ["wpemoji"]);
}
return [];
}
}
add_filter("script_loader_src", "TemaVadisi_query_strings1", 15, 1);
add_filter("script_loader_src", "TemaVadisi_query_strings3", 15, 1);
add_filter("style_loader_src", "TemaVadisi_query_strings1", 15, 1);
add_filter("style_loader_src", "TemaVadisi_query_strings2", 15, 1);
if (cs_get_option("json-api")) {
remove_action("wp_head", "rest_output_link_wp_head", 10);
remove_action("wp_head", "wp_oembed_add_discovery_links", 10);
}
if (cs_get_option("tarayici_bellek")) {
function TemaVadisi_tarayici_cache($kurallar)
{
return $kurallar . "## EXPIRES CACHING ##\n\nExpiresActive On\nExpiresByType image/jpg \"access plus 1 year\"\nExpiresByType image/jpeg \"access plus 1 year\"\nExpiresByType image/gif \"access plus 1 year\"\nExpiresByType image/png \"access plus 1 year\"\nExpiresByType text/css \"access plus 1 month\"\nExpiresByType application/pdf \"access plus 1 month\"\nExpiresByType text/x-javascript \"access plus 1 month\"\nExpiresByType application/x-shockwave-flash \"access plus 1 month\"\nExpiresByType image/x-icon \"access plus 1 year\"\nExpiresDefault \"access plus 1 seconds\"\n\n## EXPIRES CACHING ##\n\n<ifModule mod_headers.c>\n Header set Connection keep-alive\n</ifModule>\n\n#Gzip\n<IfModule mod_deflate.c>\n\tAddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json\n</IfModule>\n#End Gzip\n\n####Turn ETags Off\n<ifmodule mod_headers.c>\nHeader unset ETag\n</ifmodule>\n \n#ETags\nFileETag None\n\n<IfModule mod_deflate.c>\n AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css text/javascript application/javascript\n</IfModule>\n<ifmodule mod_expires.c>\n<filesmatch \"\\.(jpg|gif|png|css|js)\$\">\nExpiresActive on\nExpiresDefault \"access plus 1 year\"\n</filesmatch>\n</ifmodule> \n";
}
add_filter("mod_rewrite_rules", "TemaVadisi_tarayici_cache");
}
class TemaVadisi_Lisans_Fonksiyonu
{
public $api_server = "https://www.temavadisi.com";
public $product_code = "vadimarketv3";
public $license_key = NULL;
public function __construct()
{
$this->license_key = get_option("wpls_" . $this->product_code . "_license_key");
add_filter("cron_schedules", [$this, "vadilisans_add_cron_interval"]);
add_action("vadilisans_cron_hook", [$this, "vadilisans_cron_exec"]);
if (!wp_next_scheduled("vadilisans_cron_hook")) {
wp_schedule_event(time(), "one_week", "vadilisans_cron_hook");
}
add_action("admin_menu", [$this, "vadilisans_theme_menu"]);
}
public function vadilisans_add_cron_interval($schedules)
{
$schedules["one_week"] = ["interval" => 2592000, "display" => __("Every a Week")];
return $schedules;
}
public function vadilisans_cron_exec()
{
$this->vadilisans_api_call($this->license_key);
}
public function vadilisans_cek_api()
{
$status = get_option("wpls_" . $this->product_code . "_license_key_status");
if ($status === "valid") {
return true;
}
return false;
}
public function vadilisans_api_call($license = "")
{
global $wp_version;
$lisans_url = home_url();
$lisansurl = parse_url($lisans_url);
$api_params = ["wpls-verify" => $license, "product" => urlencode($this->product_code), "domain" => $lisansurl["host"], "validip" => isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : $_SERVER["LOCAL_ADDR"]];
$response = wp_remote_get(add_query_arg($api_params, $this->api_server), ["timeout" => 15, "sslverify" => false, "httpversion" => "1.0"]);
if (is_wp_error($response)) {
return false;
}
$license_data = json_decode(wp_remote_retrieve_body($response));
if (empty($license_data) || $license_data === NULL || $license_data === false) {
return false;
}
update_option("wpls_" . $this->product_code . "_license_key", $license);
update_option("wpls_" . $this->product_code . "_license_key_status", $license_data->valid == "true" ? "valid" : "invalid");
if ($license_data->valid == "true") {
return true;
}
return false;
}
public function vadilisans_theme_menu()
{
add_theme_page("Lisans Onaylama", "Tema Lisans", "manage_options", "tv-lisans-ayarlari", [$this, "vadilisans_license_page"]);
}
public function vadilisans_license_page()
{
$license = get_option("wpls_" . $this->product_code . "_license_key");
$status = get_option("wpls_" . $this->product_code . "_license_key_status");
if (isset($_POST[$this->product_code . "_action"])) {
$license = $_POST[$this->product_code . "_license_key"] != $license ? $_POST[$this->product_code . "_license_key"] : $license;
$this->vadilisans_api_call($license);
}
echo "\n\t<div class=\"wrap nosubsub\">\n\t\t<h2>";
_e("Tema Lisans Ayar", "tvlisans");
echo "</h2>\n\t\t<form method=\"post\" action=\"";
echo admin_url("themes.php?page=tv-lisans-ayarlari");
echo "\">\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr valign=\"top\">\t\n\t\t\t\t\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t\t\t\t\t<label for=\"wpls_sample_license_url\">";
_e("Tema Yapmcs", "tvlisans");
echo "</label>\n\t\t\t\t\t\t</th>\n <td>\n\t Bedicoup\n </td>\n\t\t\t\t\t</tr> \n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t\t\t\t\t<label for=\"";
echo $this->product_code . "_license_key";
echo "\">";
_e("Lisans Anahtarnz:", "tvlisans");
echo "</label>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input id=\"";
echo $this->product_code . "_license_key";
echo "\" name=\"";
echo $this->product_code . "_license_key";
echo "\" type=\"text\" class=\"regular-text\" value=\"";
echo esc_attr($license);
echo "\" />\n\t\t\t\t\t\t\t<p class=\"description\">";
_e("Satn aldnz lisans anahtarnz girin", "tvlisans");
echo "</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"description\">";
_e("Deiiklikleri kaydet butonu yenilendiginde tekrar tklamalsnz.", "tvlisans");
echo "</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n <input type=\"hidden\" name=\"";
echo $this->product_code . "_action";
echo "\" value=\"update\" />\n\t\t\t";
submit_button();
echo "\n\t\t</form>\n\t";
}
}
function TemaVadisi_admin_mesaji()
{
global $current_user;
$user_id = $current_user->ID;
if (!get_user_meta($user_id, "TemaVadisi_admin_mesaji_kapat")) {
echo "<div class=\"notice notice-warning\" style=\"position:relative;\">\n\t\t\t<p>" . __("Tema kullanm hakknda bilgi almak iin <a href=\"http://demo.temavadisi.com/dokuman/vadiilan\" target=\"_blank\"><strong>Kullanm Dkmanna buradan</strong></a> bakabilirsiniz. Yardm almak iin ltfen <a href=\"https://www.temavadisi.com\" target=\"_blank\">www.temavadisi.com</a> adresindeki <strong>Destek sistemini</strong> kullannz.") . " <a style=\"text-decoration:none;\" href=\"?bildirimi-kapat\"><i class=\"dashicons dashicons-no-alt\"></i>tekrar gsterme!</a></p>\n\t\t\t\t</div>";
}
}
function TemaVadisi_admin_mesaji_kapat()
{
global $current_user;
$user_id = $current_user->ID;
if (isset($_GET["bildirimi-kapat"])) {
add_user_meta($user_id, "TemaVadisi_admin_mesaji_kapat", "true", true);
}
}
function TemaVadisi_js_dosyalari()
{
wp_enqueue_script("slickslider", get_template_directory_uri() . "/js/slick.min.js", ["jquery"], NULL, true);
wp_enqueue_script("superfish", get_template_directory_uri() . "/js/superfish.min.js", ["jquery"], NULL, true);
wp_enqueue_script("magnific-popup", get_template_directory_uri() . "/js/jquery.magnific-popup.min.js", ["jquery"], NULL, true);
wp_enqueue_script("tv-scripts", get_template_directory_uri() . "/js/scripts.js", ["jquery"], NULL, true);
if (is_single() || is_home("ilanduzenle")) {
wp_enqueue_script("yandex-map", "https://api-maps.yandex.ru/2.1/?lang=tr_TR", ["jquery"], NULL, true);
}
if (is_home("ilanduzenle")) {
wp_enqueue_media();
wp_enqueue_script("gallery-metabox", get_template_directory_uri() . "/inc/galeri-metabox/js/gallery-metabox.js", ["jquery", "jquery-ui-sortable"], NULL, true);
wp_enqueue_style("gallery-metabox", get_template_directory_uri() . "/inc/galeri-metabox/css/gallery-metabox.css");
}
}
function TemaVadisi_adminjs_dosyalari()
{
global $pagenow;
if ($pagenow == "post.php" || get_post_type() == "post") {
wp_enqueue_script("yandex-map", "https://api-maps.yandex.ru/2.1/?lang=tr_TR", ["jquery"], NULL, true);
}
}
function TemaVadisi_admin_js_ekle()
{
if (is_admin()) {
wp_enqueue_script("ililce", get_template_directory_uri() . "/inc/ililce/ililce.js", ["jquery"]);
}
}
function TemaVadisi_custom_css()
{
if (!is_admin()) {
wp_enqueue_style("TemaVadisi_custom_css", get_template_directory_uri() . "/css/custom.css", [], NULL);
ob_start();
include get_template_directory() . "/css/custom_css.php";
$custom_css = ob_get_clean();
$custom_css = str_replace(["\r\n", "\r"], "\n", $custom_css);
$lines = explode("\n", $custom_css);
$new_lines = [];
foreach ($lines as $i => $line) {
if (!empty($line)) {
$new_lines[] = trim($line);
}
}
wp_add_inline_style("TemaVadisi_custom_css", implode($new_lines));
}
}
function varsayilan_menulink()
{
echo "<ul id=\"menu-ust\" class=\"sf-menu\"><li class=\"menu-item current-menu-item current_page_item\"><a href=" . get_option("home") . "/wp-admin/nav-menus.php>" . __("Yeni bir men ayarlamak iin tklaynz.", "temavadisi") . "</a></li></ul>";
}
function ocdi_import_files()
{
return [["import_file_name" => "Demo Ykle", "categories" => ["Vadi lan Temas"], "import_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan.xml", "import_widget_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan-widgets.wie", "import_customizer_file_url" => "http://demo.temavadisi.com/vadiilan/demo/vadiilan-export.dat", "import_preview_image_url" => get_template_directory_uri() . "/screenshot.png", "import_notice" => __("e aktarma esnasnda hata yada yarda kesilme sorunu yaarsanz <b>hosting</b> firmanza bavurunuz.", "tema-vadisi"), "preview_url" => "http://demo.temavadisi.com/vadiilan"]];
}
function ocdi_after_import_setup()
{
$ana_menu = get_term_by("name", "anamenu", "nav_menu");
$mobil_menu = get_term_by("name", "mobilmenu", "nav_menu");
$footer_menu = get_term_by("name", "footermenu", "nav_menu");
set_theme_mod("nav_menu_locations", ["anamenu" => $ana_menu->term_id, "mobilmenu" => $mobil_menu->term_id, "footermenu" => $footer_menu->term_id]);
}
function TemaVadisi_setup()
{
load_theme_textdomain("temavadisi", get_template_directory_uri() . "/lang");
}
function TemaVadisi_Bilesen_Destegi()
{
register_sidebar(["name" => "Sidebar", "id" => "sidebar1", "before_widget" => "<div class=\"temayan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"yankapsa\"><div class=\"yanbaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Kategori Sidebar", "id" => "sidebar-kat", "before_widget" => "<div class=\"temayan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"yankapsa\"><div class=\"yanbaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 1", "id" => "footer1", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 2", "id" => "footer2", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 3", "id" => "footer3", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
register_sidebar(["name" => "Footer Sidebar 4", "id" => "footer4", "before_widget" => "<div class=\"fooyan %2\$s\">", "after_widget" => "</div>", "before_title" => "<div class=\"fookapsa\"><div class=\"foobaslik\">", "after_title" => "</div></div>"]);
}
function TemaVadisi_onresimurl()
{
$resim_url = get_the_post_thumbnail_url(get_the_ID(), "full");
if (has_post_thumbnail()) {
echo $resim_url;
}
}
function TemaVadisi_onresim($size, $width = "", $height = "", $class = "")
{
$html = "";
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), $size);
if ($image_url) {
$html .= "" . get_the_post_thumbnail(get_the_ID(), $size, ["class" => $class, "alt" => get_the_title(), "itemprop" => "image"]) . "";
} else {
if (get_post_meta(get_the_ID(), "resim", true)) {
$html .= "<img src=\"" . get_post_meta(get_the_ID(), "resim", true) . "\" alt=\"" . get_the_title() . "\" itemprop=\"image\" ";
if ($class) {
$html .= "class=\"" . $class . "\" ";
}
if ($width) {
$html .= "width=\"" . $width . "\" ";
}
if ($height) {
$html .= "height=\"" . $height . "\" ";
}
$html .= "/>";
} else {
if (cs_get_option("varsayilan")) {
$html .= "<img src=\"" . cs_get_option("varsayilan") . "\" alt=\"" . get_the_title() . "\" itemprop=\"image\" ";
if ($class) {
$html .= "class=\"" . $class . "\" ";
}
if ($width) {
$html .= "width=\"" . $width . "\" ";
}
if ($height) {
$html .= "height=\"" . $height . "\" ";
}
$html .= "/>";
}
}
}
return $html;
}
function TemaVadisi_ozet($string, $word_limit)
{
$words = explode(" ", $string, $word_limit + 1);
if ($word_limit < count($words)) {
array_pop($words);
}
return implode(" ", $words) . "..";
}
function TemaVadisi_ozet_devami($more)
{
return "..";
}
function TemaVadisi_sayfalama($pages = "", $range = 2)
{
echo "<div class=\"sayfalama col-lg-12 aligncenter\"><ul>";
$showitems = $range * 2 + 1;
global $paged;
if (empty($paged)) {
$paged = 1;
}
if ($pages == "") {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
if (2 < $paged && $range + 1 < $paged && $showitems < $pages) {
echo "<li><a href=\"" . get_pagenum_link(1) . "\"></a></li>";
}
if (1 < $paged && $showitems < $pages) {
echo "<li class=\"pOnce\"><a href=\"" . get_pagenum_link($paged - 1) . "\">« nceki</a></li>";
}
for ($i = 1; $i <= $pages; $i++) {
if (1 != $pages && (!($paged + $range + 1 <= $i || $i <= $paged - $range - 1) || $pages <= $showitems)) {
echo $paged == $i ? "<li class=\"active\"><span>" . $i . "</span></li>" : "<li><a href=\"" . get_pagenum_link($i) . "\">" . $i . "</a></li>";
}
}
if ($paged < $pages && $showitems < $pages) {
echo "<li class=\"pSonra\"><a href=\"" . get_pagenum_link($paged + 1) . "\">Sonraki »</a></li>";
}
if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) {
echo "<li><a href=\"" . get_pagenum_link($pages) . "\"></a></li>";
}
}
echo "</ul></div>";
}
function Temavadisi_sayfalar($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = "/", $pagestring = "?sayfa=")
{
if (!$adjacents) {
$adjacents = 1;
}
if (!$limit) {
$limit = 15;
}
if (!$page) {
$page = 1;
}
if (!$targetpage) {
$targetpage = "/";
}
$prev = $page - 1;
$next = $page + 1;
$lastpage = ceil($totalitems / $limit);
$lpm1 = $lastpage - 1;
$pagination = "";
if (1 < $lastpage) {
$pagination .= "<div class=\"sayfalama col-lg-12 aligncenter\"";
if ($margin || $padding) {
$pagination .= " style=\"";
if ($margin) {
$pagination .= "margin: " . $margin . ";";
}
if ($padding) {
$pagination .= "padding: " . $padding . ";";
}
$pagination .= "\"";
}
$pagination .= "><ul>";
if (1 < $page) {
$pagination .= "<li class=\"pOnce\"><a href=\"" . $targetpage . $pagestring . $prev . "\">« nceki</a></li>";
} else {
$pagination .= "<li class=\"pOnce\"><span class=\"gizle\">« nceki</span></li>";
}
if ($lastpage < 7 + $adjacents * 2) {
for ($counter = 1; $counter <= $lastpage; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
} else {
if (7 + $adjacents * 2 <= $lastpage) {
if ($page < 1 + $adjacents * 3) {
for ($counter = 1; $counter < 4 + $adjacents * 2; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
$pagination .= "<li><span class=\"elipses\">...</span></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lpm1 . "\">" . $lpm1 . "</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lastpage . "\">" . $lastpage . "</a></li>";
} else {
if ($page < $lastpage - $adjacents * 2 && $adjacents * 2 < $page) {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "1\">1</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "2\">2</a></li>";
$pagination .= "<li><span class=\"elipses\">...</span></li>";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
$pagination .= "<li><span class=\"elipses\">...</span></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lpm1 . "\">" . $lpm1 . "</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $lastpage . "\">" . $lastpage . "</a></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "1\">1</a></li>";
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . "2\">2</a></li>";
$pagination .= "<li><span class=\"elipses\">...</span></li>";
for ($counter = $lastpage - (1 + $adjacents * 3); $counter <= $lastpage; $counter++) {
if ($counter == $page) {
$pagination .= "<li class=\"active\"><span>" . $counter . "</span></li>";
} else {
$pagination .= "<li><a href=\"" . $targetpage . $pagestring . $counter . "\">" . $counter . "</a></li>";
}
}
}
}
}
}
if ($page < $counter - 1) {
$pagination .= "<li class=\"pSonra\"><a href=\"" . $targetpage . $pagestring . $next . "\">Sonraki »</a></li>";
} else {
$pagination .= "<li class=\"pSonra\"><span class=\"gizle\">Sonraki »</span></li>";
}
$pagination .= "</ul></div>\n";
}
return $pagination;
}
function TemaVadisi_comment($comment, $args, $depth)
{
$GLOBALS["comment"] = $comment;
extract($args, EXTR_SKIP);
if ("article" == $args["style"]) {
$tag = "article";
$add_below = "comment";
} else {
$tag = "article";
$add_below = "comment";
}
echo "<li ";
comment_class(empty($args["has_children"]) ? "nochild" : "parent");
echo " id=\"comment-";
comment_ID();
echo "\">\n<";
echo $tag;
echo " itemprop=\"comment\" itemscope itemtype=\"https://schema.org/Comment\">\n\t\t<div class=\"comment-avatar\">\n\t\t\t";
echo get_avatar($comment, 100, "", "Avatar");
echo "\t\t</div>\n\t\t<div class=\"comment-body\">\n\t\t<div class=\"comment-author vcard\">\n\t\t\t<cite class=\"fn\">";
comment_author();
echo "</cite>\n\t\t\t<span class=\"comS\">/</span>\n\t\t\t<div class=\"comment-meta\">\n\t\t\t\t<a href=\"#comment-";
comment_ID();
echo "\">";
comment_date("j F Y");
echo ", ";
comment_time();
echo "</a>\n\t\t\t</div>\t \t\n\t\t</div>\n";
edit_comment_link("<p class=\"comment-edit\">dzenle</p>", "", "");
if ($comment->comment_approved == "0") {
echo "\t<p class=\"yorum_kontrol\">";
echo __("Yorumunuz kontrol edildikten sonra yaynlanacaktr.", "temavadisi");
echo "</p>\n";
}
echo "\n\t\t\t<div class=\"comment-content\">\n\t\t\t\t";
comment_text();
echo "\t\t\t\t<div class=\"comment-reply\">\n\t\t\t\t\t";
comment_reply_link(array_merge($args, ["add_below" => $add_below, "depth" => $depth, "max_depth" => $args["max_depth"]]));
echo "\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n";
}
function TemaVadisi_comment_close()
{
echo "</article></li>";
}
function ikonlari_cikar($ikonlar)
{
unset($ikonlar["elegantline"]);
unset($ikonlar["fontawesome"]);
unset($ikonlar["genericons"]);
unset($ikonlar["icomoon"]);
unset($ikonlar["typicons"]);
unset($ikonlar["ionicons"]);
return $ikonlar;
}
function TemaVadisi_font_ailesi($icon_ailesi)
{
$icon_ailesi["icon"] = ["name" => __("Tema Font Paketi", "temavadisi"), "style_uri" => get_template_directory_uri() . "/css/sow-temavadisi.css?v=1.0", "icons" => temakutuphanesi()];
return $icon_ailesi;
}
function Temavadisi_widget_paketi($folders)
{
$folders[] = get_template_directory() . "/inc/widget-paketi/";
return $folders;
}
function siteorigin_bilesen_stilleri($groups)
{
unset($groups["attributes"]);
unset($groups["layout"]);
return $groups;
}
function siteorigin_bilesen_ekleme($fields)
{
$fields["row_stretch"] = ["name" => __("Row Layout", "siteorigin-panels"), "type" => "select", "group" => "design", "options" => ["" => __("Standard", "siteorigin-panels"), "full" => __("Tam Genilik", "siteorigin-panels"), "full-stretched" => __("Tam Genilik (erik)", "siteorigin-panels")], "priority" => 10];
$fields["backblack"] = ["name" => __("Karartma Efektini Kaldr", "siteorigin-panels"), "type" => "checkbox", "group" => "design", "label" => __("Kaldrlsn m?", "siteorigin-panels"), "description" => __("Arkaplan karartma efektini satrdan kaldrabilirsiniz.", "siteorigin-panels"), "priority" => 8];
$fields["padding"] = ["name" => __("Padding", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Satrn etrafnda boluk brakmak iin bu alan kullanabilirsiniz.", "siteorigin-panels"), "priority" => 7, "multiple" => true];
return $fields;
}
function backblack_row_style_attributes($attributes, $args)
{
if (!empty($args["backblack"])) {
array_push($attributes["class"], "backbefore");
}
return $attributes;
}
function siteorigin_bilesen_ekleme2($fields)
{
$fields["margin"] = ["name" => __("Kenar Boluklar", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Bileen kenar boluklarn buradan ayarlayabilirsiniz.", "siteorigin-panels"), "priority" => 6, "multiple" => true];
$fields["mobile_padding"] = ["name" => __("Kenar Boluklar (Mobil)", "siteorigin-panels"), "type" => "measurement", "group" => "design", "description" => __("Mobil iin bileen kenar boluklarn buradan ayarlayabilirsiniz.", "siteorigin-panels"), "priority" => 6, "multiple" => true];
return $fields;
}
function Temavadisi_FMenu_Select()
{
$menus = wp_get_nav_menus();
if (!is_wp_error($menus) && !empty($menus)) {
foreach ($menus as $menu) {
$options[$menu->term_id] = $menu->name;
}
}
return $options;
}
function Temavadisi_widget_paketi_aktif($active)
{
$active["button"] = false;
$active["editor"] = false;
$active["google-map"] = false;
$active["slider"] = false;
$active["image"] = false;
$active["post-carousel"] = false;
$active["baslik-widget"] = true;
$active["fmenu-widget"] = true;
$active["onecikan-widget"] = true;
$active["goldilanlar-widget"] = true;
$active["soneklenen-widget"] = true;
$active["ikategori-widget"] = true;
$active["sayilar-widget"] = true;
$active["bilgi-widget"] = true;
$active["fiyat-tablo-widget"] = true;
$active["blog-widget"] = true;
return $active;
}
function Temavadisi_add_widget_tabs($tabs)
{
$tabs[] = ["title" => __("Tema Bileenleri", "temavadisi"), "filter" => ["groups" => ["vadiwidget"]]];
unset($tabs["page_builder"]);
unset($tabs["recommended"]);
unset($tabs["widgets_bundle"]);
return $tabs;
}
function Temavadisi_fields_class_prefixes($class_prefixes)
{
$class_prefixes[] = "Temavadisi_Custom_Field_";
return $class_prefixes;
}
function Temavadisi_fields_class_paths($class_paths)
{
$class_paths[] = get_template_directory() . "/inc/form-fields/";
return $class_paths;
}
function adminbar_link_ekle($wp_admin_bar)
{
global $pagenow;
if ($pagenow == "post-new.php" && isset($_GET["post_type"]) == "page" || isset($_GET["action"]) == "edit") {
$args = ["id" => "sayfaolusturucu", "title" => "Sayfa Oluturucu Modu", "href" => $_SERVER["REQUEST_URI"] . "&siteorigin-page-builder", "meta" => ["class" => "sayfaduzeni"]];
$wp_admin_bar->add_node($args);
}
}
function Temavadisi_ilanmail()
{
if (isset($_POST["submitted"])) {
if (trim($_POST["adsoyad"]) === "") {
$nameError = "Ltfen Adnz ve Soyadnz yazn.";
$hasError = true;
} else {
$name = trim($_POST["adsoyad"]);
}
if (trim($_POST["telefon"]) === "") {
$nameError = "Ltfen telefonunuzu yazn.";
$hasError = true;
} else {
$name = trim($_POST["telefon"]);
}
if (trim($_POST["mesajiniz"]) === "") {
$commentError = "Ltfen mesajnz yazn.";
$hasError = true;
} else {
if (function_exists("stripslashes")) {
$mesajiniz = stripslashes(trim($_POST["mesajiniz"]));
} else {
$mesajiniz = trim($_POST["mesajiniz"]);
}
}
if (!isset($hasError)) {
$emailTo = $_POST["gonderilecek"];
if (!isset($emailTo) || $emailTo == "") {
$emailTo = $_POST["gonderilecek"];
}
$subject = get_bloginfo("name") . " zerinden " . $name . " size mail gnderdi.";
$body = "Ad: " . $name . " nnEmail: " . $email . " nnKonu: " . $mesajiniz;
$headers = "Reply-To: " . $name . " <" . $email . ">rn";
if (wp_mail($emailTo, $subject, $body, $headers)) {
echo "<div class='success'>Mesajnz baaryla gnderilmitir.</div>";
} else {
echo "<div class='error'>Mail gnderilemedi, ltfen daha sonra tekrar deneyin!</div>";
}
} else {
$error = "<ul>";
if ($nameError != "") {
$error = $error . "<li>" . $nameError . "</li>";
}
if ($emailError != "") {
$error = $error . "<li>" . $emailError . "</li>";
}
if ($commentError != "") {
$error = $error . "<li>" . $commentError . "</li>";
}
$error = $error . "</ul>";
echo $error;
}
} else {
$error = "Hata!";
}
exit;
}
function ajax_auth_init()
{
wp_register_script("validate-script", get_template_directory_uri() . "/js/jquery.validate.js", ["jquery"], NULL, true);
wp_enqueue_script("validate-script");
wp_register_script("ajax-auth-script", get_template_directory_uri() . "/js/ajaxlogin.js", ["jquery"], NULL, true);
wp_enqueue_script("ajax-auth-script");
wp_localize_script("ajax-auth-script", "ajax_auth_object", ["ajaxurl" => admin_url("admin-ajax.php"), "redirecturl" => home_url("hesabim"), "loadingmessage" => __("Bilgiler kontrol ediliyor, Ltfen bekleyiniz..", "temavadisi")]);
add_action("wp_ajax_nopriv_ajaxlogin", "ajax_login");
add_action("wp_ajax_nopriv_ajaxregister", "ajax_register");
add_action("wp_ajax_nopriv_ajaxforgotpassword", "ajax_forgotPassword");
}
function ajax_login()
{
check_ajax_referer("ajax-login-nonce", "security");
auth_user_login($_POST["username"], $_POST["password"], "Giri");
exit;
}
function ajax_register()
{
check_ajax_referer("ajax-register-nonce", "security");
$info = [];
$info["user_login"] = sanitize_user($_POST["username"]);
$info["nickname"] = $info["user_login"];
$info["user_nicename"] = $info["nickname"];
$info["first_name"] = sanitize_text_field($_POST["first_name"]);
$info["last_name"] = sanitize_text_field($_POST["last_name"]);
$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 kullanc ad zaten kaytl.", "temavadisi")]);
} else {
if (in_array("existing_user_email", $error)) {
echo json_encode(["loggedin" => false, "message" => __("Bu e-posta adresi zaten kaytl.", "temavadisi")]);
}
}
}
} else {
auth_user_login($info["nickname"], $info["user_pass"], "Kayt");
}
exit;
}
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" => __("Hatal kullanc ad ya da parola", "temavadisi")]);
} else {
wp_set_current_user($user_signon->ID);
echo json_encode(["loggedin" => true, "message" => __($login . " baarl, ynlendiriliyorsunuz..", "temavadisi")]);
}
exit;
}
function ajax_forgotPassword()
{
check_ajax_referer("ajax-forgot-nonce", "security");
global $wpdb;
$account = $_POST["user_login"];
if (empty($account)) {
$error = __("Bir kullanc ad veya e-posta adresi girin.", "temavadisi");
} else {
if (is_email($account)) {
if (email_exists($account)) {
$get_by = "email";
} else {
$error = __("Bu e-posta adresine kaytl kullanc bulunamad.", "temavadisi");
}
} else {
if (validate_username($account)) {
if (username_exists($account)) {
$get_by = "login";
} else {
$error = __("Bu kullanc adna kaytl kullanc bulunamad.", "temavadisi");
}
} else {
$error = __("Geersiz kullanc ad veya e-posta adresi.", "temavadisi");
}
}
}
if (empty($error)) {
$random_password = wp_generate_password();
$user = get_user_by($get_by, $account);
$update_user = wp_update_user(["ID" => $user->ID, "user_pass" => $random_password]);
if ($update_user) {
$from = get_option("admin_email");
if (!(isset($from) && is_email($from))) {
$sitename = strtolower($_SERVER["SERVER_NAME"]);
if (substr($sitename, 0, 4) == "www.") {
$sitename = substr($sitename, 4);
}
$from = "admin@" . $sitename;
}
$to = $user->user_email;
$subject = __("ifre Yenileme", "temavadisi");
$message = __("Yeni ifreniz: ", "temavadisi") . $random_password;
$headers = ["Content-Type: text/html; charset=UTF-8"];
$mail = wp_mail($to, $subject, $message, $headers);
if ($mail) {
$success = __("Yeni parolanz e-posta adresinize gnderildi.Ltfen kontrol edin.", "temavadisi");
} else {
$error = __("Site zerinden mail gnderilemiyor. Ltfen site yneticisine bavurun.", "temavadisi");
}
} else {
$error = __("Hata! Bilgileriniz kontrol edilirken bir sorun olutu.", "temavadisi");
}
}
if (!empty($error)) {
echo json_encode(["loggedin" => false, "message" => __($error)]);
}
if (!empty($success)) {
echo json_encode(["loggedin" => false, "message" => __($success)]);
}
exit;
}
function uyelik_profile_fields($user)
{
echo "<script>\njQuery( document ).ready(function() {\njQuery('#uyetipi').change(function() {\n\tjQuery(\"#showuye\").show();\n});\n});\n</script>\n <h3 style=\"margin-top:40px;\">";
echo __("yelik Ayar", "temavadisi");
echo "</h3>\n\n <table class=\"form-table\">\n <tr>\n <th><label for=\"uyetipi\">";
echo __("ye Tipi", "temavadisi");
echo "</label></th>\n <td>\n\t\t\t";
$uyetipi = get_the_author_meta("uyetipi", $user->ID);
echo "\t\t\t<select name=\"uyetipi\" id=\"uyetipi\">\n\t\t\t\t<option value=\"0\"";
if (!$uyetipi) {
echo " selected";
}
echo ">";
echo __("yelik Tipi Seiniz", "temavadisi");
echo "</option>\n\t\t\t\t<option value=\"golduye\"";
if ($uyetipi == "golduye") {
echo " selected";
}
echo ">";
echo __("Gold ye", "temavadisi");
echo "</option>\n\t\t\t\t<option value=\"platinuye\"";
if ($uyetipi == "platinuye") {
echo " selected";
}
echo ">";
echo __("Platin ye", "temavadisi");
echo "</option>\n\t\t\t</select>\n\t\t\t<input id=\"showuye\" style=\"display:none;\" type=\"datetime-local\" min=\"";
echo date("Y-m-d\\TH:i");
echo "\" value=\"";
echo date("Y-m-d\\TH:i");
echo "\" name=\"uyebitis\">\n\t\t ";
if (get_the_author_meta("uyetipi", $user->ID) != "0" && get_the_author_meta("uyebitis", $user->ID)) {
echo "\t\t\t<label>";
echo date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user->ID)));
echo "</label>\n\t\t ";
}
echo " </td>\n </tr>\n </table>\n";
}
function save_uyelik_profile_fields($user_id)
{
if (!current_user_can("edit_user", $user_id)) {
return false;
}
if ($_POST["uyetipi"]) {
update_user_meta($user_id, "uyebitis", $_POST["uyebitis"]);
} else {
delete_user_meta($user_id, "uyetipi");
}
update_user_meta($user_id, "uyetipi", $_POST["uyetipi"]);
}
function uye_bitis_sorgulama()
{
if (!is_admin()) {
return NULL;
}
if (!current_user_can("manage_options")) {
return false;
}
$users = get_users();
foreach ($users as $result) {
$userId = $result->ID;
if ($userId != "") {
$all_meta_for_user = get_user_meta($userId);
if (is_array($all_meta_for_user)) {
foreach ($all_meta_for_user as $key => $value) {
if (strtotime(get_the_author_meta("uyebitis", $userId)) <= strtotime(date("Y-m-d\\TH:i"))) {
delete_user_meta($userId, "uyetipi");
delete_user_meta($userId, "uyebitis");
}
}
}
}
}
}
function one_cikan_bitis()
{
if (!is_admin()) {
return NULL;
}
global $pagenow;
if ($pagenow == "post-new.php" || isset($_GET["action"]) == "edit") {
$post_id = $_GET["post"];
if ($post_id != "") {
$all_meta_for_post = get_post_meta($post_id);
if (is_array($all_meta_for_post)) {
foreach ($all_meta_for_post as $key => $value) {
if ($key == "onecikantime") {
list($sure) = get_post_meta($post_id, "onecikantime");
$suan = date_i18n("Y-m-d\\TH:i");
if (strtotime($sure) <= strtotime($suan)) {
delete_post_meta($post_id, "onecikan");
delete_post_meta($post_id, "onecikantime");
}
}
}
}
}
}
}
function uyelik_gostergesi_ekle($uyelik)
{
$uyelik["uyetipi"] = "yelik";
return $uyelik;
}
function uyelik_gosterge_tablosu($val, $column_name, $user_id)
{
switch ($column_name) {
case "uyetipi":
if (get_the_author_meta("uyetipi", $user_id) == "golduye") {
return "<i style=\"color:#FFD700;\" class=\"icon-star\"></i> Gold (" . date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user_id))) . ")";
}
if (get_the_author_meta("uyetipi", $user_id) == "platinuye") {
return "<i style=\"color:#FFD700;\" class=\"icon-star\"></i> Platin (" . date("d-m-Y H:i", strtotime(get_the_author_meta("uyebitis", $user_id))) . ")";
}
return NULL;
break;
default:
return $val;
}
}
function uye_tipi_sorgula($user_id)
{
$uyelikgenel = cs_get_option("uyelikaktif");
if (!$uyelikgenel) {
$durum = true;
} else {
if ($uyelikgenel && get_the_author_meta("uyetipi", $user_id)) {
$durum = true;
} else {
if ($uyelikgenel && !get_the_author_meta("uyetipi", $user_id)) {
$durum = false;
}
}
}
return $durum;
}
function uye_wpadmin_yonlendirme()
{
if (current_user_can("manage_options")) {
return "";
}
if (strpos($_SERVER["REQUEST_URI"], "wp-admin/profile.php")) {
wp_redirect(home_url("hesabim"));
exit;
}
}
function remove_admin_bar()
{
if (!current_user_can("administrator") && !is_admin()) {
show_admin_bar(false);
}
}
function urlto_dosyaid($resim_url)
{
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $wpdb->posts . " WHERE guid='%s';", $resim_url));
return $attachment[0];
}
function yukleme_izni_verme()
{
$role = "subscriber";
if (!current_user_can($role) || current_user_can("upload_files")) {
return NULL;
}
$subscriber = get_role($role);
$subscriber->add_cap("upload_files");
}
function limit_upload_size($file)
{
$file_size_limit = cs_get_option("imagesize", "500");
if (!current_user_can("manage_options")) {
$current_size = $file["size"];
$current_size = $current_size / cs_get_option("imagesize", "500");
if ($file_size_limit < $current_size) {
$file["error"] = sprintf(__("HATA: Yklediiniz resmin boyutu maximum %d KB olmaldr."), $file_size_limit);
}
}
return $file;
}
function onay_bekleyen_yazilar($menu)
{
$types = ["post", "urunler", "ilanlar", "haberler"];
$status = "pending";
foreach ($types as $type) {
$num_posts = wp_count_posts($type, "readable");
$pending_count = 0;
if (!empty($num_posts->{$status})) {
$pending_count = $num_posts->{$status};
}
if ($type == "post") {
$menu_str = "edit.php";
} else {
$menu_str = "edit.php?post_type=" . $type;
}
foreach ($menu as $menu_key => $menu_data) {
if ($menu_str == $menu_data[2]) {
$menu[$menu_key][0] .= " <span class='update-plugins count-" . $pending_count . "'><span class='plugin-count'>" . number_format_i18n($pending_count) . "</span></span>";
}
}
}
return $menu;
}
function resim_gorme_izni($resimfiltre)
{
global $current_user;
if (is_user_logged_in() && isset($_POST["action"]) && $_POST["action"] == "query-attachments" && !current_user_can("manage_options")) {
$resimfiltre .= " AND post_author=" . $current_user->data->ID;
}
return $resimfiltre;
}
function custom_rewrite_basic()
{
add_rewrite_rule("^hesabim/([a-z\\d_-]+)/?\$", "index.php?sayfa=hesabim&islem=\$matches[1]", "top");
add_rewrite_rule("^hesabim/?", "index.php?sayfa=hesabim", "top");
add_rewrite_rule("^user/([a-z\\d_-]+)/?\$", "index.php?sayfa=user&islem=\$matches[1]", "top");
add_rewrite_rule("^user/?", "index.php?sayfa=user", "top");
}
function prefix_register_query_var($vars)
{
$vars[] = "sayfa";
$vars[] = "islem";
return $vars;
}
function prefix_url_rewrite_templates()
{
if (get_query_var("sayfa") == "hesabim") {
add_filter("template_include", function () {
return get_template_directory() . "/inc/hesabim/index.php";
});
} else {
if (get_query_var("sayfa") == "user") {
add_filter("template_include", function () {
return get_template_directory() . "/inc/user/index.php";
});
}
}
}
function wpgiris_logo_url()
{
return home_url();
}
function wpgiris_logo_url_title()
{
return get_bloginfo("name", "display");
}
function jquery_sil()
{
if (!is_admin()) {
wp_deregister_script("jquery");
wp_register_script("jquery", "", false, "1.6.4");
wp_enqueue_script("jquery");
}
}
function style_tag_sil($tag, $handle)
{
return preg_replace("/type=['\"]text\\/(javascript|css)['\"]/", "", $tag);
}
function TemaVadisi_query_strings1($src)
{
$vargs = explode("?ver", $src);
return $vargs[0];
}
function TemaVadisi_query_strings2($src)
{
$vargs = explode("&ver", $src);
return $vargs[0];
}
function TemaVadisi_query_strings3($src)
{
$vargs = explode("&rev", $src);
return $vargs[0];
}
?>
Function Calls
None |
Stats
MD5 | cc230ad7acd47eedb2129b456c2a3526 |
Eval Count | 0 |
Decode Time | 82 ms |