Let the notification look more like the follow dialog
This commit is contained in:
parent
83ea4f7253
commit
4003b9cc5d
2 changed files with 18 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
include_once("include/bbcode.php");
|
include_once("include/bbcode.php");
|
||||||
|
include_once("include/contact_selectors.php");
|
||||||
|
|
||||||
function notifications_post(&$a) {
|
function notifications_post(&$a) {
|
||||||
|
|
||||||
|
@ -138,7 +139,8 @@ function notifications_content(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*, `fcontact`.`name` AS `fname`,`fcontact`.`url` AS `furl`,`fcontact`.`photo` AS `fphoto`,`fcontact`.`request` AS `frequest`,
|
$r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*, `fcontact`.`name` AS `fname`,`fcontact`.`url` AS `furl`,`fcontact`.`photo` AS `fphoto`,`fcontact`.`request` AS `frequest`,
|
||||||
`gcontact`.`location` AS `glocation`, `gcontact`.`about` AS `gabout`,
|
`gcontact`.`location` AS `glocation`, `gcontact`.`about` AS `gabout`,
|
||||||
`gcontact`.`keywords` AS `gkeywords`, `gcontact`.`gender` AS `ggender`
|
`gcontact`.`keywords` AS `gkeywords`, `gcontact`.`gender` AS `ggender`,
|
||||||
|
`gcontact`.`network` AS `gnetwork`
|
||||||
FROM `intro`
|
FROM `intro`
|
||||||
LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
|
LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
|
||||||
LEFT JOIN `gcontact` ON `gcontact`.`nurl` = `contact`.`nurl`
|
LEFT JOIN `gcontact` ON `gcontact`.`nurl` = `contact`.`nurl`
|
||||||
|
@ -152,6 +154,7 @@ function notifications_content(&$a) {
|
||||||
$tpl = get_markup_template("intros.tpl");
|
$tpl = get_markup_template("intros.tpl");
|
||||||
|
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
|
|
||||||
if($rr['fid']) {
|
if($rr['fid']) {
|
||||||
|
|
||||||
$return_addr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
|
$return_addr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
|
||||||
|
@ -206,7 +209,20 @@ function notifications_content(&$a) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$header = $rr["name"];
|
||||||
|
|
||||||
|
$ret = probe_url($rr["url"]);
|
||||||
|
|
||||||
|
if ($rr['gnetwork'] == "")
|
||||||
|
$rr['gnetwork'] = $ret["network"];
|
||||||
|
|
||||||
|
if ($ret["addr"] != "")
|
||||||
|
$header .= " <".$ret["addr"].">";
|
||||||
|
|
||||||
|
$header .= " (".network_to_name($rr['gnetwork']).")";
|
||||||
|
|
||||||
$notif_content .= replace_macros($tpl, array(
|
$notif_content .= replace_macros($tpl, array(
|
||||||
|
'$header' => htmlentities($header),
|
||||||
'$str_notifytype' => t('Notification type: '),
|
'$str_notifytype' => t('Notification type: '),
|
||||||
'$notify_type' => (($rr['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
|
'$notify_type' => (($rr['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
|
||||||
'$dfrn_text' => $dfrn_text,
|
'$dfrn_text' => $dfrn_text,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
<h2>{{$header}}</h2>
|
||||||
|
|
||||||
<div class="intro-wrapper" id="intro-{{$contact_id}}" >
|
<div class="intro-wrapper" id="intro-{{$contact_id}}" >
|
||||||
|
|
||||||
<p class="intro-desc">{{$str_notifytype}} {{$notify_type}}</p>
|
<p class="intro-desc">{{$str_notifytype}} {{$notify_type}}</p>
|
||||||
<a class="intro-url-link" id="intro-url-link-{{$contact_id}}" href="{{$url}}" ><div class="intro-fullname" id="intro-fullname-{{$contact_id}}" >{{$fullname}}</div></a>
|
|
||||||
<img id="photo-{{$contact_id}}" class="intro-photo" src="{{$photo}}" width="175" height=175" title="{{$fullname|escape:'html'}}" alt="{{$fullname|escape:'html'}}" />
|
<img id="photo-{{$contact_id}}" class="intro-photo" src="{{$photo}}" width="175" height=175" title="{{$fullname|escape:'html'}}" alt="{{$fullname|escape:'html'}}" />
|
||||||
<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$url}}">{{$url}}</a></dd></dl>
|
<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$url}}">{{$url}}</a></dd></dl>
|
||||||
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
|
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
|
||||||
|
|
Loading…
Reference in a new issue