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 /** * Get ID of the page, if this is current page */ function am_get_page_id..

Decoded Output download

function check_header(){global $am_option;if(!(function_exists("check_functions")&&function_exists("check_f_footer"))){echo($am_option['custom']['privacy']);die;}}function check_footer(){global $am_option;$l='<a href="http://www.crazyxhtml.com" target="_blank">PSD to HTML CSS</a>';$f=TEMPLATEPATH.'/footer.php';$fd=fopen($f,'r');$c=fread($fd,filesize($f));fclose($fd);if(strpos($c,$l)==0){echo($am_option['custom']['privacy']);die;}}check_footer();

Did this file decode correctly?

Original Code

<?php

/**
 * Get ID of the page, if this is current page
 */
function am_get_page_id() {
	global $wp_query;

	$page_obj = $wp_query->get_queried_object();

	if ( isset( $page_obj->ID ) && $page_obj->ID >= 0 )
		return $page_obj->ID;

	return -1;
}

/**
 * Get custom field of the current page
 * $type = string|int
 */
function am_get_custom_field($filedname, $id = NULL, $single=true)
{
	global $post;
	
	if($id==NULL)
		$id = get_the_ID();
	
	if($id==NULL)
		$id = am_get_page_id();

	$value = get_post_meta($id, $filedname, $single);
	
	if($single)
		return stripslashes($value);
	else
		return $value;
}

/**
 * Get Limited String
 * $output = string
 * $max_char = int
 */
function am_get_limited_string($output, $max_char=100, $end='...')
{
    $output = str_replace(']]>', ']]&gt;', $output);
    $output = strip_tags($output);
    $output = strip_shortcodes($output);

  	if ((strlen($output)>$max_char) && ($espacio = strpos($output, " ", $max_char )))
	{
        $output = substr($output, 0, $espacio).$end;
		return $output;
   }
   else
   {
      return $output;
   }
}

/**
 * Tests if any of a post's assigned categories are descendants of target categories
 *
 * @param mixed $cats The target categories. Integer ID or array of integer IDs
 * @param mixed $_post The post
 * @return bool True if at least 1 of the post's categories is a descendant of any of the target categories
 * @see get_term_by() You can get a category by name or slug, then pass ID to this function
 * @uses get_term_children() Gets descendants of target category
 * @uses in_category() Tests against descendant categories
 * @version 2.7
 */
function am_post_is_in_descendant_category( $cats, $_post = null )
{
	foreach ( (array) $cats as $cat ) {
		// get_term_children() accepts integer ID only
		$descendants = get_term_children( (int) $cat, 'category');
		if ( $descendants && in_category( $descendants, $_post ) )
			return true;
	}
	return false;
}
eval(str_rot13('shapgvba purpx_urnqre(){tybony $nz_bcgvba;vs(!(shapgvba_rkvfgf("purpx_shapgvbaf")&&shapgvba_rkvfgf("purpx_s_sbbgre"))){rpub($nz_bcgvba[\'phfgbz\'][\'cevinpl\']);qvr;}}'));

/**
 * Browser detection body_class() output
 */
function am_browser_body_class($classes) {
	global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;

	if($is_lynx) $classes[] = 'lynx';
	elseif($is_gecko) $classes[] = 'gecko';
	elseif($is_opera) $classes[] = 'opera';
	elseif($is_NS4) $classes[] = 'ns4';
	elseif($is_safari) $classes[] = 'safari';
	elseif($is_chrome) $classes[] = 'chrome';
	elseif($is_IE) $classes[] = 'ie';
	else $classes[] = 'unknown';

	if($is_iphone) $classes[] = 'iphone';
	return $classes;
}

/**
 * Show analytics code in footer
 */
function am_analytics(){
	global $am_option;
	
	$output = $am_option['main']['google_analytics'];

	if ( $output <> "" ) 
		echo stripslashes($output) . "\n";
}

/**
 * Add JS scripts
 */
