Great! Buy more memory for shared host or switch to better host.
If you don't want to follow such a nice advice, try this hack:
1. Create file "advanced_get_lang_var.php":
<?php
/**
* advanced_get_lang_var()
*
* A better way to return a variable from the language file
*
* @param string $file Path to lang file.
* @param string $var_name Language variable name
* @return
**/
function advanced_get_lang_var($file, $var_name)
{
static $loaded_files; // static var for loaded lang variables
// Load lang file just once, not for every function call.
if (empty($loaded_files[$file])) {
// read file code
$file_contents = file_get_contents($file);
// find names of all lang vars
if (preg_match_all('/\$(\w+)\s*=/is', $file_contents, $matches)) {
// include lang file to load all the lang vars
include($file);
$loaded_files[$file] = array();
// and store them in static variable
foreach($matches[1] as $match) {
$loaded_files[$file][$match] = $$match;
}
}
}
return $loaded_files[$file][$var_name];
}
?>
2. Put this file into "include" directory.
3. Edit functions.inc.php: find cpg_get_default_lang_var() function and rewrite it a bit. Change
include('lang/'.$language.'.php');
return $$language_var_name;
for
include_once('advanced_get_lang_var.php');
return advanced_get_lang_var('lang/'.$language.'.php', $language_var_name);
That's all.
Don't forget to restore this hack next time when you upgrade you CPG.