0

I would like to customize the User Profile so that I could display very much extra parameters that the user can set - and display them for users that watch other user's profiles; but these parameters would come from my own database tables.
I have to create a dating site, where users can set their own parameters like eye color, hair color, height, etc.

I already made a class from which these data can be retrieved and set, I just have to build it in the User Profile - or I could also place it anywhere else, but I thought it would be a more comfortable way to display these among other user parameters - and even set them when the user is watching his/her own profile.

Besides, I will have to make a page where users can search for their "future partners" depending on the different parameters that the users select (for example someone looks for a user with blue eyes and blond hair, or anything else :D) - my own queries would run and search for given users.

What do you suggest? Should I make a module? Or should I override my template files? What would be a nice solution? How would You do that in Drupal 6?

I hooe I could clarify what I would like to do, if something isn't quite clear, please ask!
Thanks in advance!

1

Don't put business logic into template files. Override the template files to present the information differently, not to calculate the information in the first place.

Profiles can be extended with the built-in Profile module or with Content Profile module. The latter uses nodes as profile categories, which means you can use CCK fields. You can also write your own profile module. For for this, you have to implement hook_user. You need to react to at least the following values for $op:

  • categories to provide your own profile categories,
  • form to show the form for editing items of the categories you provide (in case the $categories parameter is one of values you returned via categories),
  • delete, insert, update to persist changes to the user,
  • view to show the profile information for your categories.

For the matching, I suggest custom views handlers. Use the Advanced help module to access the developer documentation that comes with views.

  • sorry, I forgot to mention that I've already tried Content Profile module, and I could give some extra parameters like First Name, Surname (both are Text Field types in Content Profile), Gender (Check boxes/radio buttons type in CP) and Address (with the Address CCK type related to Addresses module). It looks like this now: img191.imageshack.us/img191/386/contentprofile.jpg . OK, but now I would like to use my own fields. How can I set them (like eye color, hair color, etc.) so that it retrieves options from my own database? I wouldn't like to "hardcode" PHP codes on the admin site.THX! – Sk8erPeter Aug 25 '11 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.