Merge pull request #1618 from rabuzarus/vcard
remove html and make use of vcard-widget.tpl
This commit is contained in:
commit
9a22b4818e
6 changed files with 50 additions and 33 deletions
|
@ -20,13 +20,15 @@ function allfriends_content(&$a) {
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
$a->page['aside'] .= '<div class="vcard">'
|
$vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
|
||||||
. '<div class="fn label">' . $c[0]['name'] . '</div>'
|
'$name' => $c[0]['name'],
|
||||||
. '<div id="profile-photo-wrapper">'
|
'$photo' => $c[0]['photo'],
|
||||||
. '<a href="/contacts/' . $cid . '"><img class="photo" width="175" height="175"
|
'url' => z_root() . '/contacts/' . $cid
|
||||||
src="' . $c[0]['photo'] . '" alt="' . $c[0]['name'] . '" /></div>'
|
));
|
||||||
. '</div>';
|
|
||||||
|
if(! x($a->page,'aside'))
|
||||||
|
$a->page['aside'] = '';
|
||||||
|
$a->page['aside'] .= $vcard_widget;
|
||||||
|
|
||||||
if(! count($c))
|
if(! count($c))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -28,13 +28,15 @@ function common_content(&$a) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$a->page['aside'] .= '<div class="vcard">'
|
$vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
|
||||||
. '<div class="fn label">' . $c[0]['name'] . '</div>'
|
'$name' => $c[0]['name'],
|
||||||
. '<div id="profile-photo-wrapper">'
|
'$photo' => $c[0]['photo'],
|
||||||
. '<img class="photo" width="175" height="175"
|
'url' => z_root() . '/contacts/' . $cid
|
||||||
src="' . $c[0]['photo'] . '" alt="' . $c[0]['name'] . '" /></div>'
|
));
|
||||||
. '</div>';
|
|
||||||
|
if(! x($a->page,'aside'))
|
||||||
|
$a->page['aside'] = '';
|
||||||
|
$a->page['aside'] .= $vcard_widget;
|
||||||
|
|
||||||
if(! count($c))
|
if(! count($c))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -22,11 +22,12 @@ function crepair_init(&$a) {
|
||||||
|
|
||||||
if($contact_id) {
|
if($contact_id) {
|
||||||
$a->data['contact'] = $r[0];
|
$a->data['contact'] = $r[0];
|
||||||
$o .= '<div class="vcard">';
|
$tpl = get_markup_template("vcard-widget.tpl");
|
||||||
$o .= '<div class="fn">' . $a->data['contact']['name'] . '</div>';
|
$vcard_widget .= replace_macros($tpl, array(
|
||||||
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->data['contact']['photo'] . '" alt="' . $a->data['contact']['name'] . '" /></div>';
|
'$name' => $a->data['contact']['name'],
|
||||||
$o .= '</div>';
|
'$photo' => $a->data['contact']['photo']
|
||||||
$a->page['aside'] .= $o;
|
));
|
||||||
|
$a->page['aside'] .= $vcard_widget;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,14 @@ function photos_init(&$a) {
|
||||||
|
|
||||||
$a->data['user'] = $r[0];
|
$a->data['user'] = $r[0];
|
||||||
|
|
||||||
$o .= '<div class="vcard">';
|
$profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
|
||||||
$o .= '<div class="fn">' . $a->data['user']['username'] . '</div>';
|
|
||||||
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
|
$tpl = get_markup_template("vcard-widget.tpl");
|
||||||
$o .= '</div>';
|
|
||||||
|
$vcard_widget .= replace_macros($tpl, array(
|
||||||
|
'$name' => $a->data['user']['username'],
|
||||||
|
'$photo' => $profilephoto
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
$sql_extra = permissions_sql($a->data['user']['uid']);
|
$sql_extra = permissions_sql($a->data['user']['uid']);
|
||||||
|
@ -72,6 +76,7 @@ function photos_init(&$a) {
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
|
$a->page['aside'] .= $vcard_widget;
|
||||||
$a->page['aside'] .= $o;
|
$a->page['aside'] .= $o;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,14 @@ function videos_init(&$a) {
|
||||||
|
|
||||||
$a->data['user'] = $r[0];
|
$a->data['user'] = $r[0];
|
||||||
|
|
||||||
$o .= '<div class="vcard">';
|
$profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
|
||||||
$o .= '<div class="fn">' . $a->data['user']['username'] . '</div>';
|
|
||||||
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
|
$tpl = get_markup_template("vcard-widget.tpl");
|
||||||
$o .= '</div>';
|
|
||||||
|
$vcard_widget = replace_macros($tpl, array(
|
||||||
|
'$name' => $a->data['user']['username'],
|
||||||
|
'$photo' => $profilephoto
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
/*$sql_extra = permissions_sql($a->data['user']['uid']);
|
/*$sql_extra = permissions_sql($a->data['user']['uid']);
|
||||||
|
@ -70,7 +74,7 @@ function videos_init(&$a) {
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
$a->page['aside'] .= $o;
|
$a->page['aside'] .= $vcard_widget;
|
||||||
|
|
||||||
|
|
||||||
$tpl = get_markup_template("videos_head.tpl");
|
$tpl = get_markup_template("videos_head.tpl");
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
|
|
||||||
<div class="vcard">
|
<div class="vcard">
|
||||||
<div class="fn"><a href="{{$url}}">{{$name}}</a></div>
|
<div class="fn">{{$name}}</div>
|
||||||
<div id="profile-photo-wrapper"><a href="{{$url}}"><img class="photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></a></div>
|
{{if $url}}
|
||||||
</div>
|
<div id="profile-photo-wrapper"><a href="{{$url}}"><img class="vcard-photo photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></a></div>
|
||||||
|
{{else}}
|
||||||
|
<div id="profile-photo-wrapper"><img class="vcard-photo photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue