Forum OpenACS Q&A: Response to Demographic Information

Collapse
Posted by Ben Adida on
Ravi, that's a lot of questions in one small paragraph! Let's see if I can address most of them.

- demographic information: it's there, but there isn't much code that will help you in inserting that information.

- As for inserting user-specified dates, you just specify dates in ANSI format, using something like '2000-09-22' as your value. If you want to use an automated widget, I suggest looking into the function "philg_dateentrywidget" and the corresponding "ns_dbformvalue" The first will help you display the date entry widget (look for it in tcl/ad-utilities) while the second will help you collect the three fields into one very easily (check aolserver.com/doc for precise instructions).

- getting the year out of a datetime/timestamp is easy using Postgres's to_char function, with something like "select to_char('YYYY', birthdate) from users"

- editing the users table: yes, you can do that, but be careful with such a modification. Make sure you really need to perform this action, because upgrading OpenACS will be come significantly more difficult.