<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

function ad($obj)
{
	echo '<pre>';
	print_r($obj);
	echo '</pre>';
}


function admin()
{
    $CI = &get_instance();

	if(isset($CI->muser->user['admin']) && $CI->muser->user['admin']===true)
	{
		return true;
	}

	return false;
}

function temp()
{
	$CI = &get_instance();

	if(isset($CI->muser->user['temp']) && $CI->muser->user['temp']===true)
	{
		return true;
	}

	return false;
}

function interior()
{
	$CI = &get_instance();
	
	if($CI->uri->segment(1)=='page' && $CI->uri->segment(2)=='show' && is_numeric($CI->uri->segment(3)))
	{
		$type = 'pages';
		$pages = array("455", "456", "457", "458", "459", "460", "461");
		$page_id = $CI->uri->segment(3);
		
		if( isset($_SERVER['HTTP_REFERER']) )
			$elozo = $_SERVER['HTTP_REFERER'];
		else
			$elozo = "";
		if( stristr($elozo,"interior") && $page_id == 436){
			return true;
		}
		else if( in_array($page_id, $pages) ){
			return true;
		}
	}
	/*if($CI->uri->segment(1)=='page' && $CI->uri->segment(2)=='show' && is_numeric($CI->uri->segment(3)))
	{
		$type = 'pages';
		$page_id = $CI->uri->segment(3);
		
		
	}*/
	elseif($CI->uri->segment(1)=='news' && $CI->uri->segment(2)=='show' && is_numeric($CI->uri->segment(3)))
	{
    	$type = 'news';
		$page_id = $CI->uri->segment(3);
	}
	else
	{
		$page_id = false;
	}

	if($CI->uri->segment(1)=='interior' || $CI->uri->segment(1)=='support_interior' || ($page_id!=false && $CI->mpages->bool_pageInterior($page_id, $type)===true))
	{
		return true;
	}

	return false;
}

function langCheck($lang)
{
	$CI = &get_instance();
	
	if($CI->muser->user['lang']==$lang)
	{
		return true;
	}
	
	return false;
}

function hun()
{
// 	if( $_SERVER['HTTP_HOST']=='archline.hu' || $_SERVER['HTTP_HOST']=='www.archline.hu' || $_SERVER['HTTP_HOST']=='cadline.hu' || $_SERVER['HTTP_HOST']=='www.cadline.hu' ){
// 		return true;
// 	}
	return langCheck('hun');
}

function eng()
{
// 	if( $_SERVER['HTTP_HOST']=='archlinexp.com' || $_SERVER['HTTP_HOST']=='www.archlinexp.com' ){
// 		return true;
// 	}
	
	return langCheck('eng');
}

function jap()
{
	return langCheck('jap');
}
function gr()
{
	return langCheck('gr');
}
function cr()
{
	return langCheck('cr');
}
function be()
{
	return langCheck('be');
}
function pol()
{
	return langCheck('pol');
}
function esp(){
	return langCheck('esp');
}

function ita(){
	return langCheck('ita');
}

function ger(){
	return langCheck('ger');
}

function de(){
	return langCheck('ger');
}



?>