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']} "); } // Create XML output header("content-type:text/xml;charset=utf-8"); echo "\n"; echo " ".stripslashes(nggGallery::i18n($thepictures[0]->name))."\n"; echo " \n"; if (is_array ($thepictures)){ foreach ($thepictures as $picture) { echo " \n"; if (!empty($picture->description)) echo " ".strip_tags(stripslashes(html_entity_decode(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description'))))."\n"; else if (!empty($picture->alttext)) echo " ".stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext'))."\n"; else echo " ".$picture->filename."\n"; echo " ".$siteurl."/".$picture->path."/".$picture->filename."\n"; echo " \n"; } } echo " \n"; echo "\n"; ?>