• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    dede不使用js调用非DEDE数据 如论坛等其他cms数据
    POST TIME:2018-10-30 21:31

    对于主站和论坛分隔2地的,大家一般首页调用论坛都是JS来搞是吧,下面推荐一个好方法实现html调用,对搜索引擎友好。

    论坛以PW举例:

    一般实现方法:

    <script src="http://bbs.myiphones.com.cn/new.php?action=article&digest=1&postdate=0&author=0&fname=0&hits=0&replies=0&pre=0&num=7&length=40&order=2"></script>

    对搜索引擎很不友好,不能抓取,而且万一论坛挂了,搞的主站也很慢。

    修正方法:

    {dede:huataixiangqi runphp=’yes’}
    @me = file_get_contents(‘http://bbs.*****.com.cn/new.php?action=article&pre=1&num=10&length=50&order=2&fidin=15&digest=0&postdate=0&author=0&fname=0&hits=0&replies=0′);
    {/dede:huataixiangqi}

    ok了,是不是很简单啊。
    嘿嘿。

    注:此方法最好只用在首页,如果在内容也也这样搞,可能生成html很慢
    修改论坛new.php:

    本来读取论坛的数据是js数据:

    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=57787′ target=’_blank’>iPhone玩家不愿外传的smart壁纸</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=56837′ target=’_blank’>iphone2.0以上固件下载,这些资源都是对大 ..</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=54915′ target=’_blank’>白苹果问题解决办法以及原因简单分析 方法 ..</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=54502′ target=’_blank’>各平台建立iphone 开发环境的方法</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=54058′ target=’_blank’>如何解决删除SummberBoard后变白苹果的问题</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=53664′ target=’_blank’>iphone棋牌类游戏汇总!爱牌的疯友别错过 ..</a> <br>");
    document.write("<li> <a href=’http://bbs.***.com.cn/read.php?tid=53623′ target=’_blank’>iPhone内置铃声全下载</a> <br>");

    现在不需要js数据,要的是html数据,所以大家需要把论坛new.php里的输出语句中的document.write去掉。

    其他程序举例:

    {dede:book runphp=’yes’}
    @me = file_get_contents(‘http://book.myiphones.com.cn/freelist/new.html’);
    {/dede:book}

    拿来就用,数据读取端格式要对就OK

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!