![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-10-01 13:58 |
47,813 topics / 349,918 posts / today 0 new / 48,279 members |
| DOS批处理 & 脚本技术(批处理室) » [Resolved] Help: Use a batch file to make webpage pagination links |
| Printable Version 3,272 / 21 |
| Floor16 ganjie | Posted 2009-02-05 10:07 |
| 初级用户 Posts 37 Credits 49 | |
|
A question: if I want to change, for example,
D First page A B2 C3 D4 E5 F6 4/19 Last page S E First page A C3 D4 E5 F6 G7 5/19 Last page S F First page A D4 E5 F6 G7 H8 6/19 Last page S into: D First page A B2 C3 Current page:D4 E5 F6 4/19 Last page S E First page A C3 D4 Current page:E5 F6 G7 5/19 Last page S F First page A D4 E5 Current page:F6 G7 H8 6/19 Last page S Can it be changed into this style? That is, add 'Current page' before the current page. I once tried to modify your code above, but found it impossible unless the algorithm is changed. |
|
| Floor17 everest79 | Posted 2009-02-05 18:59 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
Originally posted by ganjie at 2009-2-4 03:17 AM: Hehe |
|
| Floor18 netbenton | Posted 2009-02-05 19:43 |
| 银牌会员 Posts 752 Credits 1,916 From 广西 | |
|
Find these three places:
1. set xn=0 2. set/a ms+=1,mb+=1 3. if not defined fn%2 (set "pr=<td scope="col"><a href="!fn%1!">%1</a></td>"&!echo !pr!&set/a xn+=1) Change them to: 1. set xn=0&set "dqym%%a=Current page:" 2. set/a ms+=1,mb+=1&set dqym%%a= 3. if not defined fn%2 (set "pr=<td scope="col"><a href="!fn%1!">!dqym%1!%1</a></td>"&!echo !pr!&set/a xn+=1) [ Last edited by netbenton on 2009-2-5 at 19:44 ] |
|
| Floor19 ganjie | Posted 2009-02-06 08:19 |
| 初级用户 Posts 37 Credits 49 | |
|
So that's all it takes to change it. I originally thought that after adding the current link, the algorithm would definitely have to be modified. This way I can modify the current page item myself.
For example, the pagination links for the C file are as follows: <table widtd="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td scope="col"><a href="A.htm">First page</a></td> <td scope="col"><a href="B.htm">Previous page</a></td> <td scope="col"><a href="A.htm">1</a></td> <td scope="col"><a href="B.htm">2</a></td> <td scope="col"><a href="C.htm">3</a></td> <td scope="col"><a href="D.htm">4</a></td> <td scope="col"><a href="E.htm">5</a></td> <td scope="col"><a href="F.htm">Next page</a></td> <td scope="col">3/19</td> <td scope="col"><a href="S.htm">Last page</a></td> </tr> </table> This way I can change the current page part <td scope="col"><a href="C.htm">3</a></td> to <strong>3</strong> for CSS needs. How can I change it like this? |
|
| Floor20 netbenton | Posted 2009-02-06 09:04 |
| 银牌会员 Posts 752 Credits 1,916 From 广西 | |
|
I really wish the OP could explain the problem clearly all at once...
Just change the third line to this, and it'll work. if not defined fn%2 ( if defined dqym%1 (set "pr=<td scope="col"><strong>%1</strong></td>") else (set "pr=<td scope="col"><a href="!fn%1!">%1</a></td>") echo !pr!&set/a xn+=1 ) |
|
| Floor21 ganjie | Posted 2009-02-06 09:21 |
| 初级用户 Posts 37 Credits 49 | |
|
Sorry, my apologies! I really should have wrapped this up long ago, but for better appearance I started using CSS styles, so... enough talk, I tested it and it worked. Thanks, many thanks!
|
|
| Floor22 netbenton | Posted 2009-10-09 08:08 |
| 银牌会员 Posts 752 Credits 1,916 From 广西 | |
|
The OP added a new question:
Change the mutually linked files from 5 to n: |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |