i just created a new one with $CONFIG['url_mode'] = 'hide';
or does i have to put it anywhere else ?
the get_file.php looks like ( i changed already $results = mysql_query to cpg_mysql_query ... anything else to change ?)
<?php
define('IN_COPPERMINE', true);
define('GETFILE_PHP', true);
global $CONFIG;
include('include/config.inc.php');
$CONFIG['TABLE_CONFIG'] = $CONFIG['TABLE_PREFIX'] . "config";
$CONFIG['TABLE_PICTURES'] = $CONFIG['TABLE_PREFIX'] . "pictures";
db_connect($db);
$results = cpg_mysql_query("SELECT * FROM {$CONFIG['TABLE_CONFIG']}");
while ($row = mysql_fetch_array($results)) {
$CONFIG[$row['name']] = $row['value'];
} // while
mysql_free_result($results);
// Set error logging level
if ($CONFIG['debug_mode']) {
error_reporting (E_ALL);
} else {
error_reporting (E_ALL ^ E_NOTICE);
}
mysql_close();
if (!function_exists('mime_content_type'))
{
function mime_content_type($path) {
$image_params = getimagesize($path);
if (is_null($image_params))
return null;
else
return $image_params['mime'];
}
}
$pic_prefix = array(
'thumb' => $CONFIG['thumb_pfx'],
'normal' => $CONFIG['normal_pfx'],
'fullsize' => '',
);
$pid = (int) $_GET['pid'];
$size = htmlspecialchars($_GET['size']);
db_connect($db);
$result = mysql_query("select filepath,filename from {$CONFIG['TABLE_PREFIX']}pictures where pid=$pid;");
$result = mysql_fetch_assoc($result);
mysql_close();
$cfilepath = $CONFIG['fullpath'].$result['filepath'].$pic_prefix[$size].$result['filename'];
header('Content-type: '.mime_content_type($cfilepath));
$fp = fopen($cfilepath,'rb');
echo fread($fp,filesize($cfilepath));
fclose();
function db_connect(&$db)
{
global $CONFIG;
$db = mysql_connect($CONFIG['dbserver'],$CONFIG['dbuser'],$CONFIG['dbpass']);
mysql_select_db($CONFIG['dbname']);
}
?>