get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = '$galleryID' AND tt.exclude != 1 ORDER BY tt.$ngg_options[galSort] $ngg_options[galSortDir] "); // no images, no output if (!is_array($thepictures)) die; // Create XML output header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("content-type:text/xml;charset=utf-8"); echo ''; echo ''; if (is_array ($thepictures)){ foreach ($thepictures as $picture) { echo ""; echo ''.$picture->filename.''; if (!empty($picture->description)) echo ''.strip_tags(apply_filters('the_title', $picture->description)).''; else if (!empty($picture->alttext)) echo ''.apply_filters('the_title', $picture->alttext).''; else echo ''.$picture->filename.''; echo "\n"; } } echo "\n"; ?>