<?PHP
/*
=====================================================
 DataLife Engine v10.0 - by DLE Farsi Group 
-----------------------------------------------------
 http://datalifeengine.ir/
-----------------------------------------------------
 Copyright (c) 2006,2013 DLE Farsi Group
=====================================================
*/

if( ! defined( 'DATALIFEENGINE' ) ) {
	die( "Hacking attempt!" );
}

require_once ENGINE_DIR . "/modules/functions.jdate.php";

function fatotranslit($var, $lower, $punkt) {
	if ( is_array($var) ) return "";
	
	$var = trim( strip_tags( $var ) );

	$var = str_replace( array( " ", ".", "\"", "'", ">", "<", ":" ), "-", $var );

	$var = str_ireplace( ".php", "", $var );
	$var = str_ireplace( ".php", ".ppp", $var );
	
	if( strlen( $var ) > 200 ) {
		
		$var = substr( $var, 0, 200 );
		
		if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
	
	}
	
	return $var;
}

function dle_die($error, $title = "خطای سیستم"){
	global $config, $lang;
	
	echo <<<HTML
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title} &raquo; {$lang['dle_title']}</title>
<link rel="stylesheet" type="text/css" href="{$config['http_home_url']}engine/skins/rtl.css" />
</head>
<body id="body">
{$error}
</body>
</html>
HTML;
	exit;
}

?>