|
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> |
|