nearly ready for the output template
This commit is contained in:
parent
fbdee83dca
commit
6f390330ff
@ -80,9 +80,30 @@ function advanced_profile(&$a) {
|
|||||||
|
|
||||||
if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt );
|
if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt );
|
||||||
|
|
||||||
|
$r = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_page = '%s' and uid = %d and obj_type = %d
|
||||||
|
order by obj_verb, term",
|
||||||
|
dbesc($a->profile['profile_guid']),
|
||||||
|
intval($a->profile['profile_uid']),
|
||||||
|
intval(TERM_OBJ_THING)
|
||||||
|
);
|
||||||
|
|
||||||
|
$things = null;
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$things = array();
|
||||||
|
foreach($r as $rr) {
|
||||||
|
if(! $things[$rr['obj_verb']])
|
||||||
|
$things[$rr['obj_verb']] = array();
|
||||||
|
$things[$rr['obj_verb']][] = array('term' => $rr['term'],'url' => $rr['url'],'img' => $rr['imgurl']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
|
||||||
|
|
||||||
return replace_macros($tpl, array(
|
return replace_macros($tpl, array(
|
||||||
'$title' => t('Profile'),
|
'$title' => t('Profile'),
|
||||||
'$profile' => $profile,
|
'$profile' => $profile,
|
||||||
|
'$things' => $things
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +99,12 @@ function thing_init(&$a) {
|
|||||||
}
|
}
|
||||||
$term = $r[0];
|
$term = $r[0];
|
||||||
|
|
||||||
$r = q("insert into obj ( obj_page, obj_verb, obj_type, obj_channel) values ('%s','%s', %d,%d) ",
|
$r = q("insert into obj ( obj_page, obj_verb, obj_type, obj_channel, obj_obj) values ('%s','%s', %d, %d, '%s') ",
|
||||||
dbesc($profile),
|
dbesc($profile),
|
||||||
dbesc($verb),
|
dbesc($verb),
|
||||||
intval(TERM_OBJ_THING),
|
intval(TERM_OBJ_THING),
|
||||||
intval(local_user())
|
intval(local_user()),
|
||||||
|
dbesc($term['term_hash'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
|
Reference in New Issue
Block a user