Add photo in vcard... (I think this is useful)
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 18 Aug 2006 12:25:34 +0000 (12:25 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 18 Aug 2006 12:25:34 +0000 (12:25 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@820 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/profile.php
templates/vcard.tpl

index 6e8479f..4b30004 100644 (file)
@@ -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: ");
index 930367a..34afc0c 100644 (file)
@@ -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