Links

$id = $_GET["id"]; $xml = simplexml_load_file("albums.xml"); if($id == "") { print("
\n

Troop Adventures

\n"); foreach ($xml->album as $album) { $code = " \n"; print($code); } } else { foreach($xml->album as $album) { if($album->id == $id) { print("
\n
\n"); if(strlen($album->dates) > 2) { if(strlen($album->title) > 21) { printf("

%s

\n", substr($album->title, 0, 19) . "..."); } else { printf("

%s

\n", $album->title); } } else { if(strlen($album->title) > 31) { printf("

%s

\n", substr($album->title, 0, 29) . "..."); } else { printf("

%s

\n", $album->title); } } printf("

%s

\n", $album->dates); print("
\n
"); if(strlen($album->description) < 550) { printf("

%s

", $album->description); } else { printf("

%s

", substr($album->description, 0, 550) . "..."); printf("

Show More

"); printf("

%s

", $album->description); printf("

Show Less

"); } print("
\n
"); $imgExt = array(".jpg", ".jpeg", ".png", ".gif", ".tiff", ".svg"); $vidExt = array(".flv", ".mpeg"); $image_dir = $album->id . "/"; $imgPerColumn = 10; if($handle = opendir($image_dir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { if(strstr($file,'-thumb')) { $files[] = $file; } } } closedir($handle); } if (count($files)) { foreach($files as $file) { $count = 0; $fileExt = substr($file, strrpos($file, '.')); $count++; if (in_array($fileExt, $imgExt)) { echo ""; } if (in_array($fileExt, $vidExt)) { echo "

Get Flash to see this player.

"; } if(($count != 0) && ($per_column != 0) && ($count % $per_column == 0)) { echo '
'; } } } else { echo '

There are no images in this gallery.

'; } print("
"); } } } ?>