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
 Weblink Issue
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 20 May 2016 :  07:26:31  Show Profile  Reply with Quote
Here's an excerpt from "post_info.asp":


If MethodType = "URL" Then
	Err.Clear
	On Error Resume Next
	member = CLng(ChkUser(strDBNTUserName, strPassword,-1))
	Select Case Member
		Case 0 '## Invalid Pword
			Go_Result "Invalid password or username.", 0
			Response.End
		Case 1 '## Author of Post
			'## Do Nothing
		Case 2 '## Normal User - Not Authorised
			Go_Result "Only an admin can create a web link.", 0
			Response.End
		Case 3 '## Moderator
			Go_Result "Only an admin can create a web link.", 0
			Response.End
		Case 4,5 '## Admin
			'## Do Nothing
		Case Else
			Go_Result CStr(Member), 0
			Response.End
	End Select
	txtMessage = ChkString(Request.Form("Message"),"message")
	txtAddress = ChkString(Request.Form("Address"),"SQLString")
	txtSubject = ChkString(Request.Form("Subject"),"SQLString")
	If strBadWordFilter = "1" Then
		txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
	End If
	Err_Msg = ""
	If txtSubject = " " Then
		Err_Msg = Err_Msg & "<li>You must enter a subject for the new URL.</li>"
	End If
	If txtAddress = " " Or LCase(txtAddress) = "http://" Or LCase(txtAddress) = "https://" Or LCase(txtAddress) = "file:///" Then
		Err_Msg = Err_Msg & "<li>You must enter an address for the new URL.</li>"
	End If
	If (Left(LCase(txtAddress), 7) <> "http://" And Left(LCase(txtAddress), 8) <> "https://" And Left(LCase(txtAddress), 5) <> "ftp://" And Left(LCase(txtAddress), 8) <> "file:///") And txtAddress <> "" Then
		Err_Msg = Err_Msg & "<li>You must prefix the address with <b>http://</b>, <b>https://</b>, <b>ftp://</b>, or <b>file:///</b></li>"
	End If
	If Err_Msg = "" Then
		strSql = "INSERT INTO " & strTablePrefix & "FORUM "
		strSql = strSql & "(CAT_ID"
		'	##	Sub-Forum Below
		If IsNull(intSetParent) = False Then
			strSql = strSql & ", F_PARENT"
		End If
		'	##	Sub-Forum Above
		strSql = strSql & ", F_STATUS"
		if strPrivateForums = "1" then
			strSql = strSql & ", F_PRIVATEFORUMS"
		end if
		strSql = strSql & ", F_LAST_POST"
		strSql = strSql & ", F_LAST_POST_AUTHOR"
		strSql = strSql & ", F_SUBJECT"
		strSql = strSql & ", F_URL"
		strSql = strSql & ", F_DESCRIPTION"
		strSql = strSql & ", F_TYPE"
		strSql = strSql & ", F_L_ARCHIVE"
		strSql = strSql & ", F_ARCHIVE_SCHED"
		strSql = strSql & ", F_L_DELETE"
		strSql = strSql & ", F_DELETE_SCHED"
		strSql = strSql & ", F_SUBSCRIPTION, F_MODERATION"
		strSql = strSql & ", F_ORDER"
		strSql = strSql & ", F_DEFAULTDAYS"
		strSql = strSql & ") VALUES ("
		strSql = strSql & CAT_ID
		'	##	Sub-Forum Below
		If IsNull(intSetParent) = False Then
			strSql = strSql & ", " & intSetParent
		End If
		'	##	Sub-Forum Above
		strSql = strSql & ", 1"
		if strPrivateForums = "1" then
			strSql = strSql & ", " & ChkString(Request.Form("AuthType"), "SQLString") & ""
		end if
		strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
		strSql = strSql & ", " & MemberID
		strSql = strSql & ", " & "'" & txtSubject & "'"
		strSql = strSql & ", " & "'" & txtAddress & "'"
		strSql = strSql & ", " & "'" & txtMessage & "'"
		strSql = strSql & ", 1"
		strSql = strSql & ", ''"
		strSql = strSql & ", 30"
		strSql = strSql & ", ''"
		strSql = strSql & ", 365"
		strSql = strSql & ", 0, 0"
		strSql = strSql & ", 1"
		strSql = strSql & ", 30"
		strSql = strSql & ") "
'		Response.Write	strSql
'		Response.End
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		Application.Lock
		Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
		Application.UnLock
		err_Msg = ""
		If Err.Description <> "" Then
			Go_Result strSql & "<br />There was an error = " & Err.Description, 0
			Response.End
		Else
			Set rsCount = my_Conn.Execute("SELECT MAX(FORUM_ID) AS maxForumID FROM " & strTablePrefix & "FORUM ")
			newForumMembers rsCount("maxForumId")
			'	##	Usergroups Below
			If intMod161 = "1" Then
				newUGPerms rsCount("maxForumId")
			End If
			'	##	Usergroups Above
			newForumModerators rsCount("maxForumId")
			Set rsCount = Nothing
			Go_Result	"Updated OK", 1
		End If
	Else
		Response.Write	"			<p align=""center""><font family=""" & strDefaultFontFamily & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There was a problem with your details.</font></p>" & vbNewLine & _
			"			<table align=""center"" border=""0"">" & vbNewLine & _
			"				<tr>" & vbNewLine & _
			"					<td><font family=""" & strDefaultFontFamily & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"			<p align=""center""><font family=""" & strDefaultFontFamily & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go back to enter data.</a></font></p>" & vbNewLine
	End If
End If


Now, here's the result:

There has been a problem!

INSERT INTO FORUM_FORUM (CAT_ID, F_PARENT, F_STATUS, F_PRIVATEFORUMS, F_LAST_POST, F_LAST_POST_AUTHOR, F_SUBJECT, F_URL, F_DESCRIPTION, F_TYPE, F_L_ARCHIVE, F_ARCHIVE_SCHED, F_L_DELETE, F_DELETE_SCHED, F_SUBSCRIPTION, F_MODERATION, F_ORDER, F_DEFAULTDAYS) VALUES (3, , 1, 0, '20160520170043', 1, 'Snitz Forums', 'http://forum.snitz.com/forum', 'Snitz Forums 2000', 1, '', 30, '', 365, 0, 0, 1, 30)
There was an error = Syntax error in INSERT INTO statement.

Go back to correct the problem.




I've looked at this until I went cross-eyed. Can't see the issue.

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 May 2016 :  08:06:58  Show Profile  Visit HuwR's Homepage
My gues is this bit here
INSERT INTO FORUM_FORUM (CAT_ID, F_PARENT, F_STATUS, F_PRIVATEFORUMS, F_LAST_POST ....
VALUES (3,There should be either a value or NULL here , 1, 0, '20160520170043'

As you can see, there is no value for F_PARENT in the corresponding VALUES section
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 20 May 2016 :  09:46:55  Show Profile
Found it. It was actually caused by another section of code, a method_type comparison didn't include URLs.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07