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)
 # of Web Links in Default.asp (+Source)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 12 April 2005 :  13:16:24  Show Profile
Hi, I have found a way to display Forum/Links from the default.asp page
into another page through ASP. (with syndication the javascript will not
be indexed in Google).

So, basically I allow Moderators (affiliates) to post up new Web Links
in real time, which will be displayed on an external page.

This external page is a stripped copy of Default.asp

What do I need to do to make Default.asp (in this case it's copy) to
show a set ammount of Forums/Topics?


Default.asp is set in a way to display ALL forums/weblinks, how
can I set it so it only displays the 10/20/30 last added?

Please HELP

Greets & thanks,

Dominic

CLPPR.com - All The News Only Seconds Away

Edited by - ILLHILL on 13 April 2005 18:06:36

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 13 April 2005 :  17:19:26  Show Profile
Ok, here's the code.
Any help would be deeply appreciated since this is the
last part I need to overcome.
Here's the source for my "Default.asp" clone, "NewsColumn.asp".

In While Default.asp may show all Web Links posted in my one category,
NewsColumn.asp is supposed to only show the last 20 Added Web Links.

Please help



<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header2.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<%
Dim UnapprovedFound, UnModeratedPosts

if Request.QueryString("CAT_ID") <> "" and IsNumeric(Request.QueryString("CAT_ID")) = True then
	Cat_ID = cLng(Request.QueryString("CAT_ID"))
end if

scriptname = request.servervariables("script_name")

if strAutoLogon = 1 then
	if (ChkAccountReg() <> "1") then
		Response.Redirect("register.asp?mode=DoIt")
	end if
end if

if IsEmpty(Session(strCookieURL & "last_here_date")) then
	Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
end if

if strModeration = "1" and mLev > 2 then
	UnModeratedPosts = CheckForUnmoderatedPosts("BOARD", 0, 0, 0)
end if

' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs
if MySubCount > 0 then
	strSubString = PullSubscriptions(0,0,0)
	strSubArray  = Split(strSubString,";")
	if uBound(strSubArray) < 0 then
		strBoardSubs = ""
		strCatSubs = ""
		strForumSubs = ""
	else
		strBoardSubs = strSubArray(0)
		strCatSubs = strSubArray(1)
		strForumSubs = strSubArray(2)
	end if
end If

if strShowStatistics <> "1" then

	'## Forum_SQL
	strSql = "SELECT P_COUNT, T_COUNT, U_COUNT " &_
		 " FROM " & strTablePrefix & "TOTALS"

	Set rs1 = Server.CreateObject("ADODB.Recordset")
	rs1.open strSql, my_Conn

	Users = rs1("U_COUNT")
	Topics = rs1("T_COUNT")
	Posts = rs1("P_COUNT")

	rs1.Close
	set rs1 = nothing
end if

if (strShowModerators = "1") or (mlev = 4 or mlev = 3) then
	'## Forum_SQL
	strSql = "SELECT MO.FORUM_ID, ME.MEMBER_ID, ME.M_NAME " & _
		 " FROM " & strTablePrefix & "MODERATOR MO" & _
		 " , " & strMemberTablePrefix & "MEMBERS ME"  & _
		 " WHERE (MO.MEMBER_ID = ME.MEMBER_ID )" & _
		 " ORDER BY MO.FORUM_ID, ME.M_NAME"

	Set rsChk = Server.CreateObject("ADODB.Recordset")
	rsChk.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rsChk.EOF then
		recModeratorCount = ""
	else
		allModeratorData = rsChk.GetRows(adGetRowsRest)
		recModeratorCount = UBound(allModeratorData,2)
	end if

	rsChk.close
	set rsChk = nothing

	if recModeratorCount = "" then
		fMods = " "
	else
		mFORUM_ID = 0
		mMEMBER_ID = 1
		mM_NAME = 2

		for iModerator = 0 to recModeratorCount
			ModForumID = allModeratorData(mFORUM_ID, iModerator)
			ModMemID = allModeratorData(mMEMBER_ID, iModerator)
			ModMemName = replace(allModeratorData(mM_NAME, iModerator),"|","#124")

			if iModerator = 0 then
				strForumMods = ModForumID & "," & ModMemID & "," & ModMemName
			else
				strForumMods = strForumMods & "|" & ModForumID & "," & ModMemID & "," & ModMemName
			end if
		next
	end if
end if

'## Forum_SQL - Get all Categories from  the DB
strSql = "SELECT CAT_ID, CAT_STATUS, CAT_NAME, CAT_ORDER, CAT_SUBSCRIPTION, CAT_MODERATION " &_
	 " FROM " & strTablePrefix & "CATEGORY "
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
	strSql = strSql & " WHERE CAT_ID = " & Cat_ID
else
	if Group > 1 and strGroupCategories = "1" then
		strSql = strSql & " WHERE CAT_ID = 0"
		if recGroupCatCount <> "" then
			for iGroupCat = 0 to recGroupCatCount
				strSql = strSql & " or CAT_ID = " & allGroupCatData(1, iGroupCat)
			next
		end if
	end if
end if
'############################## Group Cat MoD #####################################
strSql = strSql & " ORDER BY CAT_ORDER DESC, CAT_NAME DESC;"

set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

if rs.EOF then
	if Cat_ID <> "" then response.redirect("default.asp")
	recCategoryCount = ""
else
	allCategoryData = rs.GetRows(adGetRowsRest)
	recCategoryCount = UBound(allCategoryData,2)
end if

rs.close
set rs = nothing

if mlev = 3 then
	strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "MODERATOR " & _
		 " WHERE MEMBER_ID = " & MemberID

	Set rsMod = Server.CreateObject("ADODB.Recordset")
	rsMod.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rsMod.EOF then
		recModCount = ""
	else
		allModData = rsMod.GetRows(adGetRowsRest)
		recModCount = UBound(allModData,2)
	end if

	RsMod.close
	set RsMod = nothing

	if recModCount <> "" then
		for x = 0 to recModCount
			if x = 0 then
				ModOfForums = allModData(0,x)
			else
				ModOfForums = ModOfForums & "," & allModData(0,x)
			end if
		next
	else
		ModOfForums = ""
	end if
else
	ModOfForums = ""
end if

'## Forum_SQL - Build SQL to get forums via category
strSql = "SELECT F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_
	 "F.F_COUNT, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, F.F_LAST_POST_REPLY_ID, F.F_TYPE, " & _
	 "F.F_ORDER, F.F_A_COUNT, F.F_SUBSCRIPTION, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
	 "M.MEMBER_ID, M.M_NAME, " & _
         "T.T_REPLIES, T.T_UREPLIES, " & _
         "F.F_DESCRIPTION " & _
	 "FROM ((" & strTablePrefix & "FORUM F " &_
	 "LEFT JOIN " & strMemberTablePrefix & "MEMBERS M ON " &_
	 "F.F_LAST_POST_AUTHOR = M.MEMBER_ID) " & _
         "LEFT JOIN " & strTablePrefix & "TOPICS T ON " & _
         "F.F_LAST_POST_TOPIC_ID = T.TOPIC_ID) "
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
	strSql = strSql & " WHERE F.CAT_ID = " & Cat_ID
else
	if Group > 1 and strGroupCategories = "1" then
		strSql = strSql & " WHERE F.CAT_ID = 0"
		if recGroupCatCount <> "" then
			for iGroupCat = 0 to recGroupCatCount
				strSql = strSql & " OR F.CAT_ID = " & allGroupCatData(1, iGroupCat)
			next
		end if
	end if
end if
'############################## Group Cat MoD #####################################
strSql = strSql & " ORDER BY F.F_ORDER DESC, F.F_LAST_POST DESC;"
set rsForum = Server.CreateObject("ADODB.Recordset")
rsForum.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsForum.EOF then
	recForumCount = ""

else
	allForumData = rsForum.GetRows(adGetRowsRest)
	recForumCount = UBound(allForumData,2)
end if

rsForum.close
set rsForum = nothing


if Cat_ID <> "" then
	Cat_Name = allCategoryData(2,0)
	Response.Write	"      <script language=""javascript"" type=""text/javascript"">" & vbNewLine & _
			"      document.title='" & chkString(Cat_Name,"pagetitle") & " - " & chkString(strForumTitle,"pagetitle") & "';" & vbNewLine & _
			"      </script>" & vbNewLine
end if
Response.Write	"      <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewline & _
		"        <tr>" & vbNewline & _
		"          <td>"
' If Whole Board Subscription is allowed, check for a subscription by this user.
if strSubscription = 1 and strEmail = 1 and strDBNTUserName <> "" then
	Response.Write	vbNewLine
	Response.Write 	"            <table width=""100%"" border=""0"">" & vbNewline
	Response.Write 	"              <tr>" & vbNewLine
	Response.Write	"                <td align=""right"">"
	If strBoardSubs = "Y" then
		Response.Write ShowSubLink ("U", 0, 0, 0, "Y")
	Else
		Response.Write ShowSubLink ("S", 0, 0, 0, "Y")
	End If
   	Response.Write 	"</td>" & vbNewLine
   	Response.Write	"              </tr>" & vbNewline
   	Response.Write  "            </table>" & vbNewline
   	Response.Write 	"          </td>" & vbNewline
	Response.Write 	"        </tr>" & vbNewline
   	Response.Write 	"        <tr>" & vbNewline
   	Response.Write 	"          <td>"
end if

ShowLastHere = (mLev > 0)
if strShowStatistics <> "1" then
	Response.Write	vbNewLine & _
			"            <table width=""100%"" border=""0"">" & vbNewline & _
			"              <tr>" & vbNewline & _
			"                <td>"
	if ShowLasthere then 
		Response.Write	"<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>You Last Visited - " & ChkDate(Session(strCookieURL & "last_here_date"), " " ,true) & "</font>"
	else
		Response.Write	" "
	end if 
	Response.Write	"</td>" & vbNewline & _
			"                <td align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>There are " & Posts & " Posts in " & Topics & " Topics and " & Users & " Users  </font></td>" & vbNewline & _
			"              </tr>" & vbNewline & _
			"            </table>" & vbNewline & _
			"          </td>" & vbNewline
else
	intPostCount  = 0
	intTopicCount = 0
	intForumCount = 0
	strLastPostDate = ""

	cCAT_ID = 0
	cCAT_STATUS = 1
	cCAT_NAME = 2
	cCAT_ORDER = 3
	cCAT_SUBSCRIPTION = 4
	cCAT_MODERATION = 5

	fFORUM_ID = 0
	fF_STATUS = 1
	fCAT_ID = 2
	fF_SUBJECT = 3
	fF_URL = 4
	fF_TOPICS = 5
	fF_COUNT = 6
	fF_LAST_POST = 7
	fF_LAST_POST_TOPIC_ID = 8
	fF_LAST_POST_REPLY_ID = 9
	fF_TYPE = 10
	fF_ORDER = 11
	fF_A_COUNT = 12
	fF_SUBSCRIPTION = 13
	fF_PRIVATEFORUMS = 14
	fF_PASSWORD_NEW = 15
	fMEMBER_ID = 16
	fM_NAME = 17
	fT_REPLIES = 18
	fT_UREPLIES = 19
	fF_DESCRIPTION = 20

	blnHiddenForums = false
	for iCategory = 0 to recCategoryCount
		CatID = allCategoryData(cCAT_ID,iCategory)
		CatStatus = allCategoryData(cCAT_STATUS,iCategory)
		CatName = allCategoryData(cCAT_NAME,iCategory)
		CatOrder = allCategoryData(cCAT_NAME,iCategory)
		CatSubscription = allCategoryData(cCAT_SUBSCRIPTION,iCategory)
		CatModeration = allCategoryData(cCAT_MODERATION,iCategory)

		chkDisplayHeader = true
				 
		bContainsForum = False
		if recForumCount <> "" then
			for iForumCheck = 0 to recForumCount
				if CatID = allForumData(fCAT_ID, iForumCheck) then bContainsForum = True
			next

			for iForum = 0 to recForumCount
				if CatID = allForumData(fCAT_ID, iForum) then '## Forum exists
					ForumID = allForumData(fFORUM_ID,iForum)
					ForumStatus = allForumData(fF_STATUS,iForum)
					ForumCatID = allForumData(fCAT_ID,iForum)
					ForumSubject = allForumData(fF_SUBJECT,iForum)
					ForumURL = allForumData(fF_URL,iForum)
					ForumTopics = allForumData(fF_TOPICS,iForum)
					ForumCount = allForumData(fF_COUNT,iForum)
					ForumLastPost = allForumData(fF_LAST_POST,iForum)
					ForumLastPostTopicID = allForumData(fF_LAST_POST_TOPIC_ID,iForum)
					ForumLastPostReplyID = allForumData(fF_LAST_POST_REPLY_ID,iForum)
					ForumFType = allForumData(fF_TYPE,iForum)
					ForumOrder = allForumData(fF_ORDER,iForum)
					ForumACount = allForumData(fF_A_COUNT,iForum)
					ForumSubscription = allForumData(fF_SUBSCRIPTION,iForum)
					ForumPrivateForums = allForumData(fF_PRIVATEFORUMS,iForum)
					ForumFPasswordNew = allForumData(fF_PASSWORD_NEW,iForum)
					ForumMemberID = allForumData(fMEMBER_ID,iForum)
					ForumMemberName = allForumData(fM_NAME,iForum)
					ForumTopicReplies = allForumData(fT_REPLIES,iForum)
					ForumTopicUReplies = allForumData(fT_UREPLIES,iForum)
					ForumDescription = allForumData(fF_DESCRIPTION,iForum)

					Dim AdminAllowed, ModerateAllowed
					if mLev = 4 then
						AdminAllowed = "Y"
					else
					    	AdminAllowed = "N"
					end if
					if mLev = 4 then
						ModerateAllowed = "Y"
					elseif mLev = 3 and ModOfForums <> "" then
						if (strAuthType = "nt") then
							if (chkForumModerator(ForumID, Session(strCookieURL & "username")) = "1") then ModerateAllowed = "Y" else ModerateAllowed = "N"
						else 
							if (instr("," & ModOfForums & "," ,"," & ForumID & ",") <> 0) then ModerateAllowed = "Y" else ModerateAllowed = "N"
						end if
					else
						ModerateAllowed = "N"
					end if
					if ModerateAllowed = "Y" and ForumTopicUReplies > 0 then
						ForumTopicReplies = ForumTopicReplies + ForumTopicUReplies
					end if
					if ChkDisplayForum(ForumPrivateForums,ForumFPasswordNew,ForumID,MemberID) then
						if ForumFType <> "1" then 
							intPostCount  = intPostCount + ForumCount
							intTopicCount = intTopicCount + ForumTopics
							intForumCount = 10
							if ForumLastPost > strLastPostDate then 
								strLastPostDate = ForumLastPost
								intLastPostTopic_ID = ForumLastPostTopicID
								intLastPostReply_ID = ForumLastPostReplyID
								intTopicReplies = ForumTopicReplies
								intLastPostForum_ID = ForumID
								intLastPostMember_ID = ForumMemberID
								strLastPostMember_Name = ForumMemberName
							end if
						end if
							if ForumFType = 0 then
								ChkIsNew(ForumLastPost)
							else 
								Response.Write	""
							end if 
							Response.Write	"</td>" & vbNewline & _
									"                <td"
							if ForumFType = 1 then
								Response.Write	" colspan=""4"""
							end if
							Response.Write	" bgcolor=""" & strForumCellColor & """ valign=""top"">" & _
									"<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><span class=""spnMessageText""><a href="""
							if ForumFType = 0 then
								Response.Write	"forum.asp?FORUM_ID=" & ForumID
							else 
								Response.Write	ForumURL & """ target=""_blank"
							end if 
							Response.Write	""">" & chkString(ForumSubject,"display") & "</a><br /><br>" & _
									"<font size=""" & strFooterFontSize & """>" & _
									formatStr(ForumDescription) & _
									"</font></span></font></td>" & vbNewline
							if ForumFType = 0 then
								if IsNull(ForumTopics) then 
									Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>0</font></td>" & vbNewline
								else
									Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & ForumTopics & "</font></td>" & vbNewline
								end if 
								if IsNull(ForumCount) then 
									Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>0</font></td>" & vbNewline
								else
									Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & ForumCount & "</font></td>" & vbNewline
								end if 
								if IsNull(ForumMemberID) then
									strLastUser = " "
								else
									strLastUser = "<br />by: <span class=""spnMessageText"">" & profileLink(chkString(ForumMemberName,"display"),ForumMemberID) & "</span>"
									if strJumpLastPost = "1" then strLastUser = strLastUser & " " & DoLastPostLink(true)
								end if
								Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top"" nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """>" & _
										"<b>" & ChkDate(ForumLastPost, "</b><br />" ,true) & strLastUser & "</font></td>" & vbNewline
							else 
								'## Do Nothing 

							end if
							Response.Write	"</td>" & vbNewline
							Response.Write	"              </tr>" & vbNewline
						end if ' ##### Added as part of Minimize Category Mod #####					
					else
						blnHiddenForums = true
					end if ' ChkDisplayForum() 

			next '## Next Forum
		end if
	next '## Next Category
end if 
Response.Write	"            </table>" & vbNewline & _
		"          </td>" & vbNewline & _
		"        </tr>" & vbNewline & _
		"        <tr>" & vbNewline & _
		"          <td>" & vbNewline & _
		"          </td>" & vbNewline & _
		"        </tr>" & vbNewline & _
		"      </table>" & vbNewline
WriteFooter

sub ChkIsNew(dt)
	Response.Write	"<a href=""forum.asp?FORUM_ID=" & ForumID & """>"
	if CatStatus <> 0 and ForumStatus <> 0 then
		if dt > Session(strCookieURL & "last_here_date") and (ForumCount > 0 or ForumTopics > 0) then
			Response.Write	getCurrentIcon(strIconFolderNew,"New Posts","hspace=""0""") & "</a>"
		else
			Response.Write	getCurrentIcon(strIconFolder,"Old Posts","hspace=""0""") & "</a>"
		end if
	elseif ForumLastPost > Session(strCookieURL & "last_here_date") then
		if CatStatus = 0 then
			strAltText = "Category Locked"
		else
			strAltText = "Forum Locked"
		end if
		Response.Write	getCurrentIcon(strIconFolderNewLocked,strAltText,"hspace=""0""") & "</a>"
	else
		if CatStatus = 0 then
			strAltText = "Category Locked"
		else
			strAltText = "Forum Locked"
		end if
		Response.Write	getCurrentIcon(strIconFolderLocked,strAltText,"hspace=""0""") & "</a>"
	end if
