]> git.mxchange.org Git - friendica.git/commitdiff
Let the notification look more like the follow dialog
authorMichael Vogel <icarus@dabo.de>
Sun, 4 Oct 2015 15:18:58 +0000 (17:18 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 4 Oct 2015 15:18:58 +0000 (17:18 +0200)
mod/notifications.php
view/templates/intros.tpl

index 831beee765d4c4c6105a7ce90caad2fb6f69c516..513f685b477b9cf100a12045bfe11706bdbc24df 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 include_once("include/bbcode.php");
+include_once("include/contact_selectors.php");
 
 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`,
                                `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`
                                LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
                                LEFT JOIN `gcontact` ON `gcontact`.`nurl` = `contact`.`nurl`
@@ -152,6 +154,7 @@ function notifications_content(&$a) {
                        $tpl = get_markup_template("intros.tpl");
 
                        foreach($r as $rr) {
+
                                if($rr['fid']) {
 
                                        $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(
+                                       '$header' => htmlentities($header),
                                        '$str_notifytype' => t('Notification type: '),
                                        '$notify_type' => (($rr['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
                                        '$dfrn_text' => $dfrn_text,
index d50b14cd41041afe4643e8bacacac552bd8ffec0..8e5a24a6b8d074fd017c6986699b9590e16cc348 100644 (file)
@@ -1,9 +1,8 @@
-
+<h2>{{$header}}</h2>
 
 <div class="intro-wrapper" id="intro-{{$contact_id}}" >
 
 <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'}}" />
 <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}}