]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #2119 from annando/1511-contact-evolution
authorfabrixxm <fabrix.xm@gmail.com>
Mon, 30 Nov 2015 13:45:23 +0000 (14:45 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Mon, 30 Nov 2015 13:45:23 +0000 (14:45 +0100)
Refurbished contact settings/contact posts

1  2 
include/Contact.php

diff --combined include/Contact.php
index fe73557de3c346d7762abc1be26f425adc326ae3,a30a3c6c7aaa2363c960e423263b7459358073d0..6673e6911d693c5f6ee793453881357c143ca9e7
@@@ -286,7 -286,7 +286,7 @@@ function get_contact_details_by_url($ur
  }
  
  if(! function_exists('contact_photo_menu')){
 -function contact_photo_menu($contact) {
 +function contact_photo_menu($contact, $uid = 0) {
  
        $a = get_app();
  
        $contact_drop_link = "";
        $poke_link="";
  
 +      if ($uid == 0)
 +              $uid = local_user();
 +
 +      if ($contact["uid"] != $uid) {
 +              if ($uid == 0) {
 +                      $profile_link = zrl($contact['url']);
 +                      $menu = Array('profile' => array(t("View Profile"), $profile_link, true));
 +
 +                      return $menu;
 +              }
 +
 +              $r = q("SELECT * FROM `contact` WHERE `nurl` = '%s' AND `network` = '%s' AND `uid` = %d",
 +                      dbesc($contact["nurl"]), dbesc($contact["network"]), intval($uid));
 +              if ($r)
 +                      return contact_photo_menu($r[0], $uid);
 +              else {
 +                      $profile_link = zrl($contact['url']);
 +                      $connlnk = 'follow/?url='.$contact['url'];
 +                      $menu = Array(
 +                              'profile' => array(t("View Profile"), $profile_link, true),
 +                              'follow' => array(t("Connect/Follow"), $connlnk, true)
 +                              );
 +
 +                      return $menu;
 +              }
 +      }
 +
        $sparkle = false;
        if($contact['network'] === NETWORK_DFRN) {
                $sparkle = true;
                $poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $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() . "/contacts/" . $contact['id'] . '/posts';
        $contact_drop_link = $a->get_baseurl() . "/contacts/" . $contact['id'] . '/drop?confirm=1';