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)
 User Level Notification Mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jfitz
Junior Member

USA
345 Posts

Posted - 20 August 2003 :  00:55:23  Show Profile
USER LEVEL NOTIFICATION MOD

Posted 20 August 2003
Edited 20 August 2003 - Added subject line to email message, and new star count to message text

This MOD sends an email notification to the SuperAdmin whenever a user posts a message that brings them to the next user level threshhold. It requires two additions (additions only - no changes to existing code) to one file - inc_func_count.asp. This mod could be easily extended to include notification to all admins / moderators, or to the forum member reaching the new rank.

This MOD was created to help us avoid noticing when our members reached new ranks.

This MOD is compatible with my ADDITIONAL RANKS MOD, but it does not require that mod to work.

Ease of implementation (1-10, 10 hardest): 2

INC_FUNC_COUNT.ASP

1. Find the doUCount sub (around line 61) and add the code in red
immediately before the end sub statement:


sub doUCount(sUser_Name)
	'## Forum_SQL - Update Total Post for user
	strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " SET M_POSTS = M_POSTS + 1 "
	strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(sUser_Name, "SQLString") & "'"
	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
'## USER LEVEL NOTIFICATION MOD
    if strEmail = "1" then
      strSql = "SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE " & strDBNTSQLName & " = '" & ChkString(sUser_Name, "SQLString") & "'"
      set upostcount =  my_Conn.Execute (strSql)
      upost_count = upostcount(0).Value
      upost_count = cInt(upost_count)
      upostcount.Close
      set upostcount = NOTHING
      doURankNotification sUser_Name, upost_count
    end if  
end sub


2. Just before the final %> of the file, add the following code: (note - if you have not added the ADDITIONAL RANKS MOD, then the last
five elseif clauses in the doURankNotification sub are not necessary and can optionally be removed. Leaving them in should not affect the operation of this MOD.)


'## USER LEVEL NOTIFICATION MOD
sub doURankNotification(uName, uPosts)
  if cInt(uPosts) = cInt(intRankLevel1) then
    doSendNewRankNotification uName, uPosts, 1, strRankLevel1
  elseif cInt(uPosts) = cInt(intRankLevel2) then
    doSendNewRankNotification uName, uPosts, 2, strRankLevel2	
  elseif cInt(uPosts) = cInt(intRankLevel3) then
    doSendNewRankNotification uName, uPosts, 3, strRankLevel3	
  elseif cInt(uPosts) = cInt(intRankLevel4) then
    doSendNewRankNotification uName, uPosts, 4, strRankLevel4	
  elseif cInt(uPosts) = cInt(intRankLevel5) then
    doSendNewRankNotification uName, uPosts, 5, strRankLevel5	
  elseif cInt(uPosts) = cInt(intRankLevel6) then
    doSendNewRankNotification uName, uPosts, 6, strRankLevel6	
  elseif cInt(uPosts) = cInt(intRankLevel7) then
    doSendNewRankNotification uName, uPosts, 7, strRankLevel7	
  elseif cInt(uPosts) = cInt(intRankLevel8) then
    doSendNewRankNotification uName, uPosts, 8, strRankLevel8
  elseif cInt(uPosts) = cInt(intRankLevel9) then
    doSendNewRankNotification uName, uPosts, 9, strRankLevel9	
  elseif cInt(uPosts) = Cint(intRankLevelA) then
    doSendNewRankNotification uName, uPosts, 10, strRankLevelA
 end if	
end sub

sub doSendNewRankNotification(member_name, post_count, new_level_num, new_level_name)
  strSql = "SELECT M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID=" & intAdminMemberID
  set rsAdmin = my_conn.Execute (strSql)
  strRecipients = rsAdmin(0).Value
  rsAdmin.Close
  set rsAdmin = NOTHING
  if strRecipients = "" then Exit Sub
  strSubject = strForumTitle & " Member Level Notification"
  strMessage = "Hello Admin" & vbNewline & vbNewline & "Forum member "
  strMessage = strMessage & member_name & " now has " & post_count & " posts, has reached a new member level of " & _
              new_level_num & " stars, and now has the title '" & new_level_name & "'"
%>
  <!--#INCLUDE FILE="inc_mail.asp" -->
<%
end sub


Upload your new version of inc_func_count.asp, and you are done.

--Jördan
It's a wasted day if you don't spend at least part of it flying upside down.

Edited by - jfitz on 20 August 2003 11:50:39

Heynow
Junior Member

374 Posts

Posted - 20 August 2003 :  12:05:05  Show Profile  Visit Heynow's Homepage  Send Heynow an AOL message  Send Heynow a Yahoo! Message
Cool! Thanks jfitz!


Political Forums
:::Stay n Chat
Go to Top of Page

jfitz
Junior Member

USA
345 Posts

Posted - 20 August 2003 :  12:12:47  Show Profile
I hope you like it. Rather than trying to email moderators and add to the forum workload, I created a filter for my email that triggers on the subject line of the email and forwards copies of the notification message to selected moderators.

--Jördan
It's a wasted day if you don't spend at least part of it flying upside down.
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.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07