streams/mod/follow.php

42 lines
808 B
PHP
Raw Normal View History

<?php
2012-06-03 06:12:20 +00:00
require_once('include/follow.php');
2011-12-18 20:41:46 +00:00
function follow_init(&$a) {
if(! local_user()) {
return;
}
$uid = local_user();
2012-06-03 06:17:49 +00:00
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
$confirm = intval($_REQUEST['confirm']);
$result = new_contact($uid,$url,$a->get_channel(),true,$confirm);
2012-06-03 06:12:20 +00:00
if($result['success'] == false) {
if($result['message'])
notice($result['message']);
goaway($return_url);
}
2013-05-20 03:38:53 +00:00
info( t('Channel added.') . EOL);
2012-06-03 06:17:49 +00:00
// If we can view their stream, pull in some posts
if($result['abook']['abook_their_perms'] & PERMS_R_STREAM)
proc_run('php','include/onepoll.php',$result['abook']['abook_id']);
goaway(z_root() . '/connedit/' . $result['abook']['abook_id']);
2011-12-18 20:41:46 +00:00
}
function follow_content(&$a) {
if(! local_user()) {
return login();
}
}