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/Code)
 MOD: Email Subscription, version 4
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 7

MazY
Starting Member

United Kingdom
13 Posts

Posted - 18 May 2001 :  12:21:24  Show Profile
quote:

I was looking back thru the posts on this topic and I see someone else mentioned the problem with codes appearing in the message that gets sent to subscribers.

Perhaps if we simply left out the content of the message and send the subscriber a note with:


That is exactly what I have done and it works a treat!

I figured that if they read the message in the email then why would they even need to visit the fourm for the most part. it seemed self defeating.

They now just get a message as below:

A new post has been made in VBMedia Support Forums by VBMedia. To read the reply, visit http://www.slipstreamservices.com/vbmedia/link.asp?TOPIC_ID=19

Happy Posting...

The VBMedia Forum Subscription Notifier.

This email is auto-generated by the forum subscription service. Please do not try to reply to it.

VBMedia Web Designs. Nottingham. England.
Web Design and Search Engine Optimisation Specialists.

Visit us at http://www.vbmedia.co.uk


Note to Snitz: I hope the above isn't seen as blatant advertising for the sake of doing so. Just a demonstration of how I have got around the forum codes issue. Feel free to edit it or delete it if required.

Edited by - MazY on 18 May 2001 12:26:24
Go to Top of Page

dkerns
Starting Member

14 Posts

Posted - 18 May 2001 :  12:30:23  Show Profile
UPDATE:
I went back to just the text based message without the new message being inserted. Will continue to look for a fix for original problem (code appearing in messages). But for my current purposes, the text message with the URL will be sufficient. I just commented out the part that adds the message text (txtMessage):

post_info.asp (line 1310)
  strMessage = strMessage & url ' & vbCrLf & vbCrLf & txtMessage & vbCrLf



Anders solution of setting the number of recipients to "1" works if you don't have a lot of subscribers. It generates a message for each while using the BCC, you can include a great number of recipients in one message with little overhead.

One note of caution about hosted sites/ISPs...I currently have a site hosted with Hostpro (not the site for my Snitz forum). They have a limit set to prevent you from sending more than 50 email messages. Of course they don't tell you this and it seems to be very flaky about sending even 2 messages with 50 recipients via CDONTS. I can't rely on it working.

Here's my code for changing the CDONTS to send to recipients using the BCC property. All seems to be working well!

inc_mail.asp (approx line 86)

[code]
objNewMail.BCC = strRecipients 'new code
on error resume next '## Ignore Errors
'objNewMail.Send strSender, strRecipients, strSubject, strMessage (old code)
objNewMail.Send strSender, "forums@mydomain.com", strSubject, strMessage
[code]



Go to Top of Page

MazY
Starting Member

United Kingdom
13 Posts

Posted - 18 May 2001 :  12:37:24  Show Profile
quote:

Here's my code for changing the CDONTS to send to recipients using the BCC property. All seems to be working well!


This method seems to be working fine for me too. I'll consider that a success. Well at least until I get 100+ subscribers! Then I may have to review the situation.

Go to Top of Page

Anders M
Junior Member

Sweden
117 Posts

Posted - 18 May 2001 :  16:55:48  Show Profile  Visit Anders M's Homepage
quote:
I have a question about the possibility of hiding the subsrcription checkboxes in the default.asp page by simply preceeding the bits of code with either: if mLev = 3 (for moderators) or if mLev = 4 (for administrators).


Rob, this is what you need to do for allowing subscription for moderators and admin only. In default.asp look for this code:

'#################### Email Subscription MOD, start added code ###################
memberId = 0
if strDBNTUserName <> "" then
memberId = getMemberID(strDBNTUserName)
end if
showCatForumSubscr = False
colSpan4 = 4
colSpan5 = 5
colSpan6 = 6
colSpan7 = 7
if CatForumSubscrIsOn() And mlev<>0 then
showCatForumSubscr = True
colSpan4 = 5
colSpan5 = 6
colSpan6 = 7
colSpan7 = 8
end if
'################################ End added code #################################


Change the blue text to (mlev=3 or mlev=4). Also look up this:

