0 ? $page : 4 ; } else { $dot = '...'; } $multipage = ''; if($jsfunc === FALSE) { $mpurl .= strpos($mpurl, '?') !== FALSE ? '&' : '?'; } $realpages = 1; $_G['page_next'] = 0; $page -= strlen($curpage) - 1; if($page <= 0) { $page = 1; } if($num > $perpage) { $offset = floor($page * 0.5); $realpages = @ceil($num / $perpage); $curpage = $curpage > $realpages ? $realpages : $curpage; $pages = $maxpages && $maxpages < $realpages ? $maxpages : $realpages; if($page > $pages) { $from = 1; $to = $pages; } else { $from = $curpage - $offset; $to = $from + $page - 1; if($from < 1) { $to = $curpage + 1 - $from; $from = 1; if($to - $from < $page) { $to = $page; } } elseif($to > $pages) { $from = $pages - $page + 1; $to = $pages; } } $_G['page_next'] = $to; $multipage = ($curpage - $offset > 1 && $pages > $page ? '1 '.$dot.'' : ''). ($curpage > 1 && !$simple ? ''.$lang['prev'].'' : ''); for($i = $from; $i <= $to; $i++) { $multipage .= $i == $curpage ? ''.$i.'' : ''.$i.''; } $wml = defined('IN_MOBILE') && IN_MOBILE == 3; $jsurl = ''; if(($showpagejump || $showkbd) && !$simple && !$ajaxtarget && !$wml) { $jsurl = $mpurl.(strpos($mpurl, '{page}') !== false ? '\'.replace(\'{page}\', this.value == 1 ? \'\' : this.value)': $pagevar.'\'+this.value;').'; doane(event);'; } $multipage .= ($to < $pages ? ''.$dot.' '.$realpages.'' : ''). ($showpagejump && !$simple && !$ajaxtarget && !$wml ? '' : ''). ($curpage < $pages && !$simple ? ''.$lang['next'].'' : ''). ($showkbd && !$simple && $pages > $page && !$ajaxtarget && !$wml ? '' : ''); $multipage = $multipage ? '