{"id":1157,"date":"2017-05-16T14:03:28","date_gmt":"2017-05-16T06:03:28","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1157"},"modified":"2018-11-21T10:46:40","modified_gmt":"2018-11-21T02:46:40","slug":"%e7%bb%87%e6%a2%a6dedecms%e7%a7%bb%e5%8a%a8%e7%89%88%e4%bc%aa%e9%9d%99%e6%80%81-%e5%ae%9e%e7%8e%b0%e4%b8%8epc%e7%94%b5%e8%84%91%e7%89%88%e9%9d%99%e6%80%81%e5%9c%b0%e5%9d%80url%e4%b8%80%e8%87%b4","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1157.html","title":{"rendered":"\u7ec7\u68a6dedecms\u624b\u673a\u7248_\u79fb\u52a8\u7aef\u4f2a\u9759\u6001\u5b9e\u73b0\u4e0ePC\u7535\u8111\u7248\u9759\u6001\u5730\u5740url\u4e00\u81f4\u6559\u7a0b+\u4f2a\u9759\u6001\u89c4\u5219"},"content":{"rendered":"

\u4e0b\u9762\u6559\u7a0b\u662f\u9488\u5bf9\u7535\u8111\u7aef\u662f\u751f\u6210\u9759\u6001\u800c\u624b\u673a\u7aef\u662f\u52a8\u6001\u7684\u60c5\u51b5\u4e0b\u7684\u4f2a\u9759\u6001(\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u7528\u7684\u865a\u62df\u4e3b\u673a\u6ca1\u6709\u4e8c\u7ea7\u76ee\u5f55\u7ed1\u5b9a\u57df\u540d\u7684\u8bdd\uff0c\u6b64\u4f2a\u9759\u6001\u6559\u7a0b\u53ef\u80fd\u8bbe\u7f6e\u4e0d\u6210\u529f)<\/h2>\n

\u5982\u679c\u60f3\u5168\u7ad9\u4f2a\u9759\u6001\u8bf7\u8bbf\u95ee\uff1ahttp:\/\/www.baishitou.cn\/1309.html<\/a><\/span><\/h2>\n

\u4ee5\u4e0b\u6559\u7a0b\u6240\u4fee\u6539\u7684\u6587\u4ef6(utf8\/gbk)\u6253\u5305\u4e0b\u8f7d\uff1a<\/strong><\/h2>\n

\u4fee\u6539\u6216\u8005\u8986\u76d6\u6587\u4ef6\u4e4b\u524d\u8bf7\u5907\u4efd\u4ee5\u4e0b4\u4e2a\u6587\u4ef6
\n\\m\\index.php
\n\\m\\list.php
\n\\m\\view.php
\n\\include\\arc.listview.class.php<\/p>\n\n\n\t\"Placeholder\"\n\t\u4e0b\u8f7d2371<\/div>\n\n\t\n\n\t\t

dedecms\u7ec7\u68a6\u7535\u8111\u7248\u9759\u6001\u79fb\u52a8\u7248\u4f2a\u9759\u6001\u5b9e\u73b02B\u4f2a\u9759\u6001\u89c4\u5219.zip<\/h1>\n\n\t\t\t\t\t\t\n\t\t\t\u4e0b\u8f7d\u6587\u4ef6\t\t\tdedecms\u7ec7\u68a6\u7535\u8111\u7248\u9759\u6001\u79fb\u52a8\u7248\u4f2a\u9759\u6001\u5b9e\u73b02B\u4f2a\u9759\u6001\u89c4\u5219.zip\t\t\t\t– 31.00 KB<\/small>\n\t\t<\/a>\n\t\t\t<\/div>\n<\/aside>\n\n\n\n

\u7535\u8111\u7248\u9759\u6001\u751f\u6210\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u79fb\u52a8\u7248\u4f2a\u9759\u6001\u64cd\u4f5c\u6559\u7a0b\u5982\u4e0b\uff1a<\/strong><\/p>\n

1.\u79fb\u52a8\u7248\u57df\u540d m.123.com \u89e3\u6790\u5e76\u6307\u5411\u7ed1\u5b9a\u76ee\u5f55\u5230\u7f51\u7ad9\u76ee\u5f55\u7684m\u6587\u4ef6\u5939<\/strong><\/p>\n

2.\u540e\u53f0-\u7cfb\u7edf\u914d\u7f6e \u6dfb\u52a0\u53d8\u91cf (\u4e3a\u4e86\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u4f7f\u7528\u7535\u8111\u7248\u7684\u6587\u7ae0\u56fe\u7247\uff0c\u4e3a\u4e86\u79fb\u52a8\u7248\u6a21\u677fcss\u3001js\u3001images\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84)<\/strong>
\n\u53d8\u91cf\u540d\u79f0:cfg_mobile
\n\u53d8\u91cf\u7c7b\u578b:\u6587\u672c
\n\u53c2\u6570\u8bf4\u660e:\u624b\u673a\u7248\u7f51\u5740
\n\u53d8\u91cf\u503c:http:\/\/m.123.com
\n\u6240\u5c5e\u7ec4:\u7ad9\u70b9\u8bbe\u7f6e<\/p>\n

\u53d8\u91cf\u540d\u79f0:cfg_rewritem
\n\u53d8\u91cf\u7c7b\u578b:\u5e03\u5c14(Y\/N)
\n\u53c2\u6570\u8bf4\u660e:\u624b\u673a\u7248\u4f2a\u9759\u6001
\n\u53d8\u91cf\u503c:Y
\n\u6240\u5c5e\u7ec4:\u7ad9\u70b9\u8bbe\u7f6e<\/p>\n

\"\"<\/p>\n

\u680f\u76ee\u5217\u8868\u3010\u6587\u4ef6\u4fdd\u5b58\u76ee\u5f55\u3011\u53ef\u4ee5\u662f\u4ee5\u4e0b\u5f62\u5f0f<\/p>\n

\"\"<\/p>\n

\"\"
\n3.\\m\\index.php \u4fee\u6539\u6210\u6c38\u8fdc\u662f\u52a8\u6001\uff0c\u4e0d\u751f\u6210index.html<\/strong>
\n\u628a\u91cc\u9762\u7684<\/p>\n

$row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;\r\nif ($row['showmod'] == 1)\r\n{\r\n$pv->SaveToHtml(dirname(__FILE__).'\/index.html');\r\ninclude(dirname(__FILE__).'\/index.html');\r\nexit();\r\n} else {\r\n$pv->Display();\r\nexit();\r\n}<\/code><\/pre>\n

\u6539\u6210<\/p>\n

$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . \"\/\" . $row['templet']);\r\n$pv->Display();\r\nexit();<\/code><\/pre>\n

 <\/p>\n

4.\\m\\list.php \u589e\u52a0\u4f2a\u9759\u6001\u5224\u65ad<\/strong>
\n\u628a\u91cc\u9762\u7684<\/p>\n

$tid = (isset($tid) && is_numeric($tid) ? $tid : 0);<\/code><\/pre>\n

\u6539\u6210<\/p>\n

if($cfg_rewritem == 'Y')\r\n{\r\n$typedir = parse_url($tid, PHP_URL_PATH);\r\n$PageNo = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode(\"_\", GetCurUrl())))) : 1;\r\n$tinfos = $dsql->GetOne(\"SELECT * FROM `#@__arctype` WHERE typedir='\/$typedir' or typedir='{cmspath}\/$typedir'\");\r\n\r\nif(is_array($tinfos))\r\n{\r\n$tid = $tinfos['id'];\r\n$typeid = GetSonIds($tid);\r\n$row = $dsql->GetOne(\"Select count(id) as total From `#@__archives` where typeid in({$typeid})\");\r\n$TotalResult = is_array($row) ? $row['total'] : 0;\r\n}\r\nelse\r\n{\r\n$tid = 0;\r\n}\r\n}\r\nelse\r\n{\r\n$tid = (isset($tid) && is_numeric($tid) ? $tid : 0);\r\n}<\/code><\/pre>\n

 <\/p>\n

5.\\m\\view.php \u589e\u52a0\u4f2a\u9759\u6001\u5224\u65ad<\/strong>
\n\u5728<\/p>\n

$t1 = ExecTime();<\/code><\/pre>\n

\u4e0b\u9762\u52a0\u5165<\/p>\n

if($cfg_rewritem == 'Y')\r\n{\r\n$aid = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode(\"\/\", GetCurUrl())))) : 0;\r\n}<\/code><\/pre>\n

6.\\include\\arc.listview.class.php \u589e\u52a0\u79fb\u52a8\u7248\u4f2a\u9759\u6001\u5206\u9875\u529f\u80fd\uff0c\u627e\u5230<\/strong><\/p>\n

global $cfg_rewrite;<\/code><\/pre>\n

\u6539\u6210<\/p>\n

global $cfg_rewrite,$cfg_rewritem;<\/code><\/pre>\n

\u7ee7\u7eed\u627e\u5230<\/p>\n

$geturl = \"tid=\".$this->TypeID.\"&TotalResult=\".$this->TotalResult.\"&\";\r\n$purl .= '?'.$geturl;<\/code><\/pre>\n

\u6539\u6210<\/p>\n

if($cfg_rewritem == 'Y')\r\n{\r\n$purl = \"\";\r\n}\r\nelse\r\n{\r\n$geturl = \"tid=\".$this->TypeID.\"&TotalResult=\".$this->TotalResult.\"&\";\r\n$purl .= '?'.$geturl;\r\n}<\/code><\/pre>\n

\u7ee7\u7eed\u627e\u5230\u4e0b\u9762\u7684<\/p>\n

return $plist;<\/code><\/pre>\n

\u5728\u5b83\u7684\u4e0a\u9762\u52a0\u5165<\/p>\n

if($cfg_rewritem == 'Y')\r\n{\r\n$plist = preg_replace(\"\/PageNo=(\\d+)\/i\",'list_'.$this->TypeID.'_\\\\1.html',$plist);\r\n}<\/code><\/pre>\n

 <\/p>\n

7.\u79fb\u52a8\u7248\u6a21\u677f\u4e2d\u4f7f\u7528\u6807\u7b7e<\/strong><\/p>\n

\u538b\u7f29\u5305\u91cc\u9762\u7684\u624b\u673a\u6a21\u677f\u90fd\u662f\u9ed8\u8ba4\u7684\u624b\u673a\u6a21\u677f\uff0c\u5982\u679c\u51fa\u73b0\u6837\u5f0f\u95ee\u9898\u6216\u8005\u662f\u6570\u636e\u8c03\u7528\u4e0d\u51fa\u6765\u3002\u4f60\u53ef\u4ee5\u6309\u7167\u4e0b\u9762\u7684\u65b9\u6cd5\u4fee\u6539\u4f60\u7684\u624b\u673a\u6a21\u677f<\/p>\n

css\uff0cjs\uff0cimages\u6539\u6210\u7edd\u5bf9\u8def\u5f84\uff0c\u4f8b\u5982assets \/ css \/\u6539\u6210\/ assets \/ css \/<\/p>\n

index.php\u6539\u6210{dede\uff1aglobal.cfg_mobile \/}<\/p>\n

list.php\uff1ftid = [field\uff1aid \/]\u6539\u6210[field\uff1atypelink \/]<\/p>\n

list.php\uff1ftid =\u301cid\u301c\u6539\u6210\u301ctypelink\u301c<\/p>\n

list.php\uff1ftid = {dede\uff1afield name ='id'\/}\u6539\u6210{dede\uff1afield.typeurl \/}<\/p>\n

view.php\uff1faid = [field\uff1aid \/]\u6539\u6210[field\uff1aarcurl \/]<\/p>\n

[field\uff1alitpic \/]\u6539\u6210[field\uff1aglobal.cfg_basehost \/] [field\uff1alitpic \/]<\/p>\n

[field\uff1aimage \/]\u6539\u6210<img src =\u201c[field\uff1aglobal.cfg_basehost \/] [field\uff1alitpic \/]\u201d><\/p>\n

\u5185\u5bb9\u9875\u91cc\u7684
\n{dede:field.body\/}
\n\u6539\u6210<\/p>\n

{dede:field.body runphp=yes}\r\nglobal $cfg_basehost;\r\n$str = @me;\r\n$search = '\/(<img.*?)width=([\"\\'])?.*?(?(2)\\2|\\s)([^>]+>)\/is';\/\/\u8fc7\u6ee4img\u91cc\u7684width\r\n$search1 = '\/(<img.*?)height=([\"\\'])?.*?(?(2)\\2|\\s)([^>]+>)\/is';\/\/\u8fc7\u6ee4img\u91cc\u7684height\r\n$search2 = '#(<img.*?style=\".*?)width:\\d+px;([^\"]*?.*?>)#i';\/\/\u8fc7\u6ee4img\u91ccstyle\u7684width\r\n$search3 = '#(<img.*?style=\".*?)height:\\d+px;([^\"]*?.*?>)#i';\/\/\u8fc7\u6ee4img\u91ccstyle\u7684height\r\n$content = preg_replace($search,'$1$3',$str);\r\n$content = preg_replace($search1,'$1$3',$content);\r\n$content = preg_replace($search2,'$1$2',$content);\r\n$content = preg_replace($search3,'$1$2',$content);\r\n@me = $content;\r\n@me = str_replace('http:\/\/www.dedediy.com\/uploads\/allimg\/', $cfg_basehost.'http:\/\/www.dedediy.com\/uploads\/allimg\/', $content);\/\/\u624b\u673a\u7248\u56fe\u7247\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\r\n{\/dede:field.body}<\/code><\/pre>\n

\u5176\u4ed6\u6807\u7b7e\u8ddf\u7535\u8111\u7248\u4e00\u6837<\/p>\n

8.\u79fb\u52a8\u7248\u4f2a\u9759\u6001\u89c4\u5219<\/strong> apache<\/strong><\/p>\n

.htaccess\u00a0 \u653e\u5230m\u6587\u4ef6\u5939\u4e0b<\/p>\n

\u6ce8\u610f\u680f\u76ee\u3010\u5217\u8868\u547d\u540d\u89c4\u5219\u3011\u8981\u5bf9\u5e94\u4f2a\u9759\u6001\u680f\u76ee\u5206\u9875\u89c4\u5219\u548c\\include\\arc.listview.class.php\u91cc\u9762\u7684\u5206\u9875\u89c4\u5219\u3002<\/p>\n

\"\"<\/p>\n

 <\/p>\n

apache\u4f2a\u9759\u6001\u89c4\u5219<\/h2>\n
#dedecms\u79fb\u52a8\u7248\u4f2a\u9759\u6001\r\nRewriteEngine On\r\nRewriteBase \/\r\n\r\n#\u79fb\u52a8\u7248\u5217\u8868\u680f\u76ee\r\nRewriteRule ^(.*)\/$ \/list.php?tid=$1\r\n#\u79fb\u52a8\u7248\u5217\u8868\u680f\u76ee\u5206\u9875\r\nRewriteRule ^(.*)\/list_([0-9]+)_([0-9]+)\\.html$ \/list.php?tid=$1&PageNo=$2\r\n#\u79fb\u52a8\u7248\u6587\u7ae0\u9875\u4f2a\u9759\u6001\u89c4\u5219\r\nRewriteRule ^(.*)\/([0-9]+)\\.html$ \/view.php?aid=$1<\/code><\/pre>\n

Ngix\u4f2a\u9759\u6001\u89c4\u5219<\/h2>\n
location \/ {\r\n\trewrite \"^\/index.html$\" \/index.php last;\r\n\trewrite \"^\/(.*)\/$\" \/list.php?tid=$1 last;\r\n\trewrite \"^\/(.*)st_([0-9]+)_([0-9]+)\\.html$\" \/list.php?tid=$1&PageNo=$2 last;\r\n\trewrite \"^\/(.*)\/([0-9]+)\\.html$\" \/view.php?aid=$1 last;\r\n}<\/code><\/pre>\n

 <\/p>\n

9.\u7535\u8111\u7248\u8df3\u8f6c\u5230\u79fb\u52a8\u7248\u4ee3\u7801<\/strong>
\n1)\u9996\u9875<\/p>\n

<meta http-equiv=\"mobile-agent\" content=\"format=xhtml;url={dede:global.cfg_mobile\/}\">\r\n<script type=\"text\/javascript\">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(\/AppleWebKit.*Mobile\/i.test(navigator.userAgent) || (\/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE\/.test(navigator.userAgent))){if(window.location.href.indexOf(\"?mobile\")<0){try{if(\/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry\/i.test(navigator.userAgent)){window.location.href=\"{dede:global.cfg_mobile\/}\";}else if(\/iPad\/i.test(navigator.userAgent)){}else{}}catch(e){}}}}<\/script><\/code><\/pre>\n

2)\u5217\u8868<\/p>\n

<meta http-equiv=\"mobile-agent\" content=\"format=xhtml;url={dede:global.cfg_mobileurl\/}{dede:type}[field:typeurl\/]{\/dede:type}\">\r\n<script type=\"text\/javascript\">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(\/AppleWebKit.*Mobile\/i.test(navigator.userAgent) || (\/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE\/.test(navigator.userAgent))){if(window.location.href.indexOf(\"?mobile\")<0){try{if(\/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry\/i.test(navigator.userAgent)){window.location.href=\"{dede:global.cfg_mobileurl\/}{dede:type}[field:typeurl\/]{\/dede:type}\";}else if(\/iPad\/i.test(navigator.userAgent)){}else{}}catch(e){}}}}<\/script><\/code><\/pre>\n

3)\u5185\u5bb9<\/p>\n

<meta http-equiv=\"mobile-agent\" content=\"format=xhtml;url={dede:global.cfg_mobile\/}{dede:field.id runphp=yes}$result=GetOneArchive(@me);@me=$result['arcurl'];{\/dede:field.id}\">\r\n<script type=\"text\/javascript\">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(\/AppleWebKit.*Mobile\/i.test(navigator.userAgent) || (\/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE\/.test(navigator.userAgent))){if(window.location.href.indexOf(\"?mobile\")<0){try{if(\/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry\/i.test(navigator.userAgent)){window.location.href=\"{dede:global.cfg_mobile\/}{dede:field.id runphp=yes}$result=GetOneArchive(@me);@me=$result['arcurl'];{\/dede:field.id}\";}else if(\/iPad\/i.test(navigator.userAgent)){}else{}}catch(e){}}}}<\/script><\/code><\/pre>\n

\u5b8c\u6210\u3002<\/strong><\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e0b\u9762\u6559\u7a0b\u662f\u9488\u5bf9\u7535\u8111\u7aef\u662f\u751f\u6210\u9759\u6001\u800c\u624b\u673a\u7aef\u662f\u52a8\u6001\u7684\u60c5\u51b5\u4e0b\u7684\u4f2a\u9759\u6001(\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u7528\u7684\u865a\u62df\u4e3b\u673a\u6ca1\u6709\u4e8c\u7ea7\u76ee\u5f55\u7ed1\u5b9a\u57df\u540d\u7684\u8bdd […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[330,329,180],"class_list":["post-1157","post","type-post","status-publish","format-standard","hentry","category-web","tag-330","tag-329","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=1157"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1157\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}