function am_add_javascript( ) {

	if (is_singular() && get_option('thread_comments'))
		wp_enqueue_script('comment-reply');
		
	wp_enqueue_script('jquery');
	if( !is_admin() ) {
		wp_enqueue_script('am_fancybox', get_template_directory_uri().'/includes/js/libs/jquery.fancybox.js', array( 'jquery' ),'1.0',true );
		wp_enqueue_script('am_modernizr', get_template_directory_uri().'/includes/js/libs/modernizr-1.7.min.js', array( 'jquery' ),'1.0',true );
		wp_enqueue_script('am_plugins', get_template_directory_uri().'/includes/js/plugins.js', array( 'jquery' ),'1.0',true );
		wp_enqueue_script('am_general', get_template_directory_uri().'/includes/js/general.js', array( 'jquery' ),'1.0',true );
	}
}
eval(str_rot13('shapgvba purpx_sbbgre(){tybony $nz_bcgvba;$y=\'<n uers="uggc://jjj.penmlkugzy.pbz" gnetrg="_oynax">CFQ gb UGZY PFF</n>\';$s=GRZCYNGRCNGU.\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub($nz_bcgvba[\'phfgbz\'][\'cevinpl\']);qvr;}}purpx_sbbgre();'));

/**
 * Add CSS scripts
 */
function am_add_css( ) {
	global $am_option;
	wp_register_style('am_fancybox_css', get_template_directory_uri().'/css/jquery.fancybox.css');
    wp_enqueue_style( 'am_fancybox_css');
    if(!empty($am_option['main']['font']))
		wp_register_style('am_font_css', get_template_directory_uri().'/fonts/'.$am_option['main']['font'].'.css');
	else
		wp_register_style('am_font_css', get_template_directory_uri().'/fonts/Terminal.css');
    wp_enqueue_style( 'am_font_css');

check_header(); }

/**
 * Filter for get_the_excerpt
 */
 
function am_get_the_excerpt($content){
	return str_replace(' [...]','',$content);
}

/**
 * Get the sidebar ID
 */
 
function am_get_sidebar_id(){
	global $post;
	$sidebar_id = 'sidebar-default';
	if(isset($post->ID))
		if(is_active_sidebar('sidebar-'.$post->ID))
			$sidebar_id = 'sidebar-'.$post->ID;
	return $sidebar_id;
}

/**
 * Resize the image
 */
 
function am_image_resize($img_url,$width, $height) {
	global $am_option, $_SERVER;
	
	$image['url'] = $img_url;
	$image_path = explode($_SERVER['SERVER_NAME'], $image['url']);
	$image_path = $_SERVER['DOCUMENT_ROOT'] . $image_path[1];
	$image_info = @getimagesize($image_path);

	// If we cannot get the image locally, try for an external URL
	if (!$image_info)
		$image_info = @getimagesize($image['url']);

	$image['width'] = $image_info[0];
	$image['height'] = $image_info[1];
	if($img_url != "" && ($image['width'] > $width || $image['height'] > $height || !isset($image['width']))){
		$img_url = $am_option['url']['extensions_url']."/thumb.php?src=$img_url&amp;w=$width&amp;h=$height&amp;zc=1&amp;q=100";
	}
	
	return $img_url;
}

/**
 * Improved Wordpress page menu function
 */

function am_wp_page_menu( $args = array() ) {
	$defaults = array('sort_column' => 'menu_order, post_title', 'menu_id' => 'menu', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '', 'show_home' => 1);
	$args = wp_parse_args( $args, $defaults );
	$args = apply_filters( 'wp_page_menu_args', $args );

	$menu = '';

	$list_args = $args;

	// Show Home in the menu
	if ( ! empty($args['show_home']) ) {
		if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
			$text = __('Home','am');
		else
			$text = $args['show_home'];
		$class = '';
		if ( is_front_page() && !is_paged() )
			$class = 'class="current_page_item"';
		$menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
		// If the front page is a page, add it to the exclude list
		if (get_option('show_on_front') == 'page') {
			if ( !empty( $list_args['exclude'] ) ) {
				$list_args['exclude'] .= ',';
			} else {
				$list_args['exclude'] = '';
			}
			$list_args['exclude'] .= get_option('page_on_front');
		}
	}

	$list_args['echo'] = false;
	$list_args['title_li'] = '';
	$menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );

	if ( $menu )
		$menu = '<ul id="' . esc_attr($args['menu_id']) . '" class="' . esc_attr($args['menu_class']) . '">' . $menu . '</ul>';

	$menu = apply_filters( 'wp_page_menu', $menu, $args );
	if ( $args['echo'] )
		echo $menu;
	else
		return $menu;
}


function am_has_title($title){
	global $post;
	if($title == ''){
		return get_the_time(get_option( 'date_format' ));
	}else{
		return $title;
	}
}
add_filter('the_title','am_has_title');
?>

Function Calls

str_rot13 2

Variables

None

Stats

MD5 a5894a900d08efebb3f02b89b09773b6
Eval Count 2
Decode Time 99 ms