All pastes #939910 Raw Edit

page select

public php v1 · immutable
·published 2008-03-12 17:35 UTC
rendered paste body
    // Bsp: << 1 2 3 ... 18 19 20 >>   next << 2 3 4 ... 19 20 21 >>    // BLÄTTERFUNKTION    function ListPropage($mod,$set,$ulimit,$filter = 0) {			global $start;			$itemsPerPage = $ulimit;			if(!empty($filter)) {				$tbl_count = px_sql_count(__FILE__,$mod,$mod . "_anzeigen='1'" . $filter);				} else {						$tbl_count = px_sql_count(__FILE__,$mod,$mod . "_anzeigen='1'");					}					$itemCount = $tbl_count;					$pageCount = floor($itemCount / $itemsPerPage);            if(!$start) { $start == 1; }            $currentPage = floor($start / $itemsPerPage);            // SITE LIST CHANGE			$html  = px_html_table(1,'pageselect',0,'100%');            $html .= px_html_roco(1,'listset bold',0,0,'100px');            $html .= Span('Page '. Span($currentPage,'status-3') . ' of ' . $pageCount,'lnk-pages');            $html .= px_html_roco(2,'listset bold',0,0,0,0,'right');			// BACK			if($start > 1) {               $backPage = $start - $itemsPerPage;                  $html .= LnkExtern('?mod='.$mod.'.'.$set.'&start='.$backPage,'&#171;',0,'lnk-pages');            }			// MIDDLE            for($i = 0; $i <= $pageCount; $i++) {				if($currentPage == $i) {						// aktuelle Seite						$html .= LnkExtern('?mod='.$mod.'.'.$set.'&start='.$n,$i,0,'lnk-pagenow');				} else {						// alle anderen Seiten						if($i < 20) {							$html .= LnkExtern('?mod='.$mod.'.'.$set.'&start='.$n,$i,0,'lnk-pages');						}					}			$n += $itemsPerPage;			}			// NEXT            $nextPage = $start + $itemsPerPage;            if($itemCount > $nextPage) {                  $html .= LnkExtern('?mod='.$mod.'.'.$set.'&start='.$nextPage,'&#187;',0,'lnk-pages');            }            $html .= px_html_roco(0);            $html .= px_html_table(0);            return $html;    }