From: x2003bruneau Date: Fri, 18 Aug 2006 12:25:34 +0000 (+0000) Subject: Add photo in vcard... (I think this is useful) X-Git-Tag: xorg/0.9.11~96 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=937e3c82dba6ab139ec02f38ee978be0761dcc44;p=platal.git Add photo in vcard... (I think this is useful) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@820 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/profile.php b/modules/profile.php index 6e8479f..4b30004 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -689,6 +689,15 @@ class ProfileModule extends PLModule $user['virtualalias'] = $res->fetchOneCell(); + // get photo + $res = XDB::query( + "SELECT attach + FROM photo AS p + INNER JOIN aliases AS a ON (a.id = p.uid AND a.type = 'a_vie') + WHERE a.alias = {?}", $login); + if ($res->numRows()) { + $user['photo'] = $res->fetchOneCell(); + } $page->assign_by_ref('vcard', $user); header("Pragma: "); diff --git a/templates/vcard.tpl b/templates/vcard.tpl index 930367a..34afc0c 100644 --- a/templates/vcard.tpl +++ b/templates/vcard.tpl @@ -71,6 +71,9 @@ NOTE;ENCODING=QUOTED-PRINTABLE:{"(X`$vcard.promo`)"|qp_enc} {else} NOTE;ENCODING=QUOTED-PRINTABLE:{"(X`$vcard.promo`)\n`$vcard.libre`"|qp_enc} {/if} +{if $vcard.photo} +PHOTO;BASE64:{$vcard.photo|base64_encode} +{/if} SORT-STRING;ENCODING=QUOTED-PRINTABLE:{$vcard.nom|qp_enc} REV:{$vcard.date|date_format:"%Y%m%dT000000Z"} END:VCARD