日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

生成的靜態(tài)頁面調(diào)用自己寫的動態(tài)插件的方法及一個簡單示例_風(fēng)訊Cms教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

很多朋友都在問風(fēng)訊中如何調(diào)用一些比較個性的東西,因為是靜態(tài)的頁面,沒辦法直接執(zhí)行asp
所以今天我抽空寫了一個簡單的例子,有愛好的朋友可以看一下。希望會對大家有所幫助。
這個例子的功能是可以在首頁調(diào)用網(wǎng)站注冊的會員資料。
在風(fēng)訊根目錄下新建一asp文件:member,asp,文件代碼如下:


<!--#include file="Inc/Cls_DB.asp" -->
<!--#include file="Inc/Const.asp" -->
<!--#include file="Inc/Function.asp" -->(插入風(fēng)訊的常量設(shè)置文件,如數(shù)據(jù)庫路徑和連接都在這幾個文件里)
<%
'*******************code by chenwfy***********2006-04-25*********************************
'功能說明:調(diào)用最新會員資料
'************************************************************************************************
(注釋)

Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing

(建立數(shù)據(jù)庫連接,好象是吧,不大懂,嘿嘿。

'==========================================================================
'設(shè)置調(diào)用會員數(shù)量
dim Getnum
Getnum = 10
'==========================================================================
(定義一個變量,設(shè)置調(diào)用會員資料的數(shù)量)

dim tempobj,tempsql
tempsql = "select top "& Getnum &" id,MemName,***,loginnum from FS_Members order by id desc"
set tempobj = conn.execute(tempsql)
(查詢數(shù)據(jù)庫,取得對應(yīng)的資料)

if not tempobj.eof then
do while not tempobj.eof
dim memid,memname,mem***,true***,memloginnum
memid = tempobj("id")
memname = tempobj("memname")
mem*** = tempobj("***")
memloginnum = tempobj("loginnum")
if mem*** = "0" then
true*** = "<font color=""red"">女</font>"
else
true*** = "<font color=""bule"">男<font>"
end if
(重點在下面這里,呵呵,輸出document.write后的內(nèi)容并循環(huán),這樣才可以用js調(diào)用
Response.write "document.write('<table width=""220"" border=""0"" cellpadding=""0"" cellspacing=""0"">"&"<tr>"&"<td width=""120"" height=""20"" align=""center"" valign=""middle"">"&"<a href=memtext.asp?id="& memid &" title=""點擊查看此會員的具體資料"" target=""_blank"">"& memname &"</a>"&"</td>"&"<td width=""50"" height=""20"" align=""center"" valign=""middle"">"& true*** &"</td>"&"<td width=""50"" height=""20"" align=""center"" valign=""middle"">"& memloginnum &"</td>"&"</tr>"&"</table>');"
tempobj.movenext
loop
else
response.Write"暫時還沒有會員哦"
end if

tempobj.close
set tempobj = nothing
set conn = nothing (關(guān)閉數(shù)據(jù)庫連接)
%>

查看更多 風(fēng)訊cms教程  風(fēng)訊cms模板

共2頁上一頁12下一頁
來源:模板無憂//所屬分類:風(fēng)訊Cms教程/更新時間:2006-06-19
相關(guān)風(fēng)訊Cms教程