<%'#################### Email Subscription MOD, start added code ###################%>
<form method=post action="nothing.asp" name="dummyForm">
<% if mlev<>0 and AllSubscrIsOn() then %>
<table border="0" width="95%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center" nowrap>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<input type=checkbox <%=AllCheckboxStr()%> onClick="if(this.checked) openWindow('pop_subscribe.asp?MEMBER_ID=<%=memberId%>&TOPIC_ID=0&FORUM_ID=0&CAT_ID=0&SUBJECT=Everything&SUBSCR=1'); else openWindow('pop_subscribe.asp?MEMBER_ID=<%=memberId%>&TOPIC_ID=0&FORUM_ID=0&CAT_ID=0&SUBJECT=Everything&SUBSCR=0');">
Subscribe to everything
</font>
</td>
</tr>
</table>
<% end if %>
<%'################################ End added code #################################%>


Again, change the blue text to (mlev=3 or mlev=4). In forum.asp find this:

'#################### Email Subscription MOD, start added code ###################
memberId = 0
if STRdbntUserName <> "" then
memberId = getMemberID(STRdbntUserName)
end if
strSql = "SELECT * FROM " & strTablePrefix & "SUBSCRIPTIONS WHERE MEMBER_ID = -4"
strSql = strSql & " AND FORUM_ID = " & Request.QueryString("FORUM_ID")
set rsSubscr = my_conn.Execute (strSql)
showSubscr = True
if mlev=0 or rsSubscr.BOF or rsSubscr.EOF then
showSubscr = False
end if
rsSubscr.close
set rsSubscr = nothing
'################################ End added code #################################


The gren text is added as a bug fix (see my post earlier in this thread). I suggest that you change the code slightly and do like this:

'#################### Email Subscription MOD, start added code ###################
memberId = 0
if STRdbntUserName <> "" then
memberId = getMemberID(STRdbntUserName)
end if
showSubscr = False
if mlev=3 or mlev=4 then
strSql = "SELECT * FROM " & strTablePrefix & "SUBSCRIPTIONS WHERE MEMBER_ID = -4"
strSql = strSql & " AND FORUM_ID = " & Request.QueryString("FORUM_ID")
set rsSubscr = my_conn.Execute (strSql)
if not(rsSubscr.BOF or rsSubscr.EOF) then
showSubscr = True
end if
rsSubscr.close
set rsSubscr = nothing
end if
'################################ End added code #################################


To be really really sure that only moderators and admin can subscribe, also modify this code in pop_subscribe.asp:

' Add/remove subscription
if not(mlev=3 or mlev=4) then
strHeader = "Error"
strMessage = "You are not allowed to subscribe."
else
if Request.QueryString("SUBSCR") = 1 then
strSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & "(MEMBER_ID, TOPIC_ID, FORUM_ID, CAT_ID) "
strSql = strSql & "VALUES (" & memberId & "," & topicId & "," & forumId & "," & catId & ")"
my_conn.Execute (strSql)
strHeader = "Subscribe"
strMessage = "You are now subscribing to:<br><b>" & subject & "</b>"
else
strSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS WHERE "
strSql = strSql & "MEMBER_ID=" & memberId & " AND TOPIC_ID=" & topicId
strSql = strSql & " AND FORUM_ID=" & forumId & " AND CAT_ID=" & catId
my_conn.Execute (strSql)
strHeader = "Terminate Subscription"
strMessage = "You are no longer subscribing to:<br><b>" & subject & "</b>"
end if


The red code is added.

I didn't try all this myself, but it should work.

Regards,

-Anders

Go to Top of Page

MazY
Starting Member

United Kingdom
13 Posts

Posted - 18 May 2001 :  21:48:05  Show Profile
Is there a way to find out which members are subscribed to which categories or forums?

Long term it would be nice to have a "Subscribed To" section in the user's profile, showing what they are subscribed to.



Edited by - MazY on 18 May 2001 21:49:14
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 18 May 2001 :  22:45:19  Show Profile  Visit Rob Poretti's Homepage
Thanks Anders for making it easy for me!

Cheers!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960
Go to Top of Page

Anders M
Junior Member

Sweden
117 Posts

Posted - 19 May 2001 :  03:14:19  Show Profile  Visit Anders M's Homepage
quote:
Is there a way to find out which members are subscribed to which categories or forums?

Long term it would be nice to have a "Subscribed To" section in the user's profile, showing what they are subscribed to.


This is something I will consider for version 5.

Go to Top of Page

qmediagroup
Starting Member

USA
7 Posts

Posted - 20 May 2001 :  19:32:27  Show Profile  Visit qmediagroup's Homepage
quote:
I figured out that there is no need for re-design. You can split the string strRecipients in inc_mail.asp like this:

arrayStr = Split(strRecipients, ";", -1, vbTextCompare)
For Each emailStr in arrayStr
objNewMail.AddRecipient emailStr
Next

