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
 Poll mod and subscribe checkbox ?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

kristien
New Member

78 Posts

Posted - 30 May 2002 :  15:11:07  Show Profile  Visit kristien's Homepage
Hi all

I installed dave packaged forum, made changes myself and now i am trying to implement the checkbox for subscribing when posting a new topic or reply.

But i get the following error :

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'CheckSubscription'

/test/post.asp, line 984

I have read this forum and it seems that a lot of people have this problem.
Now i am wondering that it has something to do with the poll mod installed yes or no.

Please help me !


Davio
Development Team Member

Jamaica
12217 Posts

Posted - 30 May 2002 :  15:20:49  Show Profile
That error usually means that the page cannot find the function or subroutine CheckSubscription(). Make sure you added it in. Functions usually go into the inc_functions.asp file. Or it can be added directly to the post.asp file.

«------------------------------------------------------»
Want to know when the next version comes out,
as soon as possible? Join our Mailing Lists !
Go to Top of Page

kristien
New Member

78 Posts

Posted - 31 May 2002 :  05:30:19  Show Profile  Visit kristien's Homepage
Yes, i added the function in inc_functions !

It was in it already, i only have to make some changes.

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 31 May 2002 :  10:45:43  Show Profile
So you got it working now?

«------------------------------------------------------»
Want to know when the next version comes out,
as soon as possible? Join our Mailing Lists !
Go to Top of Page

kristien
New Member

78 Posts

Posted - 31 May 2002 :  11:26:34  Show Profile  Visit kristien's Homepage
No you asked :
Make sure you added it in

And my answer is yes it added it in

Still not working



Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 31 May 2002 :  11:29:56  Show Profile  Visit HuwR's Homepage
??? I'm pretty sure that the checksubscription function is in inc_subscription.asp a new one of which ws supplied with the checkbox mod, did you replace it as requested ?


kristien,
if you are looking for help, DO NOT post the same questions here and on my forum, I do not like repeating myself.

Go to Top of Page

kristien
New Member

78 Posts

Posted - 01 June 2002 :  06:30:13  Show Profile  Visit kristien's Homepage
This is how my inc_subscription looks like :
 
' This sub checks against the subscriptions table looking for a subscription based
' on the level passed in. If one exists, it builds the link the unsubscribe,
' otherwise it builds the link to subscribe.

sub CheckSubscription(SubType, MemberID, CatID, ForumID, TopicID, strBefore, strAfter)
'-- Subscribe checkbox -----
Dim postForm
If Instr(request.servervariables("SCRIPT_NAME"),"post.asp") then
postForm = true
else
postForm = false
end if
'-- Subscribe checkbox end -

if mlev = 0 then
exit sub
end if

if instr(1, SubType, "NOTEXT") > 0 then
SubType = Replace(SubType, "NOTEXT", "")
Text = "N"
end if

' Check for overriding subscriptions
if SubType <> "BOARD" then
StrSql = "SELECT Count(*) as SubCount from " & strTablePrefix & "SUBSCRIPTIONS S" & _
" WHERE S.MEMBER_ID = " & MemberID & _
" AND ((S.CAT_ID = 0 and S.FORUM_ID = 0 and S.TOPIC_ID = 0)" ' Board Level Subscription
if SubType <> "CAT" then
StrSql = StrSql & " OR (S.CAT_ID = " & CatID & " and S.FORUM_ID = 0 and S.TOPIC_ID = 0)" ' Cat level subscription
end if
if SubType = "TOPIC" then
StrSql = StrSql & " OR (S.CAT_ID = " & CatID & " and S.FORUM_ID = " & ForumID & " and S.TOPIC_ID = 0)" ' Forum level subscription
end if
StrSql = StrSql & ")"

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

if rsCount.BOF or rsCount.EOF then
rsCount.Close
set rsCount = nothing
' No Subscriptions found, do nothing
else
SubCount = rsCount("SubCount")
rsCount.Close
set rsCount = nothing
if SubCount > 0 then
' Higher Level Subscriptions found, exit.
Exit Sub
end if
end if
end if

