} $boardid = 0; $boardlink = ""; $offset = 0; $offsetback = 0; $offsetfwd = 0; $count = 0; // We just append this to the end of all the SQL queries/links. Makes things simpler because we only have to do it once. if ($board_folder != "" && $db->getboardnumber($board_folder)) { $boardid = $db->getboardnumber($board_folder); $boardlink = "&board=" . $board_folder; } else { $board_folder = ""; // Clear $board if the getboardnumber call failed } $count = $db->getpicscount($boardid); if (isset($_GET['offset'])) { $offset = intval($_GET['offset']); if ($offset < 0) { $offset = 0; } } $beginning = $count - 40 - $offset; if ($beginning < 0) { $beginning = 0; } //Beginning should never be greater than $count, for the reason that $offset is always >= 0 // Get the images $imgs = array(); $imgs = $db->getpics($offset, $boardid); // Get the boards array, to show a list for filtering