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:
@@ -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 '';
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user