Merge pull request #1937 from annando/1510-follow-notifications
Show RedMatrix and use the proxy for the profile pictures
This commit is contained in:
commit
5545008768
|
@ -219,17 +219,20 @@ function contact_photo_menu($contact) {
|
||||||
$status_link = $profile_link . "?url=status";
|
$status_link = $profile_link . "?url=status";
|
||||||
$photos_link = $profile_link . "?url=photos";
|
$photos_link = $profile_link . "?url=photos";
|
||||||
$profile_link = $profile_link . "?url=profile";
|
$profile_link = $profile_link . "?url=profile";
|
||||||
$pm_url = $a->get_baseurl() . '/message/new/' . $contact['id'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id'];
|
if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA)))
|
||||||
|
$pm_url = $a->get_baseurl() . '/message/new/' . $contact['id'];
|
||||||
|
|
||||||
|
if ($contact["network"] == NETWORK_DFRN)
|
||||||
|
$poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id'];
|
||||||
|
|
||||||
$contact_url = $a->get_baseurl() . '/contacts/' . $contact['id'];
|
$contact_url = $a->get_baseurl() . '/contacts/' . $contact['id'];
|
||||||
$posts_link = $a->get_baseurl() . '/network/0?nets=all&cid=' . $contact['id'];
|
$posts_link = $a->get_baseurl() . '/network/0?nets=all&cid=' . $contact['id'];
|
||||||
$contact_drop_link = $a->get_baseurl() . "/contacts/" . $contact['id'] . '/drop?confirm=1';
|
$contact_drop_link = $a->get_baseurl() . "/contacts/" . $contact['id'] . '/drop?confirm=1';
|
||||||
|
|
||||||
|
|
||||||
$menu = Array(
|
$menu = Array(
|
||||||
'poke' => array(t("Poke"), $poke_link),
|
|
||||||
'status' => array(t("View Status"), $status_link),
|
'status' => array(t("View Status"), $status_link),
|
||||||
'profile' => array(t("View Profile"), $profile_link),
|
'profile' => array(t("View Profile"), $profile_link),
|
||||||
'photos' => array(t("View Photos"), $photos_link),
|
'photos' => array(t("View Photos"), $photos_link),
|
||||||
|
@ -237,6 +240,7 @@ function contact_photo_menu($contact) {
|
||||||
'edit' => array(t("Edit Contact"), $contact_url),
|
'edit' => array(t("Edit Contact"), $contact_url),
|
||||||
'drop' => array(t("Drop Contact"), $contact_drop_link),
|
'drop' => array(t("Drop Contact"), $contact_drop_link),
|
||||||
'pm' => array(t("Send PM"), $pm_url),
|
'pm' => array(t("Send PM"), $pm_url),
|
||||||
|
'poke' => array(t("Poke"), $poke_link),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -254,6 +258,7 @@ function contact_photo_menu($contact) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $o;*/
|
return $o;*/
|
||||||
|
|
||||||
foreach($menu as $k=>$v){
|
foreach($menu as $k=>$v){
|
||||||
if ($v[1]!="") {
|
if ($v[1]!="") {
|
||||||
if(($v[0] !== t("Network Posts")) && ($v[0] !== t("Send PM")) && ($v[0] !== t('Edit Contact')))
|
if(($v[0] !== t("Network Posts")) && ($v[0] !== t("Send PM")) && ($v[0] !== t('Edit Contact')))
|
||||||
|
@ -262,7 +267,14 @@ function contact_photo_menu($contact) {
|
||||||
$menu[$k][2] = 0;
|
$menu[$k][2] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $menu;
|
|
||||||
|
$menucondensed = array();
|
||||||
|
|
||||||
|
foreach ($menu AS $menuitem)
|
||||||
|
if ($menuitem[1] != "")
|
||||||
|
$menucondensed[] = $menuitem;
|
||||||
|
|
||||||
|
return $menucondensed;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -792,10 +792,16 @@ function best_link_url($item,&$sparkle,$ssl_state = false) {
|
||||||
if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
|
if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
|
||||||
$best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id'];
|
$best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id'];
|
||||||
$sparkle = true;
|
$sparkle = true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$best_url = $a->contacts[$clean_url]['url'];
|
$best_url = $a->contacts[$clean_url]['url'];
|
||||||
}
|
}
|
||||||
|
} elseif (local_user()) {
|
||||||
|
$r = q("SELECT `id`, `network` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s'",
|
||||||
|
dbesc(NETWORK_DFRN), intval(local_user()), dbesc(normalise_link($clean_url)));
|
||||||
|
if ($r) {
|
||||||
|
$best_url = $a->get_baseurl($ssl_state).'/redir/'.$r[0]['id'];
|
||||||
|
$sparkle = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(! $best_url) {
|
if(! $best_url) {
|
||||||
if(strlen($item['author-link']))
|
if(strlen($item['author-link']))
|
||||||
|
@ -848,13 +854,16 @@ function item_photo_menu($item){
|
||||||
$profile_link = zrl($profile_link);
|
$profile_link = zrl($profile_link);
|
||||||
if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
|
if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
|
||||||
$cid = $item['contact-id'];
|
$cid = $item['contact-id'];
|
||||||
}
|
} else {
|
||||||
else {
|
$r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' ORDER BY `uid` DESC LIMIT 1",
|
||||||
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' ORDER BY `uid` DESC LIMIT 1",
|
intval(local_user()), dbesc(normalise_link($item['author-link'])));
|
||||||
intval($item['uid']), normalise_link($item['author-link']));
|
if ($r) {
|
||||||
if ($r)
|
|
||||||
$cid = $r[0]["id"];
|
$cid = $r[0]["id"];
|
||||||
else
|
|
||||||
|
if ($r[0]["network"] == NETWORK_DIASPORA)
|
||||||
|
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
|
||||||
|
|
||||||
|
} else
|
||||||
$cid = 0;
|
$cid = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('include/contact_widgets.php');
|
require_once('include/contact_widgets.php');
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
|
require_once('include/Contact.php');
|
||||||
|
|
||||||
function dirfind_init(&$a) {
|
function dirfind_init(&$a) {
|
||||||
|
|
||||||
|
@ -113,6 +114,8 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
|
|
||||||
if(count($j->results)) {
|
if(count($j->results)) {
|
||||||
|
|
||||||
|
$id = 0;
|
||||||
|
|
||||||
$tpl = get_markup_template('match.tpl');
|
$tpl = get_markup_template('match.tpl');
|
||||||
foreach($j->results as $jj) {
|
foreach($j->results as $jj) {
|
||||||
|
|
||||||
|
@ -120,9 +123,16 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
if ($jj->cid > 0) {
|
if ($jj->cid > 0) {
|
||||||
$connlnk = "";
|
$connlnk = "";
|
||||||
$conntxt = "";
|
$conntxt = "";
|
||||||
|
$contact = q("SELECT * FROM `contact` WHERE `id` = %d",
|
||||||
|
intval($jj->cid));
|
||||||
|
if ($contact)
|
||||||
|
$photo_menu = contact_photo_menu($contact[0]);
|
||||||
|
else
|
||||||
|
$photo_menu = array();
|
||||||
} else {
|
} else {
|
||||||
$connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
|
$connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
|
||||||
$conntxt = t('Connect');
|
$conntxt = t('Connect');
|
||||||
|
$photo_menu = array(array(t("Connect/Follow"), $connlnk));
|
||||||
}
|
}
|
||||||
|
|
||||||
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
|
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
|
||||||
|
@ -134,6 +144,8 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
'$tags' => $jj->tags,
|
'$tags' => $jj->tags,
|
||||||
'$conntxt' => $conntxt,
|
'$conntxt' => $conntxt,
|
||||||
'$connlnk' => $connlnk,
|
'$connlnk' => $connlnk,
|
||||||
|
'$photo_menu' => $photo_menu,
|
||||||
|
'$id' => ++$id,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,11 +72,11 @@ function follow_content(&$a) {
|
||||||
if ($ret["addr"] != "")
|
if ($ret["addr"] != "")
|
||||||
$header .= " <".$ret["addr"].">";
|
$header .= " <".$ret["addr"].">";
|
||||||
|
|
||||||
$header .= " (".network_to_name($ret['network']).")";
|
$header .= " (".network_to_name($ret['network'], $ret['url']).")";
|
||||||
|
|
||||||
$o = replace_macros($tpl,array(
|
$o = replace_macros($tpl,array(
|
||||||
'$header' => htmlentities($header),
|
'$header' => htmlentities($header),
|
||||||
'$photo' => $ret["photo"],
|
'$photo' => proxy_url($ret["photo"]),
|
||||||
'$desc' => "",
|
'$desc' => "",
|
||||||
'$pls_answer' => t('Please answer the following:'),
|
'$pls_answer' => t('Please answer the following:'),
|
||||||
'$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', array(t('No'),t('Yes'))),
|
'$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', array(t('No'),t('Yes'))),
|
||||||
|
|
|
@ -166,7 +166,7 @@ function notifications_content(&$a) {
|
||||||
'$intro_id' => $rr['intro_id'],
|
'$intro_id' => $rr['intro_id'],
|
||||||
'$madeby' => sprintf( t('suggested by %s'),$rr['name']),
|
'$madeby' => sprintf( t('suggested by %s'),$rr['name']),
|
||||||
'$contact_id' => $rr['contact-id'],
|
'$contact_id' => $rr['contact-id'],
|
||||||
'$photo' => ((x($rr,'fphoto')) ? $rr['fphoto'] : "images/person-175.jpg"),
|
'$photo' => ((x($rr,'fphoto')) ? proxy_url($rr['fphoto']) : "images/person-175.jpg"),
|
||||||
'$fullname' => $rr['fname'],
|
'$fullname' => $rr['fname'],
|
||||||
'$url' => zrl($rr['furl']),
|
'$url' => zrl($rr['furl']),
|
||||||
'$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
|
'$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
|
||||||
|
@ -220,7 +220,7 @@ function notifications_content(&$a) {
|
||||||
if ($ret["addr"] != "")
|
if ($ret["addr"] != "")
|
||||||
$header .= " <".$ret["addr"].">";
|
$header .= " <".$ret["addr"].">";
|
||||||
|
|
||||||
$header .= " (".network_to_name($rr['gnetwork']).")";
|
$header .= " (".network_to_name($rr['gnetwork'], $rr['url']).")";
|
||||||
|
|
||||||
$notif_content .= replace_macros($tpl, array(
|
$notif_content .= replace_macros($tpl, array(
|
||||||
'$header' => htmlentities($header),
|
'$header' => htmlentities($header),
|
||||||
|
@ -368,7 +368,7 @@ function notifications_content(&$a) {
|
||||||
foreach ($r as $it) {
|
foreach ($r as $it) {
|
||||||
$notif_content .= replace_macros($not_tpl,array(
|
$notif_content .= replace_macros($not_tpl,array(
|
||||||
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
|
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
|
||||||
'$item_image' => $it['photo'],
|
'$item_image' => proxy_url($it['photo']),
|
||||||
'$item_text' => strip_tags(bbcode($it['msg'])),
|
'$item_text' => strip_tags(bbcode($it['msg'])),
|
||||||
'$item_when' => relative_date($it['date'])
|
'$item_when' => relative_date($it['date'])
|
||||||
));
|
));
|
||||||
|
|
|
@ -1,9 +1,25 @@
|
||||||
|
|
||||||
<div class="profile-match-wrapper">
|
<div class="profile-match-wrapper">
|
||||||
<div class="profile-match-photo">
|
<div class="profile-match-photo" id="contact-entry-photo-{{$id}}"
|
||||||
|
onmouseover="if (typeof t{{$id}} != 'undefined') clearTimeout(t{{$id}}); openMenu('contact-photo-menu-button-{{$id}}')"
|
||||||
|
onmouseout="t{{$id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$id}}\'); closeMenu(\'contact-photo-menu-{{$id}}\');',200)" >
|
||||||
<a href="{{$url}}">
|
<a href="{{$url}}">
|
||||||
<img width="80" height="80" src="{{$photo}}" alt="{{$name}}" title="{{$name}}[{{$tags}}]" />
|
<img width="80" height="80" src="{{$photo}}" alt="{{$name}}" title="{{$name}}[{{$tags}}]" />
|
||||||
</a>
|
</a>
|
||||||
|
{{if $photo_menu}}
|
||||||
|
<span onclick="openClose('contact-photo-menu-{{$id}}');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-{{$id}}">menu</span>
|
||||||
|
<div class="contact-photo-menu" id="contact-photo-menu-{{$id}}">
|
||||||
|
<ul>
|
||||||
|
{{foreach $photo_menu as $k=>$c}}
|
||||||
|
{{if $c.2}}
|
||||||
|
<li><a class="{{$k}}" target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
|
||||||
|
{{else}}
|
||||||
|
<li><a class="{{$k}}" href="{{$c.1}}">{{$c.0}}</a></li>
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="profile-match-break"></div>
|
<div class="profile-match-break"></div>
|
||||||
<div class="profile-match-name">
|
<div class="profile-match-name">
|
||||||
|
|
Loading…
Reference in a new issue