#1
|
||||
|
||||
一米发.com 米表及源碼系統
剛剛利用主机先生 hostsir.com 提供的米表程序把 一米发.com 給重新架站 (原來是導向 mibiao.com 二級域名)
有興趣的朋友可以下載源碼來裝看看 http://bbs.hostsir.com/forum.php?mod...age%3D1&page=1 演示:一米发.com
__________________
|
#2
|
||||
|
||||
如果有下載的朋友,請把以下程式存成 page.class.php 放置於 lib 資料夾下覆蓋
原創者的換頁參數漏了個字碼,所以換頁的類別會跳成不一樣的類別參數 感謝 slob 兄提醒 代碼:
<?php //HostSir.com class show_page { var $total; var $page; var $each_page; var $total_page; var $offset; var $output1; var $output2; var $pagelink=0; function set($total,$each_page,$page,$cid) { $this->total=$total; $this->each_page=$each_page; $this->total_page=ceil($total/$each_page); $this->pagelink=$cid; if(empty($page)) { $this->page=1; $this->offset=0; } else { $this->page=$page; $this->offset=($page-1)*$each_page; } $lastpg=ceil($total/$each_page); $prestart=$page-1; $nextpage=$page+1; //定位首页和上一页 if($page<=1) { $w2=""; } elseif($this->pagelink!=0) { $w2="<a href='?cid=".$this->pagelink."&page=".$prestart."'>上一页</a>"; } else { $w2="<a href='?page=".$prestart."'>上一页</a>"; } //定位尾页和下一页 if($page>=$lastpg) { $w3=""; } elseif($this->pagelink!=0) { $w3="<a href='?cid=".$this->pagelink."&page=".$nextpage."'>下一页</a>"; } else { $w3="<a href='?page=".$nextpage."'>下一页</a>"; } $this->output1=$w2; $this->output2="".$w3." ".$w100." "; } function outputpage() { echo $this->output1; if($this->page>3) { $star=$this->page-3; } else { $star=1; } if($this->page+3>$this->total_page) { $end=$this->total_page; } else { $end=$this->page+3; } //判断页面是否带参数 if($this->pagelink<=0) { for($t=$star;$t<=$end;$t++) { if($this->page==$t) { echo "<span class=current>".$t."</span>"; } else { echo "<a href='?page=".$t."'>".$t."</a>"; } } } else { for($t=$star;$t<=$end;$t++) { if($this->page==$t) { echo "<span class=current>".$t."</span>"; } else { echo "<a href='?cid=".$this->pagelink."&page=".$t."'>".$t."</a>"; } } } echo $this->output2; } } ?>
__________________
|