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