dede手機站

原有手機站有dede模板:
1後臺,系統設置添加手機站網址 命名:cfg_mhost。
2將模板名稱後面加_m,放入templets/default,手機站css,js等文件放入m目錄下。
2替換 {dede:global.cfg_templets_skin/} 換爲 {dede:global.cfg_mhost/}。
3文章列表頁連接 {dede:field name='typeurl'/} 換爲 list.php?tid=[field:id/]。
4文章頁[field:arcurl/]換爲view.php?aid=[field:id/]。
5列表圖片不顯示,路徑前面加上原pc站的網址{dede:global.cfg_basehost/}。
6文章頁圖片不顯示,{dede:field.body function='replaceurl(@me)'/}。
7replaceurl方法:在dede的include/extend.func.php中添加以下:
function replaceurl($body,$web_url){
    global $cfg_basehost;
    $body_replace=str_replace('src="/uploads/','src="'.$cfg_basehost.'/uploads/',$body);
    return $body_replace;
}php

8圖片大小自適應jscss

$(".arcmain img").css("height","auto")
$(".arcmain img").css("width","100%")

9完成。web

若是手機站是從新建,則按上面步驟添加便可。curl

相關文章
相關標籤/搜索