Naturfilm - Tierfilm - Hinz

Naturfilme für das Deutsche Fernsehen

Mehrfach ausgezeichnete Dokumentationen - 1981 bis heute


Besucher
260988
offset = 'offset'; $db->number_type = 'number' (or 'alpha') $db->limit = 10; $db->execute("SELECT * from murphy ORDER by id ASC"); while($myrow = mysql_fetch_array($db->sql_result)) { print $myrow["your_column"]; } // ------------------------------- // CREATE A VAR WITH THE NAV LINKS // ------------------------------- $pages = $db->show_num_pages('«','« prev','»','next »','|','class=moi'); // show pages // OUTPUT THE NAV print $pages; // ------------------------------- // RESULTS INFORMATION // ------------------------------- $info = $db->show_info(); print $info; ?> */ // -------------------------------------------------------------- class buildNav // [Class : Controls all Functions for Prev/Next Nav Generation] { var $limit, $execute, $query; function execute($query) // [Function : mySQL Query Execution] { !isset($_GET[$this->offset]) ? $GLOBALS[$this->offset] = 0 : $GLOBALS[$this->offset] = $_GET[$this->offset]; $this->sql_result = mysql_query($query); //$this->total_result = mysql_num_rows($this->sql_result); $this->total_result = @mysql_num_rows($this->sql_result); if(isset($this->limit)) { $query .= " LIMIT " . $GLOBALS[$this->offset] . ", $this->limit"; $this->sql_result = mysql_query($query); $this->num_pages = ceil($this->total_result/$this->limit); } } function show_num_pages($frew = '', $rew = '', $ffwd = '', $fwd = '', $separator = '|', $objClass = '') // [Function : Generates Prev/Next Links] { $current_pg = $GLOBALS[$this->offset]/$this->limit+1; if ($current_pg > 5) { $fgp = $current_pg - 5 > 0 ? $current_pg - 5 : 1; $egp = $current_pg+4; if ($egp > $this->num_pages) { $egp = $this->num_pages; $fgp = $this->num_pages - 9 > 0 ? $this->num_pages - 9 : 1; } } else { $fgp = 1; $egp = $this->num_pages >= 10 ? 10 : $this->num_pages; } if($this->num_pages > 1) { // searching for http_get_vars // foreach ($GLOBALS[HTTP_GET_VARS] as $_get_name => $_get_value) { foreach ($GLOBALS[_GET] as $_get_name => $_get_value) { if ($_get_name != $this->offset) { $this->_get_vars .= "&$_get_name=$_get_value"; } } $this->successivo = $GLOBALS[$this->offset] + $this->limit; $this->precedente = $GLOBALS[$this->offset] - $this->limit; $this->theClass = $objClass; if (!empty($rew)) { $return .= ($GLOBALS[$this->offset] > 0) ? "[offset=0$this->_get_vars\" $this->theClass>$frew] offset=$this->precedente$this->_get_vars\" $this->theClass>$rew $separator " : "[$frew] $rew $separator "; } // showing pages if ($this->show_pages_number || !isset($this->show_pages_number)) { for($this->a = $fgp; $this->a <= $egp; $this->a++) { $this->theNext = ($this->a-1)*$this->limit; $_ss_k = floor($this->theNext/26); if ($this->theNext != $GLOBALS[$this->offset]) { $return .= " offset=$this->theNext$this->_get_vars\" $this->theClass> $separator "; //$return .= " offset=$this->theNext$this->_get_vars\" $this->theClass> "; if ($this->number_type == 'alpha') { if($_ss_k>0) { $theLink = chr(64 + ($_ss_k)); for($b = 0; $b < $_ss_k; $b++) { $theLink .= chr(64 + ($this->theNext%26)+1); } $return .= $theLink; } else { $return .= chr(64 + ($this->a)); } } else { $return .= $this->a; } $return .= " "; // dies ist das ende vom link und das leerzeichen links neben der aktuellen page //$return .= " $separator"; } else { if ($this->number_type == 'alpha') { if($_ss_k>0) { $theLink = chr(64 + ($_ss_k)); for($b = 0; $b < $_ss_k; $b++) { $theLink .= chr(64 + ($this->theNext%26)+1); } $return .= $theLink; } else { $return .= chr(64 + ($this->a)); } } else { $return .= $this->a; } //$return .= ($this->a < $this->num_pages) ? " $separator " : " "; $return .= ($this->a < $this->num_pages) ? " " : " "; } } $this->theNext = $GLOBALS[$this->offset] + $this->limit; if (!empty($fwd)) { $offset_end = ($this->num_pages-1)*$this->limit; $return .= ($GLOBALS[$this->offset] + $this->limit < $this->total_result) ? "$separator offset=$this->successivo$this->_get_vars\" $this->theClass>$fwd [offset=$offset_end$this->_get_vars\" $this->theClass>$ffwd]" : "$separator $fwd [$ffwd]"; } } } return $return; } function show_info() // [Function : Showing the Information for the Offset] { if($GLOBALS[$this->offset] >= $this->total_result || $GLOBALS[$this->offset] < 0) return false; //$return .= $this->total_result . " Total Results
"; $_from = $GLOBALS[$this->offset] + 1; $GLOBALS[$this->offset] + $this->limit >= $this->total_result ? $_to = $this->total_result : $_to = $GLOBALS[$this->offset] + $this->limit; //$return .= "Eintrag " . $_from . " bis " . $_to . " von "; $return .= $this->total_result . " Einträge gefunden"; return $return; } } ?>