|
发表于 2003-8-8 12:56:20
|
|阅读模式
来自 中国广东广州
修改方法,找到以下与以下代码相似的部分,用下面部分替换即可。
或者你嫌麻烦,或者你以前并没有下载那分页类,那么你可以从这里下载:http://dl.2fs.cn/pagebar/download.php
- /**+-----------------------------------------------
- | 取得整链接,等于whole_num_bar加上表单跳转.
- | $num数字个数,$color 当前链接的突显色
- | 特别说明 $jump='' 如果在同一页要用两个whole_bar
- | 那你就要设定不同的$jump,否则产生错误
- | i.e. $pb = new PageBar(50, 10);
- | $whole_bar = $pb->whole_bar(9);
- | +-----------------------------------------------
- */
- function whole_bar($jump='', $num='', $color='') {
- $whole_num_bar = $this->whole_num_bar($num, $color)." ";
- $jump_form = $this->jump_form($jump);
- return <<<EOT
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="right">$whole_num_bar</td>
- <td width="50" align="right">$jump_form</td>
- </tr>
- </table>
- EOT;
- }
- #End of function whole_bar();
- /**+-----------------------------------------------
- | 跳转表单
- | i.e. $pb = new PageBar(50, 10);
- | 特别说明 $jump='' 如果在同一页要用两个Jump_form
- | 那你就要设定不同的$jump,否则产生错误
- | $Jump_form = $pb->Jump_form();
- | +-----------------------------------------------
- */
- function Jump_form($jump='') {
- $formname = "pagebarjumpform".$jump;
- $jumpname = "jump".$jump;
- $linkhead = $this->linkhead;
- $total = $this->total_page;
- $form = <<<EOT
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <script language="javascript">
- function $jumpname(linkhead, total, page){
-
- var pagecount = (page.value>total)?total<img src="images/smilies/tongue.gif" border="0" alt="">age.value;
- pagecount = (pagecount<1)?1<img src="images/smilies/tongue.gif" border="0" alt="">agecount;
- location.href = linkhead + "pagecount=" + pagecount;
- return false;
- }
- </script>
- <form name="$formname" method="post" onSubmit="return $jumpname('$linkhead', $total, $formname.page)"><tr>
- <td>
- <input name="page" type="text" size="1">
- <input type="button" name="Submit" value="GO" onClick="return $jumpname('$linkhead', $total, $formname.page)">
- </td>
- </tr></form></table>
- EOT;
- return $form;
- }
- #End of function Jump_form();
复制代码
支持的就回复让更多人下载吧。
[ Last edited by Arvan on 2003-8-8 at 01:02 PM ] |
|