end sub

%>




Greets & thanks,

Dominic

CLPPR.com - All The News Only Seconds Away

Edited by - ILLHILL on 13 April 2005 18:06:07
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 13 April 2005 :  18:11:21  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Amend whatever sql you are using to use the top keyword
(I'm not sure what table & columns you're using so you will have to experiment yourself)

e.g. something like this

select top 30 * from table where link_column is not null order by date desc
 select top 30 linkname, httplink order by dateadded desc

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 13 April 2005 :  19:17:52  Show Profile
Wow, I will experiment with that. Any pointers?

Here's the part I changed to get the Links to display by Descending Post date:


'## Forum_SQL - Build SQL to get forums via category
strSql = "SELECT F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_
"F.F_COUNT, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, F.F_LAST_POST_REPLY_ID, F.F_TYPE, " & _
"F.F_ORDER, F.F_A_COUNT, F.F_SUBSCRIPTION, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
"M.MEMBER_ID, M.M_NAME, " & _
"T.T_REPLIES, T.T_UREPLIES, " & _
"F.F_DESCRIPTION " & _
"FROM ((" & strTablePrefix & "FORUM F " &_
"LEFT JOIN " & strMemberTablePrefix & "MEMBERS M ON " &_
"F.F_LAST_POST_AUTHOR = M.MEMBER_ID) " & _
"LEFT JOIN " & strTablePrefix & "TOPICS T ON " & _
"F.F_LAST_POST_TOPIC_ID = T.TOPIC_ID) "
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
strSql = strSql & " WHERE F.CAT_ID = " & Cat_ID
else
if Group > 1 and strGroupCategories = "1" then
strSql = strSql & " WHERE F.CAT_ID = 0"
if recGroupCatCount <> "" then
for iGroupCat = 0 to recGroupCatCount
strSql = strSql & " OR F.CAT_ID = " & allGroupCatData(1, iGroupCat)
next
end if
end if
end if
'############################## Group Cat MoD #####################################
strSql = strSql & " ORDER BY F.F_ORDER DESC, F.F_LAST_POST DESC;"
set rsForum = Server.CreateObject("ADODB.Recordset")
rsForum.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsForum.EOF then
recForumCount = ""


Any pointers where to add your part?

strSql = "SELECT F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_ ?

Greets & thanks so much

Dominic

CLPPR.com - All The News Only Seconds Away
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 13 April 2005 :  20:00:02  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I didn't see your code the first time. I must have been typing when you edited it.

Try this for 20 links (at the top of the code in your last post)

'## Forum_SQL - Build SQL to get forums via category
strSql = "SELECT TOP 20 F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_

You don't need 1/10th of the query above either. You're selecting things you don't need but if it works it works. You can optimise it later.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 13 April 2005 :  20:05:07  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
I recommend using the Snitz function Function TopSQL(strSQL, lngRecords).

Once you have built your sql string, pass it on to the function along with the number of items you want the query to return.

For example, if you would like to retrieve 10 items, put this code before you execute the query:
strSql = TopSQL(strSql, 10)


Hope that helps.

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 13 April 2005 :  20:46:16  Show Profile
Hi OneWayMule, I haven't had the chance to try your advice, because Podge's
worked perfectly. Still, thank you for your advice.

Podge, you are my hero if you ever run for president, let me know

Thanks to your help I managed to finish this project before the deadline I have set

Thank you very, very much!

Greets & thanks,

Dominic

CLPPR.com - All The News Only Seconds Away
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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07