Location: PHPKode > projects > pkZoos Website > includes/lang.php
<?php
	if(!defined('PK_MAGIC'))
		die('hack or what?');





	/* */

	$lang = array();
	$l = array();





	/* */

	function lang_load()
	{
		global $db;
		global $config;
		global $lang;
		global $l;
		global $tpl;

        $q = "
            SELECT
            	lang_name,
            	lang_dir,
            	lang_charset,
            	lang_author
            FROM " . LANGS_TABLE . "
            WHERE lang_id = " . $config['lang_id'] . "
        ";

        $lang_res = $db->query($q);

        if($lang_row = $db->fetch_row($lang_res))
        {
            if(!@include($config['script_path'] . 'langs/' . $lang_row['lang_dir'] . '/lang.php'))
            {
            	die('cannot load lang.');
            }
        }

        $lang['name'] = $lang_row['lang_name'];
        $lang['dir'] = $lang_row['lang_dir'];
        $lang['charset'] = $lang_row['lang_charset'];
        $lang['author'] = $lang_row['lang_author'];

        $config['lang_path'] = $config['script_path'] . 'langs/' . $lang['dir'] . '/';
        $config['mail_path'] = $config['script_path'] . 'langs/' . $lang['dir'] . '/mails/';

        foreach($l as $key => $val)
        {
			$tpl->add_var('L_' . strtoupper($key), $val);
        }
    }
?>
Return current item: pkZoos Website