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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Type Mismatch
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 03 October 2004 :  14:20:11  Show Profile  Visit MarcelG's Homepage
I've modded my forum a bit, and now I've encountered this problem:

I've included the code from active.asp in the header (inc_header.asp)
if strPrivateForums = "1" and mLev < 4 then
	allAllowedForums = ""
		
	allowSql = "SELECT FORUM_ID, F_PRIVATEFORUMS, F_PASSWORD_NEW"
	allowSql = allowSql & " FROM " & strTablePrefix & "FORUM"
	allowSql = allowSql & " WHERE F_TYPE = 0"
	allowSql = allowSql & " ORDER BY FORUM_ID"
	
	set rsAllowed = Server.CreateObject("ADODB.Recordset")
	rsAllowed.open allowSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
		
	if rsAllowed.EOF then
		recAllowedCount = ""
	else
		allAllowedData = rsAllowed.GetRows(adGetRowsRest)
		recAllowedCount = UBound(allAllowedData,2)
	end if
		
	rsAllowed.close
	set rsAllowed = nothing
		
	if recAllowedCount <> "" then
		fFORUM_ID = 0
		fF_PRIVATEFORUMS = 1
		fF_PASSWORD_NEW = 2
	
			for RowCount = 0 to recAllowedCount
					aForum_ID = allAllowedData(fFORUM_ID,RowCount)
					aForum_PrivateForums = allAllowedData(fF_PRIVATEFORUMS,RowCount)
					aForum_FPasswordNew = allAllowedData(fF_PASSWORD_NEW,RowCount)
		
				if mLev = 4 then
					ModerateAllowed = "Y"
				elseif mLev = 3 and ModOfForums <> "" then
					if (strAuthType = "nt") then
						if (chkForumModerator(aForum_ID, Session(strCookieURL & "username")) = "1") then ModerateAllowed = "Y" else ModerateAllowed = "N"
						else 
							if (instr("," & ModOfForums & "," ,"," & aForum_ID & ",") > 0) then ModerateAllowed = "Y" else ModerateAllowed = "N"
						end if
					else
						ModerateAllowed = "N"
					end if
				if ChkDisplayForum(aForum_PrivateForums,aForum_FPasswordNew,aForum_ID,MemberID) = true then
					if allAllowedForums = "" then
						allAllowedForums = aForum_ID
					else
						allAllowedForums = allAllowedForums & "," & aForum_ID
					end if
				end if
			next
			end if
	if allAllowedForums = "" then allAllowedForums = 0
end if

I've noticed that this code gives an error in all of my admin pages (unmodded), so I put this code around it:

IF (Instr(Request.ServerVariables("Path_Info"), "admin") <= 0) then
'insert the other code here
else
allAllowedForums = 0
end if

But, now I notice that this also gives errors in PM_DELETE.ASP (for deleting private messages).

The error is this:
Microsoft VBScript runtime error '800a000d' 

Type mismatch: 'ChkDisplayForum' 

/inc_header.asp, line 192

This refers to this line:
if ChkDisplayForum(aForum_PrivateForums,aForum_FPasswordNew,aForum_ID,MemberID) = true then

How can it be that this line gives a 'Type mismatch' in pm_delete.asp, while it doesn't in other pages ? And it does give errors on for instance admin_config_system.asp, down.asp etc.

I'm completely clueless.

Any hint would be very welcome.

portfolio - linkshrinker - oxle - twitter

laser
Advanced Member

Australia
3859 Posts

Posted - 03 October 2004 :  21:01:59  Show Profile
Type Mismatch typically means that the data types are mixed up. I'd guess that that ChkDisplayForum doesn't return a boolean result, but you then compare it to a boolean. You need to redefine the function, or the condition in the IF.
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 04 October 2004 :  02:07:08  Show Profile  Visit MarcelG's Homepage
Ah, I guess I found the problem.
The function ChkDisplayForum exists within inc_func_secure.asp, and thát file is not included in all the files mentioned.
So, I guess tháts the problem.

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 October 2004 :  22:41:04  Show Profile
That could do it
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