streams/mod/follow.php

41 lines
884 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) {
2015-01-29 04:56:04 +00:00
if(! local_channel()) {
return;
}
2015-01-29 04:56:04 +00:00
$uid = local_channel();
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) || ($result['abook']['xchan_network'] === 'rss'))
proc_run('php','include/onepoll.php',$result['abook']['abook_id']);
2014-03-08 07:00:27 +00:00
goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1');
2011-12-18 20:41:46 +00:00
}
function follow_content(&$a) {
2015-01-29 04:56:04 +00:00
if(! local_channel()) {
return login();
}
}