$limit = $_GET['limit']; if ($limit <= 0 || $limit > $last + 1) { $limit = $last + 1; } } else { $limit = $last + 1; } $end = $last - $limit; // Obtain the strips $list = array(); for ($i = $last; $i > $end; $i--) { $list[$i] = Cache::getStrip($i); } // Obtain the language if (isset($_GET['lang'])) { $lang = $_GET['lang']; } else { $lang = Config::getLanguage(); } $lang = getLang($lang); // Navigation $nav_img = Config::getUrl() . '/' . Config::getIndex() . '?id='; // If necessary, obtain the forum data $wotd = ''; if (Config::getUseFluxbb() === true) { $wotd = Forum::getWotdRss($lang); } // show the template header('Content-Type: application/rss+xml'); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; include_once Config::getTemplateFolder() . '/' . Config::getTemplateRss() . '/template.rss';
/** * Return an array with all navigation link * * @param integer $page The actual page number of the gallery * @param integer $last_page The last page of the gallery * @param integer $limit The number of strip in one page * @param Lang $lang The Lang object use for the actual user * @return array An array with the navigation link : array(first, last, previous, next) */ function getNavigationGallery($page, $last_page, $limit, Lang $lang) { $url = Config::getUrl() . '/' . Config::getGallery() . '?limit=' . $limit . '&page='; $nav_lang = ''; if (isset($_GET['lang'])) { $nav_lang = '&lang=' . $lang; } $return[0] = $url . '0' . $nav_lang; $return[1] = $url . $last_page . $nav_lang; if ($page != 0) { $return[2] = $url . ($page - 1) . $nav_lang; } else { $return[2] = $url . '0' . $nav_lang; } if ($page != $last_page) { $return[3] = $url . ($page + 1) . $nav_lang; } else { $return[3] = $url . $last_page . $nav_lang; } return $return; }
} // Obtain the list of strip $begin = $page * $limit; $end = $begin + $limit; if ($end > $last + 1) { $end = $last + 1; } for ($i = $begin; $i < $end; $i++) { $list[$i] = Cache::getStrip($i); } // Obtain the language if (isset($_GET['lang'])) { $lang = $_GET['lang']; } else { $lang = Config::getLanguage(); } $lang = getLang($lang); // Obtain the navigation list($nav_first, $nav_last, $nav_prev, $nav_next) = getNavigationGallery($page, $last_page, $limit, $lang); $nav_lang = ''; if (isset($_GET['lang'])) { $nav_lang = 'lang=' . $lang . '&'; } $nav_img = Config::getUrl() . '/' . Config::getIndex() . '?' . $nav_lang . 'id='; // If necessary, obtain the forum data $wotd = ''; if (Config::getUseFluxbb() === true) { $wotd = Forum::getWotd($lang); } // show the template include_once Config::getTemplateFolder() . '/' . Config::getTemplateName() . '/gallery.html';