aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-08 20:57:37 -0800
committerfriendica <info@friendica.com>2015-02-08 20:57:37 -0800
commit08b757a22cd2804bfec8ecf682b6987b8c06ca49 (patch)
tree477f3a8e84388aab2a4f3c938a166597c7467d19 /include/network.php
parent4b348d248975ba07ba9cea62f51eb52d6afb5645 (diff)
parent247579ebf13ead372eee87bd2351078f7219321e (diff)
downloadvolse-hubzilla-08b757a22cd2804bfec8ecf682b6987b8c06ca49.tar.gz
volse-hubzilla-08b757a22cd2804bfec8ecf682b6987b8c06ca49.tar.bz2
volse-hubzilla-08b757a22cd2804bfec8ecf682b6987b8c06ca49.zip
Merge branch 'master' into tres
Conflicts: mod/events.php view/css/mod_events.css
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php
index 5f95cf0e0..84c1c17f8 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1522,3 +1522,27 @@ function scrape_feed($url) {
return $ret;
}
+
+
+function service_plink($contact, $guid) {
+
+ $plink = '';
+
+ $m = parse_url($contact['xchan_url']);
+ if($m) {
+ $url = $scheme . '://' . $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
+ }
+ else
+ $url = 'https://' . substr($contact['xchan_addr'],strpos($contact['xchan_addr'],'@')+1);
+
+ $handle = substr($contact['xchan_addr'], 0, strpos($contact['xchan_addr'],'@'));
+
+ if($contact['xchan_network'] === 'diaspora')
+ $plink = $url . '/posts/' . $guid;
+ if($contact['xchan_network'] === 'friendica-over-diaspora')
+ $plink = $url . '/display/' . $handle . '/' . $guid;
+ if($contact['xchan_network'] === 'zot')
+ $plink = $url . '/channel/' . $handle . '?f=&mid=' . $guid;
+
+ return $plink;
+}