' Can only have subscriptions if email is enabled and user is a member.
if (lcase(strEmail) = "1") and mlev <> 0 then
dim LinkInfo
LinkInfo = "LEVEL="
LinkInfo = LinkInfo & SubType

' Look for a current subscription for this member to determine which icon to display.
' Also start to build the appropriate querystring for the link
strSql = "Select Count(*) as MemberCheck " &_
" FROM " & strTablePrefix & "SUBSCRIPTIONS S" &_
" WHERE S.MEMBER_ID = " & MemberID &_
" AND S.TOPIC_ID = "

if SubType = "TOPIC" then
strSql = strSql & TopicID
else
strSql = strSql & "0 "
end if
strSql = strSql & " AND S.FORUM_ID = "
if SubType = "CAT" or SubType = "FORUM" or SubType = "TOPIC" then
strSql = strSql & ForumID
else
strSql = strSql & "0 "
end if
strSql = strSql & " AND S.CAT_ID = "
if SubType <> "BOARD" then
strSql = strSql & CatID
else
strSql = strSql & "0 "
end if
if SubType <> "BOARD" then
LinkInfo = LinkInfo & "&CAT_ID=" & CatID
if SubType <> "CAT" then
LinkInfo = LinkInfo & "&FORUM_ID=" & ForumID
if SubType <> "FORUM" then
LinkInfo = LinkInfo & "&TOPIC_ID=" & TopicID
end if
end if
end if

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

' Complete the LinkInfo by adding the member_id to the link
LinkInfo = LinkInfo & "&MEMBER_ID=" & MemberID & "');"">"
Response.Write "<font face='" & strDefaultFontFace & "' size='" & strDefaultFontSize & "'>"
If rsWatch("MemberCheck") > 0 then
'-- Subscribe checkbox -----
if not postForm then
Response.Write strBefore & "<a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=U&" & LinkInfo
Response.Write "<img src='" & strImageURL & "icon_unsubscribe.gif' height=15 width=15 border=0 alt='Unsubscribe'>"
If Text <> "N" then
Response.Write "</a> <a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=U&" & LinkInfo
Response.Write "Unsubscribe from "
end if
else
response.write "<input type='checkbox' name='Tnotify' value='0' >Check here to unsubscribe from this topic"
end if
Else
if not postForm then
Response.Write strBefore & "<a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=S&" & LinkInfo
Response.Write "<img src='" & strImageURL & "icon_subscribe.gif' height=15 width=15 border=0 alt='Subscribe to this " & SubType & "'>"
If Text <> "N" then
Response.Write "</a> <a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=S&" & LinkInfo
Response.Write "Subscribe to "
end if
else
response.write "<input type='checkbox' name='Tnotify' value='1' >Check here to subscribe to this topic"
end if
End If
if not postForm then
'-- Subscribe checkbox end -

If Text <> "N" then
Response.Write " <a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=U&" & LinkInfo
' Response.Write "Unsubscribe from "
if SubType = "BOARD" then
Response.Write "<img src='forumuit.gif' border=0 alt='UnSubscribe'></a>"
elseif SubType = "CAT" then
Response.Write "<img src='catuit.gif' border=0 alt='UnSubscribe'></a>"
elseif SubType = "FORUM" then
Response.Write "<img src='catuit.gif' border=0 alt='UnSubscribe'></a>"
else
Response.Write "<img src='topicuit.gif' border=0 alt='UnSubscribe'></a>"
end if
else
Response.Write strBefore & "<a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=U&" & LinkInfo
Response.Write "<img src='icon_unsubscribe.gif' border=0 alt='Unsubscribe'>"
end if
' Else
' If Text <> "N" then
' Response.Write " <a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=S&" & LinkInfo
' Response.Write "Subscribe to "
' if SubType = "BOARD" then
' Response.Write "<img src='forumaan.gif' border=0 alt='Subscribe'></a></a>"
' elseif SubType = "CAT" then
' Response.Write "<img src='cataan.gif' border=0 alt='Subscribe'></a>"
' elseif SubType = "FORUM" then
' Response.Write "<img src='cataan.gif' border=0 alt='Subscribe'></a>"
' else
' Response.Write "<img src='topicaan.gif' border=0 alt='Subscribe'></a>"
' end if
' else
' Response.Write strBefore & "<a href=""Javascript:openWindow('pop_subscription.asp?SUBSCRIBE=S&" & LinkInfo
' Response.Write "<img src='icon_subscribe.gif' border=0 alt='Subscribe'>"
' end if
' End If
'-- Subscribe checkbox -----
end if
'-- Subscribe checkbox end -
Response.Write strAfter & "</font>"

