premium/restricted channel connections implemented, configure at yoursite/channel/nickname - this basically redirects "follow" requests to a premium channel's sell page if it has one configured. You can still click through and create a connection request (introduction), but this provides a means for the channel owner to state their terms. If you don't abide by the terms, you will likely be blocked or the channel deleted. This facility is extensible in a number of ways.

This commit is contained in:
friendica
2013-08-21 22:10:08 -07:00
parent 6cea04eb44
commit 925b046794
8 changed files with 82 additions and 15 deletions

View File

@@ -15,13 +15,20 @@ function rconnect_url($channel_id,$xchan) {
if($r)
return '';
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($xchan)
);
if(($r) && ($r[0]['xchan_follow']))
return $r[0]['xchan_follow'];
$r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and ( hubloc_flags & %d ) limit 1",
dbesc($xchan),
intval(HUBLOC_FLAGS_PRIMARY)
);
if($r)
return $r[0]['hubloc_url'];
return $r[0]['hubloc_url'] . '/follow?f=&url=%s';
return '';
}