}
require_once('include/contact_selectors.php');
- $network_name = network_to_name($uinfo[0]['network']);
+ $network_name = network_to_name($uinfo[0]['network'], $uinfo[0]['url']);
$ret = Array(
'id' => intval($r[0]['id']),
$status_info["entities"] = $converted["entities"];
if (($lastwall['item_network'] != "") AND ($status["source"] == 'web'))
- $status_info["source"] = network_to_name($lastwall['item_network']);
- elseif (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network']) != $status_info["source"]))
- $status_info["source"] = trim($status_info["source"].' ('.network_to_name($lastwall['item_network']).')');
+ $status_info["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
+ elseif (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network'], $user_info['url']) != $status_info["source"]))
+ $status_info["source"] = trim($status_info["source"].' ('.network_to_name($lastwall['item_network'], $user_info['url']).')');
// "uid" and "self" are only needed for some internal stuff, so remove it from here
unset($status_info["user"]["uid"]);
$user_info["status"]["entities"] = $converted["entities"];
if (($lastwall['item_network'] != "") AND ($user_info["status"]["source"] == 'web'))
- $user_info["status"]["source"] = network_to_name($lastwall['item_network']);
- if (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network']) != $user_info["status"]["source"]))
- $user_info["status"]["source"] = trim($user_info["status"]["source"].' ('.network_to_name($lastwall['item_network']).')');
+ $user_info["status"]["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
+ if (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network'], $user_info['url']) != $user_info["status"]["source"]))
+ $user_info["status"]["source"] = trim($user_info["status"]["source"].' ('.network_to_name($lastwall['item_network'], $user_info['url']).')');
}
$status["entities"] = $converted["entities"];
if (($item['item_network'] != "") AND ($status["source"] == 'web'))
- $status["source"] = network_to_name($item['item_network']);
- else if (($item['item_network'] != "") AND (network_to_name($item['item_network']) != $status["source"]))
- $status["source"] = trim($status["source"].' ('.network_to_name($item['item_network']).')');
+ $status["source"] = network_to_name($item['item_network'], $user_info['url']);
+ else if (($item['item_network'] != "") AND (network_to_name($item['item_network'], $user_info['url']) != $status["source"]))
+ $status["source"] = trim($status["source"].' ('.network_to_name($item['item_network'], $user_info['url']).')');
// Retweets are only valid for top postings
<?php
-
+require_once('include/diaspora.php');
function contact_profile_assign($current,$foreign_net) {
}
-function network_to_name($s) {
+function network_to_name($s, $profile = "") {
$nets = array(
NETWORK_DFRN => t('Friendica'),
$search = array_keys($nets);
$replace = array_values($nets);
- return str_replace($search,$replace,$s);
+ $networkname = str_replace($search,$replace,$s);
+
+ if (($s == NETWORK_DIASPORA) AND ($profile != "") AND diaspora_is_redmatrix($profile))
+ $networkname = t("Redmatrix");
+ return $networkname;
}
if (($profile['network'] != "") AND ($profile['network'] != NETWORK_DFRN)) {
require_once('include/contact_selectors.php');
if ($profile['url'] != "")
- $profile['network_name'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'])."</a>";
+ $profile['network_name'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'], $profile['url'])."</a>";
else
$profile['network_name'] = network_to_name($profile['network']);
} else
$datarray['private'] = 0;
}
- //if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
- // $datarray["app"] = network_to_name($contact['network']);
-
if ($contact['network'] != NETWORK_FEED) {
// Store the original post
$r = item_store($datarray2, false, false);
);
if(! count($contacts)) {
+ // Maybe it is a Redmatrix account. Then we can fetch their contacts via poco
+ $contacts = q("SELECT `id`, `poco` FROM `contact` WHERE `id` = %d AND `poco` != ''", intval($contact_id));
+ if ($contacts)
+ poco_load($contacts[0]['id'],$importer_uid,0,$contacts[0]['poco']);
return;
}
$keywords = implode(", ", $tag);
// If you query a Friendica server for its profiles, the network has to be Friendica
- if ($uid == 0)
- $network = NETWORK_DFRN;
+ // To-Do: It could also be a Redmatrix server
+ //if ($uid == 0)
+ // $network = NETWORK_DFRN;
poco_check($profile_url, $name, $network, $profile_photo, $about, $location, $gender, $keywords, $connect_url, $updated, $generation, $cid, $uid, $zcid);
$poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2));
- $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network']));
+ $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network'], $contact["url"]));
$common = count_common_friends(local_user(),$contact['id']);
$common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
'sparkle' => $sparkle,
'itemurl' => $rr['url'],
'url' => $url,
- 'network' => network_to_name($rr['network']),
+ 'network' => network_to_name($rr['network'], $rr['url']),
);
-
-}
\ No newline at end of file
+
+}
'id' => $rr['id'],
'alt_text' => $alt_text,
'dir_icon' => $dir_icon,
- 'thumb' => $rr['thumb'],
+ 'thumb' => $rr['thumb'],
'name' => $rr['name'],
'username' => $rr['name'],
'sparkle' => $sparkle,
'itemurl' => $rr['url'],
'url' => $url,
- 'network' => network_to_name($rr['network']),
+ 'network' => network_to_name($rr['network'], $url),
);
}
}
'$header' => t('Contacts who are not members of a group'),
'$contacts' => $contacts,
'$paginate' => paginate($a),
- ));
-
+ ));
+
return $o;
}
'url' => $url,
'sparkle' => '',
'itemurl' => $rr['url'],
- 'network' => network_to_name($rr['network']),
+ 'network' => network_to_name($rr['network'], $rr['url']),
);
}
require_once('object/BaseObject.php');
require_once('include/text.php');
+require_once('include/diaspora.php');
require_once('boot.php');
/**
*/
public function get_template_data($alike, $dlike, $thread_level=1) {
require_once("mod/proxy.php");
- require_once("include/diaspora.php");
$result = array();
'postopts' => $langstr,
'edited' => $edited,
'network' => $item["item_network"],
- 'network_name' => network_to_name($item['item_network']),
+ 'network_name' => network_to_name($item['item_network'], $profile_link),
);
$arr = array('item' => $item, 'output' => $tmp_item);