Print Page | Close Window

MOD: Anniversary of Membership

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22343
Printed Date: 30 March 2026 at 11:05pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: MOD: Anniversary of Membership
Posted By: Melkor
Subject: MOD: Anniversary of Membership
Date Posted: 05 January 2007 at 9:22pm
Not really a mod as such as it is just a revised version of Birthdays but on a site like mine that has been running over 5 years and members celebrate such things, it was fun to do.
 
Filters out members who have signed up that day, banned members and members who have not activated their accounts
 
Add into the defaut.asp under the Birthday Array;
 


 
 'Get the now date with time off-set
 dtmNow = getNowDate()
 
 'Initalise the strSQL variable with an SQL statement to query the database
 strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Join_Date " & _
 "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
 "WHERE MONTH(" & strDbTable & "Author.Join_Date) = " & Month(dtmNow) & " " & _
  "AND DAY(" & strDbTable & "Author.Join_Date) = " & Day(dtmNow) & " " & _
   "AND (" & strDbTable & "Author.Active) = " & 1 & " " & _
    "AND (" & strDbTable & "Author.Banned) = " & 0 & " " & _
     "AND (" & strDbTable & "Author.Last_visit) > " & Year(dtmNow) & " -2" & _
    "AND YEAR(" & strDbTable & "Author.Join_Date) < " & Year(dtmNow) & " " & _
 "ORDER BY " & strDbTable & "Author.Author_ID ASC;"
 
 'Set error trapping
 On Error Resume Next
  
 'Query the database
 rsCommon.Open strSQL, adoCon
 
 'If an error has occured write an error to the page
 If Err.Number <> 0 AND  strDatabaseType = "mySQL" Then 
  Call errorMsg("An error has occured while executing SQL query on database.<br />Please check that the MySQL Server version is 4.1 or above.", "get_birthdays", "default.asp")
 ElseIf Err.Number <> 0 Then 
  Call errorMsg("An error has occured while executing SQL query on database.", "get_birthdays", "default.asp")
 End If
 
    
 'Disable error trapping
 On Error goto 0
 
 'Place the recordset into an array
 If NOT rsCommon.EOF Then
 
  'Read the recordset into an array
  saryMemebrStats = rsCommon.GetRows()
   
  'Loop through to get all members with anniversary today
  Do While intVersaryLoopCounter <= Ubound(saryMemebrStats, 2)
   
   'If anniversary is found for this date then add it to string
   If Month(dtmNow) = Month(saryMemebrStats(2, intVersaryLoopCounter)) AND Day(dtmNow) = Day(saryMemebrStats(2, intVersaryLoopCounter)) Then
     
    'If there is already one anniversary then place a comma before the next
    If strVersary <> "" Then strVersary = strVersary & ", "
     
    'Place the anniversary into the Birthday array
    strVersary = strVersary & "<a href=""profile.asp?Profile=" & saryMemebrStats(1, intVersaryLoopCounter) & strQsSID2 &  """>" & saryMemebrStats(0, intVersaryLoopCounter) & "</a> (" & Fix(DateDiff("m", saryMemebrStats(2, intVersaryLoopCounter), Year(dtmNow) & "-" & Month(dtmNow) & "-" & Day(dtmNow))/12) & ")"
   End If
   
   'Increment loop counter by 1
   intVersaryLoopCounter = intVersaryLoopCounter + 1
  Loop
 End If
 
 'Close recordset
 rsCommon.close
End If 
 
and add underneath where the Birthdays are displayed;

<tr class="tableSubLedger">
  <td colspan="2">Anniversaries</td>
 </tr>
 <tr class="tableRow">
  <td width="4%" align="center"><img src="<% = strImagePath %>birthday.gif" alt="Anniversays"/></td>
  <td width="96%"><% = strVersary %></td>
 </tr>
</table>



Replies:
Posted By: iSec
Date Posted: 08 January 2007 at 11:11am
Do you have a live example for this? or a screen shot maybe?


Posted By: DanW
Date Posted: 08 January 2007 at 3:24pm
This works for me with a few modifications:
 
1. Declare the variables:
 
Dim intVersaryLoopCounter
Dim strVersary
 
2. Change the link to the profile from:
 
profile.asp?Profile="
 
to
 
- member_profile.asp?PF= -
 


Posted By: Melkor
Date Posted: 08 January 2007 at 10:48pm
Ooops, yeah, forgot I re-wrote the profiles to a different URL, my bad.

working example; http://www.lotrplaza.com/forum/default.asp - http://www.lotrplaza.com/forum/default.asp



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net