Author |
Topic |
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 23 November 2002 : 17:07:19
|
Hi all, ok this is wot i need. in the profile i need it to display either: 1) Just Age 2) Just Date Of Birth 3) Age And Date Of Birth
can someoen tell me wot i need to do so that i can do this modification?
thankx
MaD2ko0l |
© 1999-2010 MaD2ko0l |
|
Rasco
Advanced Member
Germany
3192 Posts |
Posted - 23 November 2002 : 18:28:34
|
In admin_config_members.asp you can uncomment the following.
if Request.Form("strAge") = "1" and Request.Form("strAgeDOB") = "1" then Err_Msg = Err_Msg & "<li>Age and Birth Date cannot both be On at the same time</li>" end if
Now, you can choose both "Age" and "Date of birth" but since date of birth calculates the age, you now have a double age in the when viewing a members profile. |
German Snitz Forum
|
|
|
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 23 November 2002 : 19:43:47
|
if Request.Form("strAge") = "1" and Request.Form("strAgeDOB") = "1" then Err_Msg = Err_Msg & "<li>Age and Birth Date cannot both be On at the same time</li>" end if
uncomment??? u mean comment it out.
is there anyway to make it show the date and not the age??? |
© 1999-2010 MaD2ko0l |
|
|
Rasco
Advanced Member
Germany
3192 Posts |
Posted - 24 November 2002 : 04:12:41
|
Oups, you`re right. Showing the date likely means some changed in pop_datepicker.asp, but I don`t know how to do it. |
German Snitz Forum
|
|
|
David K
Junior Member
494 Posts |
Posted - 24 November 2002 : 04:32:41
|
Not in pop_datepicker, in pop_profile, you need to phrase the dob to a date insted of calculating the age from it. in line 557 delete\comment this at the end of the line & _
From line 558, change this: " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & DisplayUsersAge(strDOB) & "</font></td>" & vbNewLine & _ " </tr>" & vbNewLine
to this: if not(isnull(strDOB) then response.write " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & strDOB & "</font></td>" & vbNewLine & _ response.write " </tr>" & vbNewLine
Edited to handle null DOB |
Edited by - David K on 24 November 2002 04:51:19 |
|
|
David K
Junior Member
494 Posts |
Posted - 24 November 2002 : 04:57:02
|
of curse i would also reccomend to modify the precceding line to say DOB insted of age |
|
|
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 25 November 2002 : 15:30:48
|
ok then it works fine now but i need to to be dislayed as a date and not as numbers.
how do i do this?
can u hel plz??
thankx
MaD2ko0l |
© 1999-2010 MaD2ko0l |
|
|
David K
Junior Member
494 Posts |
Posted - 25 November 2002 : 15:45:11
|
I'm glad it helps, but I'll have to make an include file to display it as a date (based on datepicker) it should take a few days |
|
|
David K
Junior Member
494 Posts |
Posted - 25 November 2002 : 17:49:43
|
I'm sorry, I was wrong in the time estimate, it took a few hours! Read all about my new MOD here Remember that you need to revert some lines back to their original (I did most of the code changes in the file itself) |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 November 2002 : 18:04:14
|
Showing Birthdate in profile.
File: pop_profile.asp
Lines: 553-560
strDOB = rs("M_DOB")
if (strAgeDOB = "1" and Trim(strDOB) <> "") then
strDOB = DOBToDate(strDOB)
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap valign=""top""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Age: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & DisplayUsersAge(strDOB) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Modify the text highlighted in blue in above statements as below. The changes are shown in red below.
strDOB = rs("M_DOB")
if (strAgeDOB = "1" and Trim(strDOB) <> "") then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap valign=""top""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Birthdate: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & chkDate(strDOB, "", false) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if |
Edited by - GauravBhabu on 26 November 2002 12:13:18 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 November 2002 : 18:16:23
|
David K, I did not see your post as I was posting the changes required. However, I used the already available functionality in the code instead of creating a new function. Displaying birthdate just requires calling a different function. |
|
|
David K
Junior Member
494 Posts |
Posted - 25 November 2002 : 18:26:32
|
My MOD writes a sentence example: The 21st of November, 2000.
So it's a little diffrent. and you have a type-o in your code, it should be: chkDate(strDOB, "", false) not: chkDate(strMDOB, "", false) |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 November 2002 : 18:36:43
|
quote: Originally posted by David K My MOD writes a sentence example: The 21st of November, 2000. So it's a little diffrent.
Sure it is different.
I chose chkDate to keep the date display consistent with the date display at other pages in the forum.
quote: Originally posted by David K ...you have a type-o in your code...
corrected. |
Edited by - GauravBhabu on 25 November 2002 18:41:40 |
|
|
David K
Junior Member
494 Posts |
Posted - 26 November 2002 : 04:05:00
|
Now everybody has one of the greatest advantages in a democratic world: Choice! |
|
|
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 26 November 2002 : 11:38:41
|
quote: Originally posted by GauravBhabu
Showing Birthdate in profile.
File: pop_profile.asp
Lines: 553-560
strDOB = rs("M_DOB")
if (strAgeDOB = "1" and Trim(strDOB) <> "") then
strDOB = DOBToDate(strDOB)
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap valign=""top""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Age: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & DisplayUsersAge(strDOB) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Modify the text highlighted in blue in above statements as below. The changes are shown in red below.
strDOB = rs("M_DOB")
if (strAgeDOB = "1" and Trim(strDOB) <> "") then
strDOB = DOBToDate(strDOB)
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap valign=""top""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Birthdate: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & chkDate(strDOB, "", false) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
if i use this code it gets displayed like this
Birthdate: 87/19/1/2/
when i use david_k's it doesnyt work it comes up with a error
Microsoft VBScript runtime error '800a000d' Type mismatch: 'DOBDateTo'
/mad/portal/pop_profile.asp, line 632
|
© 1999-2010 MaD2ko0l |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 26 November 2002 : 12:12:12
|
corrected try now |
|
|
Topic |
|