Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Esay way to display forums in portal
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ez4arab
Junior Member

479 Posts

Posted - 18 June 2002 :  17:47:43  Show Profile  Visit Ez4arab's Homepage
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

crash
Advanced Member

Netherlands
2064 Posts

Posted - 18 June 2002 :  18:53:21  Show Profile  Visit crash's Homepage
why don't you use the Slash MOD?



Crash's Site | Crash is from
Go to Top of Page

Ez4arab
Junior Member

479 Posts

Posted - 18 June 2002 :  19:02:51  Show Profile  Visit Ez4arab's Homepage
maybe your are miss understand this code will show the name of forums for example

All forum
  • MOD Completed Add-Ons
  • MOD Add-On Forum (W/Code)
  • MOD Add-On Forum (W/O Code)


i hope this clear for u

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07