Ez4arab
Junior Member
479 Posts |
Posted - 18 June 2002 : 17:47:43
|
i have made this code to show the name of forums in the portal page here is the code name the file inc_forumlist.asp
<!--#INCLUDE FILE="config.asp" --> <!--#INCLUDE FILE="inc_functions.asp" --> <!--#INCLUDE FILE="inc_top.asp" --> <% '## Forum_SQL - Get all Categories from the DB strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_ID, " &_ strTablePrefix & "CATEGORY.CAT_STATUS, " &_ strTablePrefix & "CATEGORY.CAT_NAME, " &_ strTablePrefix & "CATEGORY.CAT_ORDER, " &_ strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION, " &_ strTablePrefix & "CATEGORY.CAT_MODERATION " &_ " FROM " & strTablePrefix & "CATEGORY " if Cat_ID <> "" then strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & Cat_ID end if strSql = strSql & " ORDER BY " & strTablePrefix & "CATEGORY.CAT_ORDER ASC, " &_ strTablePrefix & "CATEGORY.CAT_NAME ASC;"
set rs = Server.CreateObject("ADODB.Recordset") rs.open strSql, my_Conn %> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="<% =strForumCellColor %>"> <tr> <td bgcolor="<% =strHeadCellColor %>" width="100%"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><p align="center"> <b>All Forums </b></p></td> </tr> <% do until rs.EOF
'## Forum_SQL - Build SQL to get forums via category strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " &_ strTablePrefix & "FORUM.F_STATUS, " &_ strTablePrefix & "FORUM.CAT_ID, " &_ strTablePrefix & "FORUM.F_SUBJECT, " &_ strTablePrefix & "FORUM.F_URL, " &_ strTablePrefix & "FORUM.F_DESCRIPTION, " &_ strTablePrefix & "FORUM.F_TOPICS, " &_ strTablePrefix & "FORUM.F_COUNT, " &_ strTablePrefix & "FORUM.F_LAST_POST, " &_ strTablePrefix & "FORUM.F_TYPE, " &_ strTablePrefix & "FORUM.F_ORDER, " &_ strTablePrefix & "FORUM.F_PRIVATEFORUMS, " &_ strTablePrefix & "FORUM.F_A_COUNT, " &_ strMemberTablePrefix & "FORUM.F_SUBSCRIPTION, " &_ strMemberTablePrefix & "MEMBERS.MEMBER_ID, " &_ strMemberTablePrefix & "MEMBERS.M_NAME " &_ "FROM " & strTablePrefix & "FORUM " &_ "LEFT JOIN " & strMemberTablePrefix & "MEMBERS ON " &_ strTablePrefix & "FORUM.F_LAST_POST_AUTHOR = " &_ strMemberTablePrefix & "MEMBERS.MEMBER_ID " &_ " WHERE " & strTablePrefix & "FORUM.CAT_ID = " & rs("CAT_ID") & " " &_ " ORDER BY " & strTablePrefix & "FORUM.F_ORDER ASC" &_ ", " & strTablePrefix & "FORUM.F_SUBJECT ASC;"
set rsForum = Server.CreateObject("ADODB.Recordset") rsForum.open strSql, my_Conn do until rsForum.Eof if ChkDisplayForum(rsForum("FORUM_ID")) then Response.Write "" & vbNewline & _ "<tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><ul style=""margin-top: 0; margin-bottom: 0""><li><a href=""" if rsForum("F_TYPE") = 0 then Response.Write "forum.asp?FORUM_ID=" & rsForum("FORUM_ID") end if Response.Write """>" & chkString(rsForum("F_SUBJECT"),"display") & "</a></li></ul></font>" & vbNewline
end if ' ChkDisplayForum()
rsForum.MoveNext loop rsForum.close set rsForum = nothing
rs.MoveNext loop rs.close set rs = nothing %> </tr> </td> </table>
any idea to improve this code
|
|