acoustika
Junior Member
Denmark
311 Posts |
Posted - 22 December 2003 : 22:21:26
|
I have this script I'm using on my frotpage to display the latest topics. Could anybode help to make it better, in such a way that it won't display Polls and topics from hidden forum?
Here is the script
<!--#INCLUDE virtual="/forum/config.asp"--> <!--#INCLUDE virtual="/forum/inc_func_secure.asp" --> <!--#INCLUDE virtual="/forum/inc_sha256.asp"-->
<!--#INCLUDE virtual="/forum/inc_header_short.asp" --> <% ' Include "inc_func_common.asp" above if "INC_HEADER.ASP" is not included!!! (Needed for the ChkDate and ChkString functions)
connString = strConnstring function getlast_topics() set tConn= Server.CreateObject("ADODB.Connection") tConn.Open ConnString
''''''''''''''''''''''''''''''''''''' ''Don't display if from private forum '''''''''''''''''''''''''''''''''''''
'''''''''''''''''
strSql = "SELECT " & strMemberTablePrefix & "Members.MEMBER_ID, " & strMemberTablePrefix & "Members.M_NAME, " strSql = strSql & strTablePrefix & "Topics.T_AUTHOR, " & strTablePrefix & "Topics.T_LAST_POST, " & strTablePrefix & "Topics.T_LAST_POSTER, " strSql = strSql & strTablePrefix & "Topics.T_DATE, " & strTablePrefix & "Topics.T_SUBJECT, " & strTablePrefix & "Topics.TOPIC_ID, " strSql = strSql & strTablePrefix & "Topics.FORUM_ID, " & strTablePrefix & "Topics.CAT_ID" strSql = strSql & " FROM " & strMemberTablePrefix & "Members ," & strTablePrefix & "Topics" strSql = strSql & " WHERE " & strTablePrefix & "Topics.T_AUTHOR = " & strMemberTablePrefix & "Members.MEMBER_ID" strSql = strSql & " ORDER BY " & strTablePrefix & "Topics.TOPIC_ID DESC" CColor = strForumCellColor set rss = tConn.Execute (strSql)
response.write "<tr align=""center"" valign=""top""><td valign=""center"" bgcolor=""" & strHeadCellColor & """ height=""24"" align=""center""><font size=""2"">Nyeste Forum Emner</font></td></tr>" & vbnewline
dim tCount, tTopics tTopics = 8 ' Set to number of topics shown tTopics = tTopics + 1 tCount = 1
do until rss.eof or tTopics = tCount
tID = ChkString(rss("TOPIC_ID"),"display") tPOSTER = ChkString(rss("T_LAST_POSTER"),"display") tDATE = ChkDate(rss("T_DATE"), " kl." ,true) tAuthor = ChkString(rss("M_NAME"),"display") tSUBJECT = ChkString(rss("T_SUBJECT"),"display") strlast = strlast & "<tr><td valign=""top"" onMouseOver=""this.style.background='" & strForumFirstcellcolor & "';"" onMouseOut=""this.style.background='"& CColor &"';"" style=""cursor: hand"" bgcolor=" & CColor & " onClick=""window.top.location.href='/forum/link.asp?TOPIC_ID=" & tID & "'"" height=""18"" class=""button"">" & vbcrlf strlast = strlast & "<div align=""left"" class=""button (unavailable)""><font face=""Veranda, Arial, Helvetica, san-serif"" size=""1""><a href=""/forum/link.asp?TOPIC_ID=" & tID & """ class=""button (unavailable)"" target=""_top"">" & tSUBJECT & "</a><br></font><small><font face=""Veranda, Arial, Helvetica, san-serif"" size=""1"">af: " & tAuthor & " d. " & tDate & "</small></font></div>" & vbcrlf strlast = strlast & "</td></tr>" & vbcrlf
tCount = tCount + 1 rss.movenext loop
rss.close set rss=nothing tConn.close set tConn=nothing getlast_topics=strlast end function %>
<table align="center" width="85%" cellspacing="1" cellpadding="0" border="0" bgcolor="#333333" style="margin-left:10 px;margin-top:0 px"> <%=getlast_topics()%> </table>
you can see it on the frontpage of my site www.uniquedk.dk "Nyeste Forum Emner" |
May The Code Be With You www.UniqueDk.dk *** The Open Forums of Denmark *** |
|