From 925b046794b77345c1321a3c74e4561d5c10ec95 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 Aug 2013 22:10:08 -0700 Subject: 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. --- boot.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 3327fdbb2..c8a8fbc7e 100755 --- a/boot.php +++ b/boot.php @@ -1623,13 +1623,20 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { require_once('include/Contact.php'); + if($show_connect) { - $connect_url = (($show_connect) ? rconnect_url($profile['uid'],get_observer_hash()) : ''); - - $connect = (($connect_url) ? t('Connect') : ''); + // This will return an empty string if we're already connected. + + $connect_url = rconnect_url($profile['uid'],get_observer_hash()); + $connect = (($connect_url) ? t('Connect') : ''); + if($connect_url) + $connect_url = sprintf($connect_url,urlencode($profile['channel_address'] . '@' . $a->get_hostname())); - if($connect_url) - $connect_url = $connect_url . '/follow?f=1&url=' . urlencode($profile['channel_address'] . '@' . $a->get_hostname()); + // premium channel - over-ride + + if($profile['channel_pageflags'] & PAGE_PREMIUM) + $connect_url = z_root() . '/connect/' . $profile['channel_address']; + } // show edit profile to yourself if($is_owner) { -- cgit v1.2.3