All pastes #425377 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-05 13:26 UTC
rendered paste body
<?

function inc_language()
{
	global $user; 				 // Making the users (if logged in) language setting
	global $p;					 // and current loading page available by the script.
	
	// Defining all the supported languages.
	$lang[0] = 'se';
	$lang[1] = 'en';
	$lang[3] = 'de';
	
	$this_lang = $user['lang'];
	
	if($lang[$this_lang] == '')
	{
		$this_lang = 0; 		 // Setting standard language to 0.
								 // Gets overrided by the users saved language.
	}
	
	if(include('./lang/'.$lang[$this_lang].'/'.$p.'_lang.php')) 
	{							 // Returns true or false wether it can include the
		return true;			 // language file or not.
	}
	else
	{
		return false;
	}
}

?>