diff options
author | friendica <info@friendica.com> | 2015-02-08 20:57:37 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-02-08 20:57:37 -0800 |
commit | 08b757a22cd2804bfec8ecf682b6987b8c06ca49 (patch) | |
tree | 477f3a8e84388aab2a4f3c938a166597c7467d19 /include/network.php | |
parent | 4b348d248975ba07ba9cea62f51eb52d6afb5645 (diff) | |
parent | 247579ebf13ead372eee87bd2351078f7219321e (diff) | |
download | volse-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.php | 24 |
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; +} |