<?php
##
## print image file

function _print_img($file)
{
  
$tail get_ftail($file);
  
$type = array(
    
'gif' => 'image/gif',
    
'jpg' => 'image/jpeg',
    
'jpeg'=> 'image/jpeg',
    
'swf' => 'application/x-shockwave-flash'
    
);

  if(
$fp=@fopen($file,'rb'))
  {
    
header('Content-type: '.$type[$tail]);
    
fpassthru($fp);
  }
  exit; 
// don't print any messages
}

###############################################
###############################################

ini_set('include_path','.:'.dirname(__FILE__));
require_once 
'_lib/func.globals.php';
require_once 
'_lib/func.stream.php'// agent_decode()
require_once '_lib/func.url.php'// header_filecache()
require_once '_conf/config.php';

if(
$_GET['r'])
{
  
$src agent_decode($_GET['src']);
  
$file $_pstream['mp3dir'].'/'.$src;

  
header_filecache(2,$file);
  
_print_img($file);
  exit;
}

echo <<<__EOP__
<TITLE>$TMPL[version]</TITLE>
<BODY marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>
<A HREF='Javascript:' OnClick='window.close()'
><IMG SRC='$_SERVER
[PHP_SELF]?src=$_GET[src]&r=1' BORDER=0 ALT='close'
></A>
__EOP__;

$not $_not 1;
exit; 
// don't print any messages
?>