雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

dedecms

當(dāng)前位置:主頁 > CMS教程 > dedecms >

dede不使用js調(diào)用非DEDE數(shù)據(jù) 如論壇等其他cms數(shù)據(jù)

來源:本站原創(chuàng)|時間:2021-08-05|欄目:dedecms|點(diǎn)擊:

對于織夢dedecms主站和論壇分隔2地的,大家一般首頁調(diào)用論壇都是JS來搞是吧,下面推薦一個好方法實(shí)現(xiàn)html調(diào)用,對搜索引擎友好。
 
論壇以PW舉例:
一般實(shí)現(xiàn)方法:
<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了,是不是很簡單啊。
嘿嘿。
 
注:此方法最好只用在首頁,如果在內(nèi)容也也這樣搞,可能生成html很慢 
修改論壇new.php:
本來讀取論壇的數(shù)據(jù)是js數(shù)據(jù):
 
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 開發(fā)環(huán)境的方法</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內(nèi)置鈴聲全下載</a> <br>");
 
現(xiàn)在不需要js數(shù)據(jù),要的是html數(shù)據(jù),所以大家需要把論壇new.php里的輸出語句中的document.write去掉。
 
其他程序舉例:
 
 
{dede:book runphp=’yes’} 
@me = file_get_contents(‘http://book.myiphones.com.cn/freelist/new.html’); 
{/dede:book}
 
拿來就用,數(shù)據(jù)讀取端格式要對就OK
 

上一篇:教你怎樣去掉dede下載地址中的li標(biāo)簽

欄    目:dedecms

下一篇:Dedecms列表頁通過函數(shù)調(diào)用當(dāng)前文檔tag的方法

本文標(biāo)題:dede不使用js調(diào)用非DEDE數(shù)據(jù) 如論壇等其他cms數(shù)據(jù)

本文地址:http://www.jygsgssxh.com/a1/dedecms/15564.html

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關(guān)

隨機(jī)閱讀

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有