Элементарно:
ты просто модульделай без функций т.е. он запускается по вызову и ему уже ничего передавать не надо разве глобализацию тебе придётся сделать
у меня так сделано вот сурс:
function print_type($name,$path,$comment)
{
print \'
\';
}
if(!$path && !$img)
{
$handle = opendir(\'raboty\');
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$file1="raboty/$file";
$infofile="$file1"."/"."info.txt";
if(is_dir($file1) && file_exists("$infofile"))
{
$infodata=file("$infofile");
$name=rtrim($infodata[0]);
$path=$file;
$comment=$infodata[1];
print_type($name,$path,$comment);
}
}
}
$path=null;
}
if($path && !$img)
{
if(!$page){$page=1;}
$file_img="raboty/"."$path"."/"."$page".".jpg";
$file_plan="raboty/"."$path"."/"."$page"."_1".".jpg";
$file_info="raboty/"."$path"."/"."$page".".txt";
if(file_exists($file_img)){print "
";}
if(file_exists($file_plan)){print "
";}
if(!file_exists($file_img)){print "
Фотография отсуствует";}
if(file_exists($file_info)){readfile($file_info);}
$count=1;
$img_file="raboty/"."$path"."/"."1.jpg";
print "
";
while(file_exists($img_file))
{
if($count==$page){print "";}
print "$count";
if($count==$page){print "";}
print " ";
++$count;$img_file="raboty/"."$path"."/"."$count".".jpg";
}
}
// СДЕЛАТЬ ПРОТОКОЛИРОВАНИЕ НА КРИВЫЕ КАРТИНКИ
if($img && $pic && $type)
{
$file="raboty/".$img."/".$pic.".jpg";
$src_img=imagecreatefromjpeg($file);
if($type=="mini"){
$w=250;
$h=intval(imagesy($src_img)/(imagesx($src_img)/250));
}
if($type=="full"){$w=imagesx($src_img);$h=imagesy($src_img);}
header("Content-type: image/jpeg");
$im=ImageCreate($w,$h);
ImageCopyResized($im,$src_img,0,0,0,0,$w,$h,ImageSX($src_img),ImageSY($src_img));
imagejpeg($im);
}
?>
Вызываётся он инклудом из главного файла index.php сам он jobs.php