unify hcard and vcard
This commit is contained in:
parent
0278e60664
commit
89c5989cfb
23 changed files with 234 additions and 124 deletions
|
@ -21,23 +21,30 @@ function videos_init(&$a) {
|
|||
|
||||
if($a->argc > 1) {
|
||||
$nick = $a->argv[1];
|
||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
|
||||
$user = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
|
||||
dbesc($nick)
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! count($user))
|
||||
return;
|
||||
|
||||
$a->data['user'] = $r[0];
|
||||
$a->profile_uid = $r[0]['uid'];
|
||||
$a->data['user'] = $user[0];
|
||||
$a->profile_uid = $user[0]['uid'];
|
||||
|
||||
$profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
|
||||
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
|
||||
|
||||
if((x($profile['page-flags']) == 1)
|
||||
|| (x($profile['page-flags']) == 2)
|
||||
|| (x($profile['page-flags']) == 5))
|
||||
$account_type = page_type_translate($profile['page-flags']);
|
||||
|
||||
$tpl = get_markup_template("vcard-widget.tpl");
|
||||
|
||||
$vcard_widget = replace_macros($tpl, array(
|
||||
'$name' => $a->data['user']['username'],
|
||||
'$photo' => $profilephoto
|
||||
$vcard_widget .= replace_macros($tpl, array(
|
||||
'$name' => $profile[name],
|
||||
'$photo' => $profile[photo],
|
||||
'$addr' => (($profile['addr'] != "") ? $profile['addr'] : ''),
|
||||
'$account_type' => $account_type,
|
||||
));
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue