get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER BY tt.$ngg_options[galSort] $ngg_options[galSortDir] "); } else { $thepictures = $wpdb->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 "\n"; echo "\n"; if (is_array ($thepictures)){ foreach ($thepictures as $picture) { echo ''; if (!empty($picture->alttext)) echo ''.strip_tags(apply_filters('the_title', $picture->alttext)).''; else echo ''.$picture->filename.''; echo 'description).']]>'; echo "\n"; } } echo "\n"; echo "\n"; ?>