parent(); $item_count = -1; // Array indexes are 0-based, jCarousel positions are 1-based. $first = max(0, intval($_GET['first']) - 1); $last = max($first + 1, intval($_GET['last']) - 1); $length = $last - $first + 1; // Build the array with the thumbnail URLs foreach ($parent->viewable()->children() as $photo) { if (!$photo->is_album()) { $item_count++; $itemlist[$item_count] = $photo->thumb_url(); } } $total = count($itemlist); $selected = array_slice($itemlist, $first, $length); // --- header('Content-Type: text/xml'); echo ''; // Return total number of images so the callback // can set the size of the carousel. echo ' ' . $total . ''; foreach ($selected as $img) { echo ' ' . $img . ''; } echo ''; } }