有一个客户要在会中心调用相关代理会员组的文章 并调用指定的栏目文章 经研究分享如下:
如果有科汛问题不懂,或要进行二次开发的朋友可以加我Q 95018369
在user/index.asp
最底下加以下代码
Private Function ArticleNews(ClassID)
dim rs:set rs=server.CreateObject("adodb.recordset")
RS.open "select top 5 ID,Title,AddDate from KS_Article where Tid='"& ClassID &"' order by id desc",conn,1,1
With response
.write "<ul>"
do while not rs.eof
.write "<li>"
.write "<span class=""data"">"& LFCls.Get_Date_Field(rs("AddDate"),"YYYY-MM-DD") &"</span>"
.write "<img src=""http://www.loongdi.com/UploadFiles/newsx.gif"" width=""4"" height=""5"" />"
.write "<a href=""/thread-"& rs("ID") &"-1.html"" target=""_blank"" title="""& rs("Title") &""">"
.write left(rs("Title"),40)
.write "</a>"
.write "</li>" & vbcrlf
rs.movenext
loop
.write "</ul>"
End With
rs.close
set rs=nothing
End Function
同时在126行 加
下面调用栏目ID 下在红色为栏目ID
<style>
.hylb{ font-size:14px; background:#f0f2f5; padding:2px 10px; height:25px; line-height:25px; font-weight:bold; color:#f00;}
.ldlb_left{ float:left; border:#f0f2f5 1px solid; margin-right:5px; margin-bottom:12px; width:49%; overflow:hidden}
.ldlb_rig{ float:left; border:#f0f2f5 1px solid; margin-bottom:12px; margin-left:5px; width:49%; overflow:hidden}
.ldlb_cont{ padding:10px; height:256px; padding-right:8px; }
.ldlb_cont li{ line-height:26px;}
.ldlb_cont li span{ float:right;}
</style>
<!--设置不同的会员组显示不同的通知 -->
<!--总代会员 -->
<%if KSUser.GroupID=3 then%>
<div class="ldlb_left">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2058.html" target="_blank">更多...</a></span>总代通知</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20149942715233")%></div>
</div>
<div class="ldlb_rig">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2032.html" target="_blank">更多...</a></span>资料下载</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20148104672515")%></div>
</div>
<%end if%>
<!--直营会员 -->
<%if KSUser.GroupID=2 then%>
<div class="ldlb_left">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2057.html" target="_blank">更多...</a></span>直营通知</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20151705366857")%></div>
</div>
<div class="ldlb_rig">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2032.html" target="_blank">更多...</a></span>资料下载</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20148104672515")%></div>
</div>
<%end if%>
<!--管理员 -->
<%if KSUser.GroupID=1 then%>
<div class="ldlb_left">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2058.html" target="_blank">更多...</a></span>总代通知</div>
<div style="clear:both"></div>
<div class="ldlb_cont"> <%ArticleNews("20149942715233")%></div></div>
</div>
<div class="ldlb_rig">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2057.html" target="_blank">更多...</a></span>直营通知</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20151705366857")%></div>
</div>
<div class="ldlb_left">
<div class="hylb">
<span style=" font-size:12px; font-weight:normal; float:right"><a href="/list-2032.html" target="_blank">更多...</a></span>资料下载</div>
<div style="clear:both"></div>
<div class="ldlb_cont"><%ArticleNews("20148104672515")%></div>
</div>
<%end if%>
</div>
<!--设置不同的会员组显示不同的通知结束 -->