Author |
Topic |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 19 May 2010 : 17:52:12
|
Did anyone made this to complement the Birthdays Module? |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
modifichicci
Average Member
Italy
787 Posts |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 21 May 2010 : 13:37:40
|
care to share? |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
modifichicci
Average Member
Italy
787 Posts |
Posted - 21 May 2010 : 17:05:24
|
you need to add a field called M_SENTEMAIL to the table MEMBERS_BDATES then add this function to cal_functions.asp
in cal_deafult add EmailBirthdays after WriteBirthdays
I add a variable to enable the email birthday function, but you can delete the if then part
this is a quick answer, i hope to have written all the changes, i did it a long time ago and i haven't the documentation |
Ernia e Laparocele Forum di Ernia e Laparocele Acces - MySql Migration Tutorial Adamantine forum |
Edited by - modifichicci on 21 May 2010 17:06:43 |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 07 August 2010 : 10:26:54
|
I have my code running but I had to take a diff approach, using only MEMBERS table so I dont need to query twice for each email, I can share my code if needed.
In your code, the
DateToStr(rs("DOB")&"235900") > DateToStr(todaysdate)
is always False as DOB contains YEAR, in my case it would be 19770128 that, when todaysdate is 20110128 will never work! Other thing is to reset the SentEmail flag back to 0, on a day that is bigger that the DOB month and day.
maybe you should review your code...
But thank you for the heads up! |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
modifichicci
Average Member
Italy
787 Posts |
Posted - 09 August 2010 : 15:06:03
|
DOB in MEMBERS_BDATES is memorized as the last birthday, not as the real birthday. So If my date is 19770128, in DOB I have 20100128, so when date is bigger (20110128) mail is sent and field is changed DOB memorize date only for members posting in last 30 days and is deleted 30 days after.. That is the birthday mod, it is not mine, i have used his function to let send mail with not a lot of changes... It is working perfectly in every forum of our distribution, but thanks if you would share your code, so i can see something usefull.. Thanks!| |
Ernia e Laparocele Forum di Ernia e Laparocele Acces - MySql Migration Tutorial Adamantine forum |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 21 August 2010 : 20:04:12
|
I did this for someone a year or so ago. I used a different approach, though. I created a 4 char text field (M_SENT_DOBMAIL) in the members table to hold the year. That's the only dbase mod necessary. This method doesn't rely upon a later erasure of the contents of the DOBMAIL field.
You can add this function to either "cal_functions.asp" or "inc_func_common.asp", but I would recommend leaving it with the calendar.
With that done, simply add one line to the top of "cal_default.asp".
|
Edited by - Carefree on 21 August 2010 20:08:30 |
|
|
Sean Sounds
Starting Member
20 Posts |
Posted - 23 August 2010 : 15:34:49
|
Hey Carefree. I'm getting an error on the second line of the code which says:
Microsoft OLE DB Provider for SQL Server error '80040e14'
'MID' is not a recognized function name.
cal_functions.asp, line 550
Any suggestions? Thanks |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 24 August 2010 : 20:09:57
|
It shouldn't be trying to read it as a function, it's reading a portion of a string value. |
|
|
Sean Sounds
Starting Member
20 Posts |
Posted - 25 August 2010 : 15:43:11
|
quote: Originally posted by Carefree
It shouldn't be trying to read it as a function, it's reading a portion of a string value.
I figured it out.
Changed the second line from:
strSql = "SELECT M_NAME, MEMBER_ID, M_EMAIL, M_RECEIVE_EMAIL, M_DOB, M_SENT_DOBMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE MID(M_DOB,5)='" & MID(DATETOSTR(STRFORUMTIMEADJUST),5,4) & "' ORDER BY M_DOB"
to
strSql = "SELECT M_NAME, MEMBER_ID, M_EMAIL, M_RECEIVE_EMAIL, M_DOB, M_SENT_DOBMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE substring(M_DOB, 5, 4) = '" & MID(DATETOSTR(STRFORUMTIMEADJUST),5,4) & "' ORDER BY M_DOB"
Thanks |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 August 2010 : 22:57:56
|
Got it working, that's all that matters. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 28 August 2010 : 23:22:10
|
To cover all supported DB types, change the function thus:
|
|
|
|
Topic |
|
|
|