不是偶滴,偶搜了一下发现本论坛搜不出来,OLD FD的也没了,就发一份在这里哇!
偶刚在2.5SP1下用了,很好用。
演示:
http://www.haseebbs.com/forumdisplay.php?fid=2&page=8
具体的配色大家可以修改global里面那段文字。
如果觉得字体太小可以看看
我的配色和字体大小,在6楼。~~~~~~~
此修改原作者好像是laoyang
打开css.htm
在</style>之前加入
- .tableborder { background: #D3E9FF; border: {BORDERWIDTH}px solid {BORDERCOLOR} }
复制代码
修改include/global.php文件
查找
- function multi($num, $perpage, $curr_page, $mpurl) {
- $multipage = '';
- if($num > $perpage) {
- $page = 10;
- $offset = 2;
- $pages = ceil($num / $perpage);
- $from = $curr_page - $offset;
- $to = $curr_page + $page - $offset - 1;
- if($page > $pages) {
- $from = 1;
- $to = $pages;
- } else {
- if($from < 1) {
- $to = $curr_page + 1 - $from;
- $from = 1;
- if(($to - $from) < $page && ($to - $from) < $pages) {
- $to = $page;
- }
- } elseif($to > $pages) {
- $from = $curr_page - $pages + $to;
- $to = $pages;
- if(($to - $from) < $page && ($to - $from) < $pages) {
- $from = $pages - $page + 1;
- }
- }
- }
- $multipage .= '<a href="'.$mpurl.'&page=1"><<</a> ';
- for($i = $from; $i <= $to; $i++) {
- if($i != $curr_page) {
- $multipage .= '<a href="'.$mpurl.'&page='.$i.'">['.$i.']</a> ';
- } else {
- $multipage .= '<u><b>['.$i.']</b></u> ';
- }
- }
- $multipage .= $pages > $page ? " ... <a href="$mpurl&page=$pages"> [$pages] >></a>" : " <a href="$mpurl&page=$pages">>></a>";
- }
- return $multipage;
- }
复制代码
替换成
- function multi($num, $perpage, $curpage, $mpurl, $maxpages = 0) {
- $mpurl .= strpos($mpurl, '?') ? '&' : '?';
- if($num > $perpage) {
- $page = 10;
- $offset = 2;
- $realpages = ceil($num / $perpage);
- $pages = $maxpages && $maxpages < $realpages ? $maxpages : $realpages;
-
- $from = $curpage - $offset;
- $to = $curpage + $page - $offset - 1;
- if($page > $pages) {
- $from = 1;
- $to = $pages;
- } else {
- if($from < 1) {
- $to = $curpage + 1 - $from;
- $from = 1;
- if(($to - $from) < $page && ($to - $from) < $pages) {
- $to = $page;
- }
- } elseif($to > $pages) {
- $from = $curpage - $pages + $to;
- $to = $pages;
- if(($to - $from) < $page && ($to - $from) < $pages) {
- $from = $pages - $page + 1;
- }
- }
- }
- $multipage = ($curpage - $offset > 1 && $pages > $page ? '<td> <a title="最前页" href="'.$mpurl.'page=1"><b>|</b>< </td>' : '').
- ($curpage > 1 ? '<td> <a title="上一页" href="'.$mpurl.'page='.($curpage - 1).'"><</a> </td>' : '');
- for($i = $from; $i <= $to; $i++) {
- $multipage .= $i == $curpage ? '<td bgcolor="'.ALTBG2.'"> <u><b><font color=red><a title="第 '.$i.' 页">'.$i.'</font></b></u> </td>' :
- '<td> <a title="第 '.$i.' 页" href="'.$mpurl.'page='.$i.'">'.$i.'</a> </td>';
- }
- $multipage .= ($curpage < $pages ? '<td> <a title="下一页" href="'.$mpurl.'page='.($curpage + 1).'">></a> </td>' : '').
- ($curpage + $page - $offset <= $pages ? '<td> <a title="最末页" href="'.$mpurl.'page='.$pages.'">><b>|</b></a> </td>' : '').
- ($curpage == $maxpages ? '<td> <a href="misc.php?action=maxpages&pages='.$maxpages.'">><b>?</b></a> </td>' : '').
- ($pages > $page ? '<td><a title="直接跳转到第X页,请输入该页码后回车"><input type="text" name="custompage" size="2" style="border: 1px solid '.BORDERCOLOR.'" onKeyDown="javascript: if(window.event.keyCode == 13) window.location=\''.$mpurl.'page=\'+this.value;"></td>' : '');
- $multipage = $multipage ? '<table cellspacing="0" cellpadding="0" border="0"><tr><td height="3"></td></tr><tr><td>'.
- '<table cellspacing="'.BORDERWIDTH.'" cellpadding="0" class="tableborder"><tr bgcolor="'.ALTBG1.'" class="smalltxt"><td class="header"><a title="本版共有主题 '.$num.' 篇"> '.$num.' </td><td class="header"><a title="第 '.$curpage.' 页/共 '.$realpages.' 页"> '.$curpage.'/'.$realpages.' </td>'.$multipage.'</tr></table>'.
- '</td></tr><tr><td height="3"></td></tr></table>' : '';
- }
- return $multipage;
- }
复制代码
[ 本帖最后由 crabyan 于 2005-8-27 15:51 编辑 ] |