Introduction: This is a detailed page for dedecms 5.5 to implement tag paging pseudo-static. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 329772 'rolling = 'no'>
A few days ago, I saw the pseudo-static feature of the tag. I just tried to calculate the pagination URL as a pseudo-static one. The following is the implementation method:
Step 1:
1. Open Arc. taglist. Class. php
2. Find This method
Function getcururl () {If (! Empty ($ _ server ["request_uri"]) {$ nowurl = $ _ server ["request_uri"]; $ nowurls = explode ("? ", $ Nowurl); $ nowurl = $ nowurls [0];} else {$ nowurl = $ _ server [" php_self "];} return $ nowurl ;}
3. modify it to the following (in fact, it is to filter out. php. No matter what it is, the experts will show it to people who do not understand it)
Function getcururl () {If (! Empty ($ _ server ["request_uri"]) {$ nowurl = $ _ server ["request_uri"]; $ nowurls = explode ("? ", $ Nowurl); $ nowurl = $ nowurls [0]; $ nowurl = str_replace (". PHP ",'', $ nowurl);} else {$ nowurl = $ _ server ["php_self"]; $ nowurl = str_replace (". PHP ",'', $ nowurl);} return $ nowurl ;}
Step 2:
1. Find
$ Purl. = "? /". Urlencode ($ this-> tag );
Then put the "?" # Delete
2. Find
$ Prepage. = "<li> <a href = '". $ Purl. "/$ prepagenum/'> previous page </a> </LI> \ r \ n"; $ indexpage = "<li> <a href = '". $ Purl. "/1/'> homepage </a> </LI> \ r \ n ";
Modify it to ( .html after the link)
$ Prepage. = "<li> <a href = '". $ Purl. "/previous prepagenum.html '> previous page </a> </LI> \ r \ n"; $ indexpage = "<li> <a href = '". $ Purl. "/1.html"> homepage </a> </LI> \ r \ n ";
3. Find
$ Nextpage. = "<li> <a href = '". $ Purl. "/$ nextpagenum/'> next page </a> </LI> \ r \ n"; $ endpage = "<li> <a href = '". $ Purl. "/$ totalpage/'> last page </a> </LI> \ r \ n ";
Change
$ Nextpage. = "<li> <a href = '". $ Purl. "/$nextpagenum.html '> next page </a> </LI> \ r \ n"; $ endpage = "<li> <a href = '". $ Purl. "/$totalpage.html '> last page </a> </LI> \ r \ n ";
4. Find
If ($ J ==$ this-> pageno) {$ listdd. = "<li class = \" thisclass \ "> <A> $ j </a> </LI> \ r \ n";} else {$ listdd. = "<li> <a href = '". $ Purl. "/$ J/'> ". $ J. "</a> </LI> \ r \ n ";}
Change
If ($ J ==$ this-> pageno) {$ listdd. = "<li class = \" thisclass \ "> <A> $j.html </a> </LI> \ r \ n";} else {$ listdd. = "<li> <a href = '". $ Purl. "/j.html '> ". $ J. "</a> </LI> \ r \ n ";}
5. The file is modified and saved.
Step 3:
Modify the. htaccess or httpd. ini file
Add a rule:
Rewriterule ^ (. *)/tags/([0-9a-za-z %] +)/([0-9] +) \. html $1/tags \. php \? /$2/$3
This is done.
Friendly reminder: If you have obtained the tag label pseudo-static and the rule is written as follows:
Rewriterule ^ (. *)/tags/(. *) \. html $1/tags \. php \? $2
This will certainly cause an error. The range is too wide. Please change it to this:
Rewriterule ^ (. *)/tags/([0-9a-za-z %] +) \. html $1/tags \. php \? $2
Dawn of the day, the younger brother needs to wash his face and go to bed. Alas, this day is a heart ....
More articles about "dedecms 5.5 false static tag paging"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/329772.html pageno: 12.