今天写的分页类……分享

由于是上班时候写的,所以如果全部由部贴出来恐怕对不起公司,所以我把其中的表单跳转删去了。别见怪哦。。。 格式写法是比较标准的了 php代码:——————————————————————————– /********** | +————————————————— | class name: pagebar | +————————————————— | author: arvan [e-mail:arvan@5n9.com qq:8817776] | create date: 2003-7-17 | note: | do for pagination | +————————————————— | warning: no… | +————————————————— **********/ class pagebar { var $total; var $onepage; var $num; var $pagecount; var $total_page; var $offset; var $linkhead; function pagebar($total, $onepage, $form_vars=) { $pagecount = $_get[pagecount]; $this->total = $total; $this->onepage = $onepage; $this->total_page = ceil($total/$onepage); if (empty($pagecount)) { $this->pagecount = 1; $this->offset = 0; } else { $this->pagecount = $pagecount; $this->offset = ($pagecount-1)*$onepage; } if (!empty($form_vars)) { $vars = explode(“|”, $form_vars); $chk = $vars[0]; $chk_value = $_post[$chk]; if (empty($chk_value)) { $formlink = “”; } else { for ($i=0; $ilinkhead = $_server[php_self].”?”.$formlink; } else { $this->linkhead = $_server[php_self].”?”.$linkft.$formlink; } } #end function pagebar(); function offset() { return $this->offset; } #end function offset(); function pre_page($char=) { $linkhead = $this->linkhead; $pagecount = $this->pagecount; if (empty($char)) { $char = “[

Posted in 未分类