streams/mod/follow.php
2013-05-19 20:38:53 -07:00

35 lines
No EOL
574 B
PHP

<?php
require_once('include/follow.php');
function follow_init(&$a) {
if(! local_user()) {
return;
}
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
$result = new_contact($uid,$url,$a->get_channel(),true);
if($result['success'] == false) {
if($result['message'])
notice($result['message']);
goaway($return_url);
}
info( t('Channel added.') . EOL);
goaway(z_root() . '/connections/' . $result['abook']['abook_id']);
}
function follow_content(&$a) {
if(! local_user()) {
return login();
}
}