Viewing file: getlang.php (1.78 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2008 Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.4.18
$HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/getlang.php $
$Revision: 4380 $
$Author: gaugau $
$Date: 2008-04-12 12:00:19 +0200 (Sa, 12 Apr 2008) $
**********************************************/
define('IN_COPPERMINE', true);
define('ADMIN_PHP', true);
define('LANG_DIR', 'lang');
require('include/init.inc.php');
$dir = opendir(LANG_DIR);
$lang_files = array();
while ($file = readdir($dir)) {
if (is_file(LANG_DIR . '/' . $file)) {
$lang_files[] = $file;
}
}
closedir($dir);
asort($lang_files);
if (isset($_GET['get'])) {
$file_index = (int)$_GET['get'];
if ((isset($lang_files[$file_index]))) {
header("Content-type: application/php");
header("Content-Disposition: attachment; filename={$lang_files[$file_index]}");
fpassthru(fopen(LANG_DIR . '/' . $lang_files[$file_index], 'r'));
exit;
}
}
pageheader('Language files');
starttable('100%', 'Language files');
foreach($lang_files as $index => $file) {
echo <<<EOT
<tr>
<td class="tableb">
<img src="images/folder.gif" alt=""> <a href="{$_SERVER['PHP_SELF']}?get=$index">$file</a>
</td>
</tr>
EOT;
}
endtable();
pagefooter();
ob_end_flush();
?>
|