moveme: fix contact photos

This commit is contained in:
Fabrixxm 2012-11-05 09:18:55 +01:00
parent 1a3a5ee8d9
commit aa20042bec
2 changed files with 15 additions and 7 deletions

View file

@ -42,7 +42,7 @@ require_once('include/html2plain.php');
*/ */
function notifier_run($argv, $argc){ function notifier_run(&$argv, &$argc){
global $a, $db; global $a, $db;
if(is_null($a)){ if(is_null($a)){
@ -422,12 +422,20 @@ function notifier_run($argv, $argc){
set_config('system','site_pubkey', $res['pubkey']); set_config('system','site_pubkey', $res['pubkey']);
} }
$rp = q("SELECT `resource-id` , `scale`, type FROM `photo`
WHERE `profile` = 1 AND `uid` = %d ORDER BY scale;", $uid);
$photos = array();
$ext = Photo::supportedTypes();
foreach($rp as $p){
$photos[$p['scale']] = $a->get_baseurl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
}
unset($rp, $ext);
$atom .= replace_macros($sugg_template, array( $atom .= replace_macros($sugg_template, array(
'$name' => xmlify($owner['name']), '$name' => xmlify($owner['name']),
'$photo' => xmlify($owner['photo']), '$photo' => xmlify($photos[4]),
'$thumb' => xmlify($owner['thumb']), '$thumb' => xmlify($photos[5]),
'$micro' => xmlify($owner['micro']), '$micro' => xmlify($photos[6]),
'$url' => xmlify($owner['url']), '$url' => xmlify($owner['url']),
'$request' => xmlify($owner['request']), '$request' => xmlify($owner['request']),
'$confirm' => xmlify($owner['confirm']), '$confirm' => xmlify($owner['confirm']),
@ -438,7 +446,7 @@ function notifier_run($argv, $argc){
//'$prvkey' => xmlify($owner['prvkey']), //'$prvkey' => xmlify($owner['prvkey']),
)); ));
$recipients_relocate = q("SELECT * FROM contact WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN); $recipients_relocate = q("SELECT * FROM contact WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
unset($photos);
} }
else { else {
if($followup) { if($followup) {

View file

@ -4,8 +4,8 @@
<dfrn:url>$url</dfrn:url> <dfrn:url>$url</dfrn:url>
<dfrn:name>$name</dfrn:name> <dfrn:name>$name</dfrn:name>
<dfrn:photo>$photo</dfrn:photo> <dfrn:photo>$photo</dfrn:photo>
<dfrn:photo>$thumb</dfrn:photo> <dfrn:thumb>$thumb</dfrn:thumb>
<dfrn:photo>$micro</dfrn:photo> <dfrn:micro>$micro</dfrn:micro>
<dfrn:request>$request</dfrn:request> <dfrn:request>$request</dfrn:request>
<dfrn:confirm>$confirm</dfrn:confirm> <dfrn:confirm>$confirm</dfrn:confirm>
<dfrn:notify>$notify</dfrn:notify> <dfrn:notify>$notify</dfrn:notify>