Author |
Topic |
rick7165
Senior Member
USA
1094 Posts |
Posted - 28 November 2001 : 13:30:51
|
I did a examdiff on inc_functions.asp, inc_profile.asp, pop_profile.asp and nothing is diff. :(
Test Site: EastPasco running on Huw's Code 3.3.10 SQL 2000 Need a Snitz MOD? Click Here: Snitz Mod Resource |
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 28 November 2001 : 13:40:19
|
Good job Azaniah, I commend you for making a birthdate mod for snitz.
I have a question and a pointer for you.
1) Calculateing starsign and birthstone is easy because it's consistent. But how are you calculating Chinese Animal Year Sign? It's based on the lunar calendar which does not directly coincide with western Gregorian Calendar. Say I was born on jan 9th 1977, even though charts say 1977 is Year of Snake, I'm not a snake, because the Lunar(Chinese) New Year actually fall in february something of that year, so I'm a dragon. Do you understand what I'm talking about?
2) Leaving the month and year as drop down is cool but I suggest leaving the year part as a textbox. Just add some form of clientside validation. Here's a simple one I wrote:
//Validate age var now = new Date() var userAge = now.getFullYear() - parseInt(form.BirthYear.value); if (userAge <= 12) { alert("You are only " + userAge + ". Try again when you are 13."); form.BirthYear.focus(); form.BirthYear.select(); return false; } if (userAge >= 80) { alert("Your BirthYear is not in correct format. Must be 4 digits long and getter than " + (now.getFullYear() - 80)); form.BirthYear.focus(); form.BirthYear.select(); return false; }
put that in the inc_profile page in the function:
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript"> function submitIt(form) { //called for NEW MEMBER's registration if (form.Name.value == "" ) ...
if (!validEmail(form.Email2.value)) ...
.....
var now = new Date() var userAge = now.getFullYear() - parseInt(form.BirthYear.value); if (userAge <= 12) ....
}
hmm now that i think about it, does snitz had client side validation in the register page or was it something I added
- Alan www.iamviet.com Snitz Resource |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 13:40:44
|
The only place the drop down menu is called is inc_profile.asp, and the functions in inc_functions.asp
What happens on the one that doesn't work?
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 28 November 2001 : 13:43:49
|
Check this out... It only happens when the person didn't have the year in before this addon.
Other words... If you put the year in before I added the drop down the drop down box works in your profile. If you didn't have a Year in before the year drop down addon when you edit your profile the drop down for the year doesn't work.
Test Site: EastPasco running on Huw's Code 3.3.10 SQL 2000 Need a Snitz MOD? Click Here: Snitz Mod Resource |
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 28 November 2001 : 13:48:13
|
Azaniah I have to run for a couple of hours... I made you a admin on my test site. Go edit a profile that shows a 0 for their age and you will see the drop down is blank for the year.
Test Site: EastPasco running on Huw's Code 3.3.10 SQL 2000 Need a Snitz MOD? Click Here: Snitz Mod Resource |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 14:18:27
|
quote:
1) Calculateing starsign and birthstone is easy because it's consistent. But how are you calculating Chinese Animal Year Sign? It's based on the lunar calendar which does not directly coincide with western Gregorian Calendar. Say I was born on jan 9th 1977, even though charts say 1977 is Year of Snake, I'm not a snake, because the Lunar(Chinese) New Year actually fall in february something of that year, so I'm a dragon. Do you understand what I'm talking about?
The lunar Calander changes each year, so you have an array that hold that info. Eg 1.21,2.14,1.17,2.02 etc That hold the month (1=jan,etc) and day on which the New year started. You then check to see if birthdate if before or after that date in the year, if before you use the Starsign of the previous year, etc. I read up about the 60 year cycles of branches and stems and what not.
quote:
2) Leaving the month and year as drop down is cool but I suggest leaving the year part as a textbox. Just add some form of clientside validation. Here's a simple one I wrote:
//Validate age var now = new Date() var userAge = now.getFullYear() - parseInt(form.BirthYear.value); if (userAge <= 12) { alert("You are only " + userAge + ". Try again when you are 13."); form.BirthYear.focus(); form.BirthYear.select(); return false; } if (userAge >= 80) { alert("Your BirthYear is not in correct format. Must be 4 digits long and getter than " + (now.getFullYear() - 80)); form.BirthYear.focus(); form.BirthYear.select(); return false; }
put that in the inc_profile page in the function:
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript"> function submitIt(form) { //called for NEW MEMBER's registration if (form.Name.value == "" ) ...
if (!validEmail(form.Email2.value)) ...
.....
var now = new Date() var userAge = now.getFullYear() - parseInt(form.BirthYear.value); if (userAge <= 12) ....
}
hmm now that i think about it, does snitz had client side validation in the register page or was it something I added
I hadn't thought about the age validation. I'm not sure if the forum does have client side validation.
Cheers Az
(by the way I really appreciatte your coding of the events calendar now I've modded it - nice job)
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 14:22:30
|
OK,
To Add the bithday's on the default page do this..
(I'm gonna have to email Stim again)
Create a new file called birthdays.asp
Copy and paste this entrie code into it:
<TR> <TD valign=top bgcolor="<% =strForumCellColor %>" colspan="<%=sGetColspan(7, 6)%>" > <% today = date() currday = day(date()) currmonth = month(date()) curryear = year(date())
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID," & strMemberTablePrefix & "MEMBERS.M_NAME," & strMemberTablePrefix & "MEMBERS.M_HIDEAGE," & strMemberTablePrefix & "MEMBERS.M_BIRTHDATE" strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS " strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_BIRTHDATE LIKE '____" & currmonth & currday &"'" strSql = strSql & "ORDER BY (" & strMemberTablePrefix & "MEMBERS.MEMBER_ID) "
set rsBirthday = my_Conn.Execute (StrSql)
If rsBIRTHDAY.Eof OR rsBIRTHDAY.Bof Then response.write "<font face="& strForumCellColor &" size=" & strFooterFontSize & ">No Birthdays Today</font>" Else btoday = false do until rsBIRTHDAY.eof strBirthdate = rsBirthday("M_BIRTHDATE") & "000001" strBirthdate = strToDate (strBirthdate) Age = GetAge(strBirthdate) If rsBirthday("M_HIDEAGE") = 0 then
if btoday = false then Response.Write "<font face="& strForumCellColor &" size=" & strFooterFontSize & ">Todays Birthdays: </font>" btoday = true else 'do nothing end if response.write "<a href='pop_profile.asp?mode=display&id=" & rsBIRTHDAY("Member_ID") & "'><font face="& strForumCellColor &" size=" & strFooterFontSize & ">" & rsBIRTHDAY("M_NAME") & "</a>" & "(" & age & "), </font>" else 'do nothing End if
rsBIRTHDAY.movenext loop End if
rsBIRTHDAY.close set rsBIRTHDAY = Nothing %> </TD> </TR>
In Default.asp
Look for: <!--#include file="online.asp"-->
Add: <!--#include file="birthdays.asp"--> on the line before it:
Then look for:
Response.Write "5" else Response.Write "4"
Change to:
Response.Write "6" else Response.Write "5"
Thats all there is to it.
CHeers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 14:31:12
|
Rick,
Add the line in red to the following function. That fixes it.
Function Date_FillBoxWithYears( nDefault ) if nDefault = "Year" then nDefault = 0 nDefault = Cint(nDefault) Dim nYear nDefault = Cint(nDefault)
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 28 November 2001 : 14:39:31
|
quote:
The lunar Calander changes each year, so you have an array that hold that info. Eg 1.21,2.14,1.17,2.02 etc That hold the month (1=jan,etc) and day on which the New year started. You then check to see if birthdate if before or after that date in the year, if before you use the Starsign of the previous year, etc. I read up about the 60 year cycles of branches and stems and what not.
whoa, you actually did more research on the lunar calendar system than I did! That's sweet. Can I see your code for this? oh yeah, it's already in the mod download, what am i thinking btw thanks for Referring to it as by the (politically) correct term "Lunar" because obviously "chinese" aren't the only ones that uses it .
- Alan www.iamviet.com Snitz Resource |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 14:41:54
|
That's ok,
It's not solar so.. erm has to be the other one... rofl
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 28 November 2001 : 15:00:55
|
quote:
That's ok,
It's not solar so.. erm has to be the other one... rofl
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines.
You know why it's Lunar right? With the lunar calendar, every 15th of the month is a full moon! Those chinese astronomers figured it all out a few thousands of years ago and made a calendar based on it! Also the moon of the 9th month, i believe is really full and big, and is celebrated as the Mid-Autumn Festival.
Also did you know that the Gregorian Calendar, the current one in use in the world, is based on Solar? It can tell you of equinoxes and solstices of the sun so it's solar!
pretty fascinating how calendar and dates came about actually
- Alan www.iamviet.com Snitz Resource |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 28 November 2001 : 15:04:18
|
So long as China doesn't start a new calander system I'm fine.
I don't want to start at year 1 again. It would muck up my array...
Yeah it's pretty amazing how these ancient people worked this all out. If it wasn't for glass and clocks the industrial revolution would probably have been in China.
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Raichelle
Junior Member
370 Posts |
Posted - 28 November 2001 : 15:23:02
|
ok i uploaded my forum on 7host for now for testing is this mod updated and completed so i can test?
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 28 November 2001 : 15:49:36
|
quote: The lunar Calander changes each year, so you have an array that hold that info. Eg 1.21,2.14,1.17,2.02 etc That hold the month (1=jan,etc) and day on which the New year started. You then check to see if birthdate if before or after that date in the year, if before you use the Starsign of the previous year, etc. I read up about
Nice research on getting Chinese Year, Branches, stems etc
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
|
Topic |
|