rsWatch.close
set rsWatch = nothing
end if
end sub


And this is where the error takes place in post.asp :

if strAllowForumCode = "1" then
if strRqMethod = "Edit" or strRqMethod = "EditTopic" or strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
%>
<table border=0>
<tr>
<td>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Mode:</b>
<select name="font" onChange="thelp(this.options[this.selectedIndex].value)">
<option value="1">Help </option>
<option value="2">Prompt </option>
<option selected value="0">Basic </option>
</select>
</font></td>
</tr>
</table>
<%
end if
end if

if strRqMethod = "Edit" or strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "EditTopic" or strRqMethod = "TopicQuote" then
if strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
%>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<input name="Sig" type="checkbox" value="yes" <% if Request.QueryString("poll") <> "1" then %>checked<% end if %>>Klik hier om je handtekening toe te voegen.<br>
<% '-- Subscribe checkbox -----
if strSubscription > 0 and postCat_Subscription > 0 and postForum_Subscription > 0 then
CheckSubscription "TOPIC", getNewMemberNumber(), strRqCatID, strRqForumID, strRqTopicID, "<br>", "<br>"
end if
'-- Subscribe checkbox end - %>
</font>
<%
end if

if ((mLev = 4) or (chkForumModerator(strRqForumId, strDBNTUserName) = "1")) _
and (strRqMethod = "Topic" or strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or strRqMethod = "TopicQuote") then %>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<input name="lock" type="checkbox" value="1">Klik hier om het bericht te sluiten na deze post.<br>
</font>
<%
end if
end if
Response.Write " </td>" & vbNewline
Response.Write " </tr>" & vbNewline
end if
%>




Edited by - kristien on 01 June 2002 06:31:09
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 01 June 2002 :  06:53:45  Show Profile  Visit HuwR's Homepage
quote:

Yes, i added the function in inc_functions !

It was in it already, i only have to make some changes.





do you have the function in inc_functions.asp as well as inc_subscription.asp ?

Go to Top of Page

kristien
New Member

78 Posts

Posted - 01 June 2002 :  08:25:33  Show Profile  Visit kristien's Homepage
quote:

quote:

Yes, i added the function in inc_functions !

It was in it already, i only have to make some changes.





do you have the function in inc_functions.asp as well as inc_subscription.asp ?




Sorry about the mess up.
I inserted it in inc_subscription (code above) NOT in inc_function. But that is not necessary right?

Go to Top of Page

kristien
New Member

78 Posts

Posted - 01 June 2002 :  09:26:06  Show Profile  Visit kristien's Homepage
Think i found it !

<!--#include file="inc_subscription.asp"--> Wasn't in my post.asp (wasn't '-- Subscribe checkbox -----, that's why i missed it !)

Thanks !

BTW is it possible there is a bug in

sub DeleteSubscription(Level, MemberID, CatID, ForumID, TopicID)
' --- Delete the appropriate sublevel of subscriptions
StrSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS"
StrSql = StrSql & " WHERE " & strTablePrefix & "SUBSCRIPTIONS.MEMBER_ID = " & MemberID
if sublevel = "CAT" then
StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.CAT_ID = " & CatID
elseif sublevel = "FORUM" then
StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.FORUM_ID = " & ForumID
elseif sublevel = "TOPIC" then
StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID
end if
my_Conn.Execute (strSql)
end sub


Doesn't it have to be :

elseif sublevel = "TOPIC" then
StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID


Otherwise, he is going to delete all subscription from that member ?


Edited by - kristien on 01 June 2002 10:20:46
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.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07