Пример #1
0
     $middle = '';
     foreach ($names as $middlename) {
         if ($middlename != $names[0] && $middlename != $names[$anz - 1]) {
             $middle .= $middlename;
         }
     }
     $vCard->setFirstName($names[0]);
     $vCard->setMiddleName($middle);
     $vCard->setLastName($names[$anz - 1]);
 }
 if (!empty($row->location)) {
     $vCard->setHomeCity($row->location);
     $vCard->setPostalCity($row->location);
 }
 if (!empty($row->hp)) {
     $vCard->setURLWork($row->hp);
 }
 if (!empty($row->birthday) && $row->birthday != '0000-00-00') {
     $bday = str_replace('-', '', $row->birthday);
     $vCard->setBirthday($bday, 1);
 }
 $filename = $row->id . '.vcf';
 ($code = $plugins->load('profile_vcard_prepared')) ? eval($code) : null;
 $text = $vCard->getCardOutput();
 viscacha_header("Content-Type: text/x-vcard");
 viscacha_header("Content-Disposition: attachment; filename=\"{$filename}\"");
 viscacha_header('Content-Length: ' . strlen($text));
 echo $text;
 $slog->updatelogged();
 $db->close();
 exit;