intMPosts=0
set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute(strSql)
if not rs.BOF and not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 10 then
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
else
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
<%
intMPosts=0
set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute(strSql)
if not rs.BOF and not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 10 then
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
else
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
%>
%>
<!--#INCLUDE file="inc_minposts.asp" -->
<%
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/forumtest/inc_minposts.asp, line 3
strSql = strSql & " set rs = my_Conn.Execute (strSql)
-----------------------------------------------------^Dim mLev, strLoginStatus, MemberID, strArchiveTablePrefix, intMemberPostsfunction chkUser(fName, fPassword, fAuthor)
dim rsCheck
dim strSql
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_LEVEL, M_NAME, M_PASSWORD, M_POSTS "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fName, "SQLString") & "' "
if strAuthType="db" then
strSql = strSql & " AND M_PASSWORD = '" & ChkString(fPassword, "SQLString") &"'"
End If
strSql = strSql & " AND M_STATUS = " & 1
Set rsCheck = my_Conn.Execute(strSql)
if rsCheck.BOF or rsCheck.EOF or not(ChkQuoteOk(fName)) or not(ChkQuoteOk(fPassword)) then
MemberID = -1
intMemberPosts=0
chkUser = 0 '## Invalid Password
if strDBNTUserName <> "" and chkCookie = 1 then
Call ClearCookies()
strDBNTUserName = ""
end if
else
MemberID = rsCheck("MEMBER_ID")
intMemberPosts=clng(rsCheck("M_POSTS"))
strDBNTUserName = rsCheck("M_NAME")
if (rsCheck("MEMBER_ID") & "" = fAuthor & "") and (cLng(rsCheck("M_LEVEL")) <> 3) then
chkUser = 1 '## Author
else
select case cLng(rsCheck("M_LEVEL"))
case 1
chkUser = 2 '## Normal User
case 2
chkUser = 3 '## Moderator
case 3
chkUser = 4 '## Admin
case else
chkUser = cLng(rsCheck("M_LEVEL"))
end select
end if
end if
rsCheck.close
set rsCheck = nothing
end functionOriginally posted by leatherlips
Carefree,
Now I am getting this text on top of the page I have added it to:
Insufficient posts to view this page. META HTTP-EQUIV="refresh" CONTENT="7; url="javascript:history.back()">Return to previous page.
It also has all of the normal content of the page displaying.
Shaggy,
I do not know how to do what you are asking. However, the page I am trying Carefree's code on does not have inc_header.asp in it. It instead has inc_header_short.asp. Perhaps that is why I am having a problem?
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.04
'#################################################################################
'## Copyright (C) 2000-04 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
'##
'#################################################################################
'#
'# proeder's file attachment V1.2 for Snitz Forums - Support can be obtained from
'# http://demoforum.sharepointing.com
'# Author: Philipp Roeder (post@proeder.com)
'#
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE file="inc_func_common.asp" -->
<!--#INCLUDE file="inc_header_short.asp" -->
<%
if strDBNTUserName <> "" then
if Request("Method_Type") = "Write_Configuration" then
Err_Msg = Request.QueryString("Err_Msg")
if Err_Msg <> "" then
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>There Was A Problem With Your Details</font></p>" & vbNewline & _
"<table bgColor=""" & strHeadCellColor & """ align=""center"" border=""0"">" & vbNewline & _
" <tr>" & vbNewline & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewline & _
" <ul>" & vbNewline & _
"" & Err_Msg &"" & vbNewline & _
" </ul>" & vbNewline & _
" </font>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td align=""center"">" & vbNewline & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""#"" onclick=""javascript:history.go(-1)"">Go Back To Enter Data</a></font>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
"</table>" & vbNewline
end if
else
'##### check max file size
strSQL = "SELECT UPLOAD_VALUE FROM " & strTablePrefix & "UPSIZE WHERE UPLOAD_VAR = 'STRUPLOADFILESIZE'"
set rsSize = my_Conn.Execute (strSQL)
strAllowedSize = rsSize("UPLOAD_VALUE")
if bytecount < strAllowedSize then
AllowSize = true
else
AllowSize = false
end if
rsSize.close
set rsSize = nothing
If strAllowedSize < 1024 Then
strAllowedSize = Round(strAllowedSize,2) & " Bytes"
ElseIf strAllowedSize < 1048576 Then
strAllowedSize = Round(strAllowedSize/1024,2) & " KB"
Else
strAllowedSize = Round(strAllowedSize/1048576,2) & " MB"
End If
%>
<!--#INCLUDE file="inc_minposts.asp" -->
<%
Response.Write "<script language=""javascript"" src=""uploadprogressbar.js""></script>"
Response.Write " <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Add attachment to topic</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><br>You may upload any of the following file extensions:</font>" & vbNewLine
Call AllowedExtensions()
Response.Write " <br><br></td>" &vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><br>The maximum allowed file size is " & strAllowedSize & ".</font><br><br></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><br><FORM METHOD=""Post"" ENCTYPE=""multipart/form-data"" ACTION=""outputFile.asp"">" & vbNewLine & _
"<INPUT TYPE=""file"" NAME=""blob"" size=""40"">" & vbNewLine & _
"<input type=""hidden"" name=""memberName"" value=""" & strDBNTUserName & """>" & vbNewLine & _
"<br><br><INPUT TYPE=""submit"" NAME=""Enter"" value=""Upload and Insert File in Post"" onclick=""value='Upload in Progress. Please wait...'; javascript:bar1.showBar()"" ></FORM>" & vbNewLine & _
" <script type=""text/javascript"">var bar1= createBar(300,15,'white',1,'black','blue',85,7,3,"""");bar1.hideBar();</script></td>" & vbNewLine & _
" </tr>" & vbNewLine
' " <tr>" & vbNewLine & _
' " <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>You may select a previously uploaded file from your upload directory as well:</font></td>" & vbNewLine & _
' " </tr>" & vbNewLine & _
' " <tr>" & vbNewLine & _
' " <td><input name=""PreviousFile"" type=""button"" value=""Reuse File"" onclick=""JavaScript:window.location=('myfiles.asp?InsertFile=select');""></td>" & vbNewLine & _
' " </tr>" & vbNewLine & _
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
end if
else
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>You must be logged on to see this page!</font></p>" & vbNewline
end if
function AllowedExtensions()
'##### check allowed extensions
Dim bolExtFound, arrExt, rsExt, iExt
strSQL = "SELECT EXTENSION FROM FORUM_CONFIG_EXTENSION"
set rsExt = my_Conn.Execute (strSQL)
If Not rsExt.EOF Then
arrExt = rsExt.GetRows()
bolExtFound = True
Else
bolExtFound = False
End If
rsExt.close
set rsExt = nothing
If bolExtFound Then
For iExt = 0 to ubound(arrExt, 2)
iExtension = arrExt(0, iExt)
response.write "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & iExtension & " </font>"
next
else
response.write "<br><p align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>There are no extensions defined yet. Please contact the <a href=""mailto:" & strSender & """>Administrator</a> of the forum.</font></p>"
end if
'erase arrExt
end function
Response.Write " <center><br><form><input type=button value=""Close Window"" onClick=""javascript:window.close();""></form></center>" & vbNewLine
%>
<%
intMPosts=0
set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute(strSql)
if not rs.BOF and not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 10 then
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
else
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End
end if
%>
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.04
'#################################################################################
'## Copyright (C) 2000-04 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
'##
'#################################################################################
'#
'# proeder's file attachment V1.2 for Snitz Forums - Support can be obtained from
'# http://demoforum.sharepointing.com
'# Author: Philipp Roeder (post@proeder.com)
'#
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE file="inc_func_common.asp" -->
<!--#INCLUDE file="inc_header_short.asp" -->
<!--#INCLUDE file="inc_minposts.asp" -->
<%
if strDBNTUserName <> "" then
if Request("Method_Type") = "Write_Configuration" then
Err_Msg = Request.QueryString("Err_Msg")
if Err_Msg <> "" then
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>There Was A Problem With Your Details</font></p>" & vbNewline & _
"<table bgColor=""" & strHeadCellColor & """ align=""center"" border=""0"">" & vbNewline & _
" <tr>" & vbNewline & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewline & _
" <ul>" & vbNewline & _
"" & Err_Msg &"" & vbNewline & _
" </ul>" & vbNewline & _
" </font>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td align=""center"">" & vbNewline & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""#"" onclick=""javascript:history.go(-1)"">Go Back To Enter Data</a></font>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
"</table>" & vbNewline
end if
else
'##### check max file size
strSQL = "SELECT UPLOAD_VALUE FROM " & strTablePrefix & "UPSIZE WHERE UPLOAD_VAR = 'STRUPLOADFILESIZE'"
set rsSize = my_Conn.Execute (strSQL)
strAllowedSize = rsSize("UPLOAD_VALUE")
if bytecount < strAllowedSize then
AllowSize = true
else
AllowSize = false
end if
rsSize.close
set rsSize = nothing
If strAllowedSize < 1024 Then
strAllowedSize = Round(strAllowedSize,2) & " Bytes"
ElseIf strAllowedSize < 1048576 Then
strAllowedSize = Round(strAllowedSize/1024,2) & " KB"
Else
strAllowedSize = Round(strAllowedSize/1048576,2) & " MB"
End If
Response.Write "<script language=""javascript"" src=""uploadprogressbar.js""></script>"
Response.Write " <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Add attachment to topic</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><br>You may upload any of the following file extensions:</font>" & vbNewLine
Call AllowedExtensions()
Response.Write " <br><br></td>" &vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><br>The maximum allowed file size is " & strAllowedSize & ".</font><br><br></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ align=""center""><br><FORM METHOD=""Post"" ENCTYPE=""multipart/form-data"" ACTION=""outputFile.asp"">" & vbNewLine & _
"<INPUT TYPE=""file"" NAME=""blob"" size=""40"">" & vbNewLine & _
"<input type=""hidden"" name=""memberName"" value=""" & strDBNTUserName & """>" & vbNewLine & _
"<br><br><INPUT TYPE=""submit"" NAME=""Enter"" value=""Upload and Insert File in Post"" onclick=""value='Upload in Progress. Please wait...'; javascript:bar1.showBar()"" ></FORM>" & vbNewLine & _
" <script type=""text/javascript"">var bar1= createBar(300,15,'white',1,'black','blue',85,7,3,"""");bar1.hideBar();</script></td>" & vbNewLine & _
" </tr>" & vbNewLine
' " <tr>" & vbNewLine & _
' " <td bgcolor=""" & strForumCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>You may select a previously uploaded file from your upload directory as well:</font></td>" & vbNewLine & _
' " </tr>" & vbNewLine & _
' " <tr>" & vbNewLine & _
' " <td><input name=""PreviousFile"" type=""button"" value=""Reuse File"" onclick=""JavaScript:window.location=('myfiles.asp?InsertFile=select');""></td>" & vbNewLine & _
' " </tr>" & vbNewLine & _
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
end if
else
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>You must be logged on to see this page!</font></p>" & vbNewline
end if
function AllowedExtensions()
'##### check allowed extensions
Dim bolExtFound, arrExt, rsExt, iExt
strSQL = "SELECT EXTENSION FROM FORUM_CONFIG_EXTENSION"
set rsExt = my_Conn.Execute (strSQL)
If Not rsExt.EOF Then
arrExt = rsExt.GetRows()
bolExtFound = True
Else
bolExtFound = False
End If
rsExt.close
set rsExt = nothing
If bolExtFound Then
For iExt = 0 to ubound(arrExt, 2)
iExtension = arrExt(0, iExt)
response.write "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & iExtension & " </font>"
next
else
response.write "<br><p align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>There are no extensions defined yet. Please contact the <a href=""mailto:" & strSender & """>Administrator</a> of the forum.</font></p>"
end if
'erase arrExt
end function
Response.Write " <center><br><form><input type=button value=""Close Window"" onClick=""javascript:window.close();""></form></center>" & vbNewLine
%>
<%
intMPosts=0
set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute(strSql)
if not rs.BOF and not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 10 then
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End end if
else
Response.Write "Insufficient posts to view this page." & vbNewLine & _
"<a href=""javascript:void(setTimeout('history.go(-1)', 0))"">Return to previous page.</a>"
WriteFooter
Response.End end if
%>