Any chance of supporting node profiles rather than just profile.module

Comments

burlap’s picture

+1 for that...

graphicalphabet’s picture

+1, please.

niklp’s picture

Further to that, the focus should probably be on http://drupal.org/project/content_profile (for D6) rather than node_profile or bio, although bio support is probably easier as it's less complicated than NP.

It would be nice to see this support CCK-based profiles in D6 somehow though.

kamleshpatidar’s picture

Hi Nathan Paterson,
Have you done that? i want v card support to Node profile module.please guide how can i achieve this one?

Kamlesh Patidar

kamleshpatidar’s picture

hi all ,

i have done this.

Kamlesh Patidar

niklp’s picture

AMAZING!!!111

Are you going to tell us how, or should we just guess? :p

kamleshpatidar’s picture

Hi NikLP,
a lot of customization is required to fulfill requirement using Node profile. i completely cleaned up Vcard code ,b'coz i don't wanna to use Pear library with Vcard. But with pear library it's easy Use

nodeprofile_load('type',account->uid);

where

type="profile_XXXX"
& get your fields as usual

$node->field_YYYY[0]['value'];

Kamlesh Patidar

attiks’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

FYI: i needed this as well, included a quick/dirty fix

in vcard.module, function _vcard_get_map add the following before the return

  foreach (content_profile_get_types('types') as $type_name => $type) {
    foreach (content_fields(NULL, $type_name) as $field) {
      if ($field['type_name'] == $type_name) {
        $mapped = variable_get('vcard_profile_'. $type_name . '__' . $field['field_name'], 0);
        if ($mapped) {
          $p = content_profile_load($type_name, $account->uid);
          $v = $p->{$field['field_name']}[0]['value'];
          $map[$mapped] = $v;
        }
      }
    }
  }

in vcard.admin.inc, function _vcard_profile_fields add the following before the return

  foreach (content_profile_get_types('types') as $type_name => $type) {
    foreach (content_fields(NULL, $type_name) as $field) {
      if ($field['type_name'] == $type_name) {
        $output[$type_name . '__' . $field['field_name']] = $field['field_name'];
      }
    }
  }
sportel’s picture

Hi attiks,

I added the code you suggested. On the vCard config-page I can now make the mappings (all content_profile fields show up nicely). The config-page also gets saved nicely, but my vCard stays empty (it opens in MS-Outlook). Any suggestions for where to find the problem?

Thanks,

Mike.

attiks’s picture

try opening the vcard with notepad, so you'll see what's going on, feel free to post it here so I can have a look

sportel’s picture

Hi,

I opened the vcard with notepad:

BEGIN:VCARD
VERSION:3.0
FN:
N:;;;;
PROFILE:VCARD
NICKNAME:
ADR:;;;;;;
EMAIL:
END:VCARD

It's empty. But, I didn't install Contact_Vcard_Build. Might that be the problem? If so, I'm sorry to have bothered you with my stupid mistake.

Thanks,

Mike.

edit:

I downloaded Contact_Vcard_Build, unpacked and now have Contact_Vcard_Build-1.1.2 (without extension). Where do I put this file? I have a local Drupal installation on a Xampp server.

Thanks.

attiks’s picture

You have to install the pear package, using pear install Contact_Vcard_Build, check the install.txt file