hello every one i was looking for some help in this php code i have php code for gallery flash required file >> data.php to show pic and thumbs and categories can any one help me in the code if there was some thing wrong
<?
include('init.php');
define('LF', chr(10));
print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
print '<data>'.LF;
$show_categories=$_GET[show_categories];
$show_pics=$_GET[show_pics];
$main_page=$_GET[main_page];
//data.php?show_categories=1
if ($show_categories!='') {
// $Open=opendir($gallery_path);
// while ($Files=readdir($Open)) {
$cats = getDirectoryList();
foreach($cats as $Files){
if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
print ' <item title="'.getNameByDir($Files).'" xml_load="data.php?show_pics='.$Files.'"></item>'.LF;
};
};
};
//data.php?show_pics=peoples
if ($show_pics!='') {
// $Open=opendir($gallery_path."/".$show_pics."/thumbs");
$Open=file($gallery_path."/".$show_pics."/settings.dat");
foreach($Open as $Files) {
// while ($Files=readdir($Open)) {
$out = array();
preg_match('/\S+\.(\S+)$/', $Files, $out);
if ($out[1]==="jpg")
print ' <pic thumb="'.$gallery_path."/".$show_pics."/thumbs/".$Files.'" img="'.$gallery_path."/".$show_pics."/pix/".$Files.'"></pic>'.LF;
};
};
//data.php?main_page=1
if ($main_page!='') {
//$Open=opendir($gallery_path);
$cats = getDirectoryList();
// while ($Files=readdir($Open)) {
foreach($cats as $Files){
//read category settings
$FileName="$gallery_path/$Files/settings.dat";
if (is_file($FileName)) {
$File=fopen($FileName,'r');
if (filesize($FileName)>0) {
$category_settings = file($FileName);
$category_settings=$category_settings[0];
};
fclose($File);
};
if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
print ' <item title="'.getNameByDir($Files).'" pic="'.$gallery_path.'/'.$Files.'/pix/'.$category_settings.'"></item>'.LF;
};
};
};
print '</data>'.LF;
?>
and i need the out put at data.php?main_page=1 like that
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
<item title="unlimited category" pic="photo_gallery/1295711835.63/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
<item title="unlimited category 1" pic="photo_gallery/1295711839.56/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
<item title="unlimited category 2" pic="photo_gallery/1295711843.82/pix/13.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
</data>
and in data.php?show_categories=1
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
<item title="unlimited category" xml_load="data.php?show_pics=1295711835.63"></item>
<item title="unlimited category 1" xml_load="data.php?show_pics=1295711839.56"></item>
<item title="unlimited category 2" xml_load="data.php?show_pics=1295711843.82"></item>
</data>
and in data.php?show_pic=
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
<pic thumb="photo_gallery/1295711835.63/thumbs/8.jpg" img="photo_gallery/1295711835.63/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/4.jpg" img="photo_gallery/1295711835.63/pix/4.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/6.jpg" img="photo_gallery/1295711835.63/pix/6.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/2.jpg" img="photo_gallery/1295711835.63/pix/2.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/1.jpg" img="photo_gallery/1295711835.63/pix/1.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/5.jpg" img="photo_gallery/1295711835.63/pix/5.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
<pic thumb="photo_gallery/1295711835.63/thumbs/9.jpg" img="photo_gallery/1295711835.63/pix/9.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
</data>