In this way, we will call objNewMail.AddRecipient several times with just one email address at a time.

This seems to work great for JMail, but where I'm still struggling with ASPMail where there are two component parameters:

objNewMail.AddRecipient strRecipientsName, strRecipients

Setting the Email Addresses Per Message = 1 works, but it also takes about 35 seconds to post a message when there about 80 folks who "Subscribe To Everything" in my little forum.

Any help by anyone would be appreciated.

Terry Pochert
info@qmediagroup.com
Go to Top of Page

dkerns
Starting Member

14 Posts

Posted - 20 May 2001 :  20:49:10  Show Profile
Terry -

I don't use aspmail but you might want to look at earlier discussion in this thread about adding the recipients to the BCC property instead of the TO (doesn't disclose all the recipients) using CDONTS.

I checked the ASPMAIL site (http://www.serverobjects.com/comp/Aspmail3.htm and it indicates the syntax is:

Mailer.AddBCC "name3", "address3"


So rather than splitting it to send individual messages, split the recipient list to use the "AddBCC" property to build the list of BCCs. Of course you have to provide one address to recipient to the AddRecipient property.

Untested but you might try this:

arrayStr = Split(strRecipients, ";", -1, vbTextCompare)
For Each emailStr in arrayStr
objNewMail.AddBCC emailStr
Next


Set the # of recipients per message to something higher (i.e., 100)

My $0.02 on the subject...good luck

-- Don K
quote:

quote:
I figured out that there is no need for re-design. You can split the string strRecipients in inc_mail.asp like this:

arrayStr = Split(strRecipients, ";", -1, vbTextCompare)
For Each emailStr in arrayStr
objNewMail.AddRecipient emailStr
Next

In this way, we will call objNewMail.AddRecipient several times with just one email address at a time.

This seems to work great for JMail, but where I'm still struggling with ASPMail where there are two component parameters:

objNewMail.AddRecipient strRecipientsName, strRecipients

Setting the Email Addresses Per Message = 1 works, but it also takes about 35 seconds to post a message when there about 80 folks who "Subscribe To Everything" in my little forum.

Any help by anyone would be appreciated.

Terry Pochert
info@qmediagroup.com



Go to Top of Page

Anders M
Junior Member

Sweden
117 Posts

Posted - 20 May 2001 :  20:54:08  Show Profile  Visit Anders M's Homepage
quote:
This seems to work great for JMail, but where I'm still struggling with ASPMail where there are two component parameters:


My MOD creates a semi-colon separated string with the email addresses of the recipients. It does not bother about the names of the recipients. To do this, I would need to do some re-design.

Is it possible to use an empty string "" as recipient name? If so, you can do like this in inc_mail.asp:

case "aspmail"
Set objNewMail = Server.CreateObject("SMTPsvg.Mailer")
objNewMail.FromName = strFromName
objNewMail.FromAddress = strSender
objNewMail.RemoteHost = strMailServer
arrayStr = Split(strRecipients, ";", -1, vbTextCompare)
For Each emailStr in arrayStr
objNewMail.AddRecipient "", emailStr
Next

objNewMail.Subject = strSubject
objNewMail.BodyText = strMessage


If you cannot use "", try with a dummy string like e.g. "Forum Subscriber". You may also want to try to use AddBCC instead of AddRecipient as discussed earlier. Please get back if you have any problems.

-Anders M



Edited by - Anders M on 20 May 2001 20:59:03
Go to Top of Page

nadav
Starting Member

2 Posts

Posted - 21 May 2001 :  11:30:27  Show Profile
This is a great mode I have implemented it on our company's server.

Can you help me I would like that when people register to the form they are automatically made a subscriber to a certain topic?.

Can anybody help me with the code and where I would place the code at I am a beginner at ASP although I am a programmer in several languages.

Thanks in advance Nadav.

Go to Top of Page

Anders M
Junior Member

Sweden
117 Posts

Posted - 21 May 2001 :  12:14:02  Show Profile  Visit Anders M's Homepage
quote:
Can you help me I would like that when people register to the form they are automatically made a subscriber to a certain topic?.


This is a quick-and-dirty fix. I didn't try this code myself, but here it goes. At around line 285 in register.asp, insert this:

docount
strSql = "SELECT MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_EMAIL = '" & Trim(Request.Form("Email")) &"'"
set rs = my_Conn.Execute (strSql)
Subscribe rs("MEMBER_ID"), x, y, z 'Replace x, y and z with topic-ID, forum-ID and category-ID
rs.close
set rs = nothing

regHomepage = ""


At the end of register.asp, where the declaration of the function docount is located, insert this:

sub Subscribe memberId, topicId, forumId, catId
strSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & "(MEMBER_ID, TOPIC_ID, FORUM_ID, CAT_ID) "
strSql = strSql & "VALUES (" & memberId & "," & topicId & "," & forumId & "," & catId & ")"
my_conn.Execute (strSql)
end sub


Replace x with topic-ID, y with forum-ID and z with category-ID. If you want the user to subscribe to a forum, set topic-ID to 0. If you want the user to subscribe to a category, set topic-ID and to forum-ID to 0. You can add several calls to the function Subscribe, if you want the user to have many subscriptions.

Example: Let the user be subscribed to the forum with ID 2 in category with ID 1, then use x, y and z like this:

Subscribe rs("MEMBER_ID"), 0, 2, 1


NOTE: All this is a hard coded solution and not so flexible.

-Anders M

Go to Top of Page

nadav
Starting Member

2 Posts

Posted - 21 May 2001 :  15:20:52  Show Profile
quote:

quote:
Can you help me I would like that when people register to the form they are automatically made a subscriber to a certain topic?.


This is a quick-and-dirty fix. I didn't try this code myself, but here it goes. At around line 285 in register.asp, insert this:

docount
strSql = "SELECT MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_EMAIL = '" & Trim(Request.Form("Email")) &"'"
set rs = my_Conn.Execute (strSql)
Subscribe rs("MEMBER_ID"), x, y, z 'Replace x, y and z with topic-ID, forum-ID and category-ID
rs.close
set rs = nothing

regHomepage = ""


At the end of register.asp, where the declaration of the function docount is located, insert this:

sub Subscribe memberId, topicId, forumId, catId
strSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & "(MEMBER_ID, TOPIC_ID, FORUM_ID, CAT_ID) "
strSql = strSql & "VALUES (" & memberId & "," & topicId & "," & forumId & "," & catId & ")"
my_conn.Execute (strSql)
end sub


Replace x with topic-ID, y with forum-ID and z with category-ID. If you want the user to subscribe to a forum, set topic-ID to 0. If you want the user to subscribe to a category, set topic-ID and to forum-ID to 0. You can add several calls to the function Subscribe, if you want the user to have many subscriptions.

Example: Let the user be subscribed to the forum with ID 2 in category with ID 1, then use x, y and z like this:

Subscribe rs("MEMBER_ID"), 0, 2, 1


NOTE: All this is a hard coded solution and not so flexible.

-Anders M




Dear Anders M I would like to thank you very much for the quick response.

When I implement this code after I Porsche the I agree but on the waiver page it tells me that the page register.asp cannot be displayed there is a problem with the page.

The first block of code was easy to find where to insert it to but I'm not a hundred percent sure about the second block of code I placed it directly above the Sub document
Block of code I hope this is the right place.

If you have any suggestions they would be greatly appreciated!

Thanks in advance Nadav.




Edited by - nadav on 21 May 2001 15:30:39
Go to Top of Page

Anders M
Junior Member

Sweden
117 Posts

Posted - 21 May 2001 :  16:05:20  Show Profile  Visit Anders M's Homepage
I forgot a paranthesis. The bottom code shall of course be:

sub Subscribe (memberId, topicId, forumId, catId)
strSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & "(MEMBER_ID, TOPIC_ID, FORUM_ID, CAT_ID) "
strSql = strSql & "VALUES (" & memberId & "," & topicId & "," & forumId & "," & catId & ")"
my_conn.Execute (strSql)
end sub


Now I got some time to test the code. It works.

Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 21 May 2001 :  17:39:49  Show Profile  Visit Rob Poretti's Homepage
Hi ANders,

Once again, thanks for your help earlier -- everything seems to be working. Excellent mod - and very useful.

In the Admin page might I suggest color coding categories, topics and forums? WHen there are many items, it's difficult to see what you are doing. FOr example for categories (color=red):

<td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="red">
 <b><i><%=rsCat("CAT_NAME")%>:</i></b> </font></td>



For Forums (color=navy):

<td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="navy">
 <b><i><%=rsForum("F_SUBJECT")%></i> Forum:</b> </font></td>


Thanks for a great mod....




Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960

Edited by - Rob Poretti on 21 May 2001 17:40:19
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous Page | Next Page
 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