showpage.js
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:5k
源码类别:

外挂编程

开发平台:

ASP/ASPX

  1. <!--
  2. //ASP分页函数
  3. function ShowListPage(page,Pcount,TopicNum,maxperpage,strLink,ListName){
  4. var alertcolor = '#FF0000';
  5. maxperpage=Math.floor(maxperpage);
  6. TopicNum=Math.floor(TopicNum);
  7. page=Math.floor(page);
  8. var n,p;
  9. if ((page-1)%5==0) {
  10. p=(page-1) /5
  11. }else{
  12. p=(((page-1)-(page-1)%5)/5)
  13. }
  14. if(TopicNum%maxperpage==0) {
  15. n=TopicNum/maxperpage;
  16. }else{
  17. n=(TopicNum-TopicNum%maxperpage)/maxperpage+1;
  18. }
  19. document.write ('<table border="0" cellpadding="0" cellspacing="1" class="Tableborder3">');
  20. document.write ('<form method=post action="?pcount='+Pcount+strLink+'">');
  21. document.write ('<tr align="center">');
  22. document.write ('<td class="tabletitle1" title="'+ListName+'">&nbsp;'+ListName+'&nbsp;</td>');
  23. document.write ('<td class="tabletitle1" title="总数">&nbsp;'+TopicNum+'&nbsp;</td>');
  24. document.write ('<td class="tabletitle1" title="每页">&nbsp;'+maxperpage+'&nbsp;</td>');
  25. document.write ('<td class="tabletitle1" title="页次">&nbsp;'+page+'/'+Pcount+'页&nbsp;</td>');
  26. if (page==1){
  27. document.write ('<td class="tablebody1">&nbsp;<font face=webdings>9</font>&nbsp;</td>');
  28. }else{
  29. document.write ('<td class="tablebody1">&nbsp;<a href="?page=1'+strLink+'" title="首页"><font face=webdings>9</font></a>&nbsp;</td>');
  30. }
  31. if (p*5 > 0){
  32. document.write ('<td class="tablebody1">&nbsp;<a href="?page='+p*5+strLink+'" title="上五页"><font face=webdings>7</font></a>&nbsp;</td>');
  33. }
  34. for (var i=p*5+1;i<p*5+6;i++){
  35. if (i==page){
  36. document.write ('<td class="tablebody2">&nbsp;<font class="normalTextSmall"><u><b>'+i+'</b></u></font>&nbsp;</td>');
  37. }else{
  38. document.write ('<td class="tablebody1">&nbsp;<a href="?page='+i+strLink+'">'+i+'</a>&nbsp;</td>');
  39. }
  40. if (i==n) break;
  41. }
  42. if (i<n){
  43. document.write ('<td class="tablebody1">&nbsp;<a href="?page='+i+strLink+'" title="下五页"><font face=webdings>8</font></a>&nbsp;<td>');
  44. }
  45. if (page==n){
  46. document.write ('<td class="tablebody1">&nbsp;<Font face=webdings>:</font>&nbsp;</td>');
  47. }else{
  48. document.write ('<td class="tablebody1">&nbsp;<a href="?page='+n+strLink+'" title="尾页"><font face=webdings>:</font></a>&nbsp;</td>');
  49. }
  50. document.write ('<td class="tablebody1"><input class="PageInput" type=text name="page" size=1 maxlength=10  value="'+page+'"></td>');
  51. document.write ('<td class="tablebody1"><input type=submit value=Go name=submit class="PageInput"></td>');
  52. document.write ('</tr>');
  53. document.write ('</form></table>');
  54. }
  55. //HTML分页函数
  56. function ShowHtmlPage(page,Pcount,TopicNum,maxperpage,strLink,ExtName,ListName){
  57. var alertcolor = '#FF0000';
  58. maxperpage=Math.floor(maxperpage);
  59. TopicNum=Math.floor(TopicNum);
  60. page=Math.floor(page);
  61. var n,p;
  62. if ((page-1)%5==0) {
  63. p=(page-1) /5
  64. }else{
  65. p=(((page-1)-(page-1)%5)/5)
  66. }
  67. if(TopicNum%maxperpage==0) {
  68. n=TopicNum/maxperpage;
  69. }else{
  70. n=(TopicNum-TopicNum%maxperpage)/maxperpage+1;
  71. }
  72. document.write ('<table border="0" cellpadding="0" cellspacing="1" class="Tableborder3">');
  73. document.write ('<form method=post>');
  74. document.write ('<tr align="center">');
  75. document.write ('<td class="tabletitle1" title="'+ListName+'">&nbsp;'+ListName+'&nbsp;</td>');
  76. document.write ('<td class="tabletitle1" title="总数">&nbsp;'+TopicNum+'&nbsp;</td>');
  77. document.write ('<td class="tabletitle1" title="每页">&nbsp;'+maxperpage+'&nbsp;</td>');
  78. document.write ('<td class="tabletitle1" title="页次">&nbsp;'+page+'/'+Pcount+'页&nbsp;</td>');
  79. if (page==1){
  80. document.write ('<td class="tablebody1">&nbsp;<font face=webdings>9</font>&nbsp;</td>');
  81. }else{
  82. document.write ('<td class="tablebody1">&nbsp;<a href="'+strLink+subjoin(1)+ExtName+'" title="首页"><font face=webdings>9</font></a>&nbsp;</td>');
  83. }
  84. if (p*5 > 0){
  85. document.write ('<td class="tablebody1">&nbsp;<a href="'+strLink+subjoin(p*5)+ExtName+'" title="上五页"><font face=webdings>7</font></a>&nbsp;</td>');
  86. }
  87. for (var i=p*5+1;i<p*5+6;i++){
  88. if (i==page){
  89. document.write ('<td class="tablebody2">&nbsp;<font class="normalTextSmall"><u><b>'+i+'</b></u></font>&nbsp;</td>');
  90. }else{
  91. document.write ('<td class="tablebody1">&nbsp;<a href="'+strLink+subjoin(i)+ExtName+'">'+i+'</a>&nbsp;</td>');
  92. }
  93. if (i==n) break;
  94. }
  95. if (i<n){
  96. document.write ('<td class="tablebody1">&nbsp;<a href="'+strLink+subjoin(i)+ExtName+'" title="下五页"><font face=webdings>8</font></a>&nbsp;<td>');
  97. }
  98. if (page==n){
  99. document.write ('<td class="tablebody1">&nbsp;<Font face=webdings>:</font>&nbsp;</td>');
  100. }else{
  101. document.write ('<td class="tablebody1">&nbsp;<a href="'+strLink+subjoin(n)+ExtName+'" title="尾页"><font face=webdings>:</font></a>&nbsp;</td>');
  102. }
  103. document.write ('<td class="tabletitle1" title="转到">&nbsp;GO&nbsp;</td>');
  104. document.write ('<td class="tablebody1"><select class="PageInput" name="page" size="1" onchange="javascript:window.location=this.options[this.selectedIndex].value;">');
  105. for (var i=1;i<TopicNum;i++){
  106. if (i==page){
  107. document.write ('<option value="'+strLink+subjoin(i)+ExtName+'" selected>第'+i+'页</option>');
  108. }else{
  109. document.write ('<option value="'+strLink+subjoin(i)+ExtName+'">第'+i+'页</option>');
  110. }
  111. if (i==n) break;
  112. }
  113. document.write ('</select></td>');
  114. document.write ('</tr>');
  115. document.write ('</form></table>');
  116. }
  117. function subjoin(what) {
  118. if (what < 10){
  119. str = '00'+what;
  120. }else{
  121. if (what>9 && what<100)
  122. {
  123. str = '0'+what;
  124. }else{
  125. str = what;
  126. }
  127. }
  128. return str;
  129. }
  130. //-->