| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/baberankings.com.bak/members/modules/languages/admin/ |
Upload File : |
<?
//clear ouput buffer
ob_clean();
//get exportable language info
$res = sql_query("SELECT * FROM $langtable WHERE l_id=$en[id]");
$src = sql_fetch_assoc($res);
//send download headers
header("Content-Type: application/zip");
header('Content-Disposition: attachment; filename="' . basename($src['l_file'],fileext($src['l_file'])).'zip' . '"');
//get all language files
$cd = getcwd(); chdir('..'); $sects = get_language_files();
//get language definition section names
$defs = array();
foreach ($sects['english.lng'] as $value) {
$d = read_language_file($value);
$loc = explode('/',$value);
$s = ($value == 'languages/english.lng' ? 'languages/'.$src['l_file'] : 'modules/'.$loc[1].'/'.$src['l_file']);
foreach ($d as $key => $value)
$defs[$key] = array($s,$value);
}
unset($defs['']);
//prepare sections
$d = unserialize($src['l_defs']);
foreach ($d as $key => $value)
$out[$defs[$key][0]][$key] = $value;
//create ZIP archive
require_once('kernel/external/pclzip.lib.php');
$d = uniqid('lang');
$archive = new PclZip('temp/'.$d.'.zip');
//add files to archive
mkdir('temp/'.$d);
$file = 'temp/'.$d.'/'.$src['l_file'];
unset($out['']);
foreach ($out as $f => $data) {
$ff = fopen($file,'w');
foreach ($data as $key => $value)
if ($value != '') {
fwrite($ff,$key.'='.$value."\n");
}
fclose($ff);
$archive->add($file,
PCLZIP_OPT_ADD_PATH, dirname($f),
PCLZIP_OPT_REMOVE_PATH, 'temp/'.$d);
}
unlink($file);
rmdir('temp/'.$d);
//output file
readfile('temp/'.$d.'.zip');
unlink('temp/'.$d.'.zip');
//stop execution
chdir($cd);
exit;
?>