1,织梦文章手机端访问PC地址,自动跳转手机端地址
D:\phpstudy_pro\WWW\scentzone\templets\demo32\news_view.htm,head前面添加js代码
<script type="text/javascript">
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)) || (/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)))
{
window.location.href="/m/view.php?aid={dede:field.id/}";
}
</script>
2,一级分类页面调用二级分类时,可以调用content问题
【说明】织梦默认是不支持调用content的;需要修改底层php代码,在sql语句上增加content字段
D:\phpstudy_pro\WWW\scentzone2\include\taglib\channel.lib.php,86行
else if($type=='son')
{
if($typeid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,content
From `#@__arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line ";
}
调用
{dede:channel type='son' row='10' currentstyle=""}
<div class="chanpin">
<h3>[field:typename/]</h3>
<div class="cont">[field:content/]</div>
</div>
{/dede:channel}
3,织梦详情页,js调用当前分类id,当前文章id;等其他变量
var typeid = "{dede:type} [field:ID /] {/dede:type}";
var aid = "{dede:field.id/}";
4,解决织梦dede:list文章按照权重weight排序的方法
(1)模板调用{dede:list row ='8' orderby='weight' orderway='asc'}
(2)修改php文件:D:\phpstudy_pro\WWW\scentzone2\include\arc.listview.class.php,
(2-1)768行附近,($orderby=="lastpost"),增加
else if($orderby=="weight") { $ordersql = " ORDER BY arc.weight $orderWay"; }
(2-2)808行,if(preg_match('/hot|click|lastpost/', $orderby)),
改为if(preg_match('/hot|click|lastpost|weight/', $orderby))