Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - MOD: Anniversary of Membership
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MOD: Anniversary of Membership

 Post Reply Post Reply
Author
Melkor View Drop Down
Groupie
Groupie


Joined: 11 December 2006
Location: United States
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote Melkor Quote  Post ReplyReply Direct Link To This Post Topic: MOD: Anniversary of Membership
    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>
Back to Top
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 11:11am
Do you have a live example for this? or a screen shot maybe?
Back to Top
DanW View Drop Down
Newbie
Newbie


Joined: 27 April 2005
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote DanW Quote  Post ReplyReply Direct Link To This Post 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=
 
Back to Top
Melkor View Drop Down
Groupie
Groupie


Joined: 11 December 2006
Location: United States
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote Melkor Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.