2019-04-30 23:52:07 +00:00
< ? php
namespace Zotlabs\Module ;
use Zotlabs\Lib\Libsync ;
use Zotlabs\Lib\Apps ;
2019-08-14 02:42:32 +00:00
use Zotlabs\Web\Controller ;
2019-04-30 23:52:07 +00:00
require_once ( 'include/socgraph.php' );
2019-08-14 02:42:32 +00:00
class Suggestions extends Controller {
2019-04-30 23:52:07 +00:00
function init () {
if ( ! local_channel ())
return ;
if ( x ( $_GET , 'ignore' )) {
q ( " insert into xign ( uid, xchan ) values ( %d, '%s' ) " ,
intval ( local_channel ()),
dbesc ( $_GET [ 'ignore' ])
);
Libsync :: build_sync_packet ( local_channel (), [ 'xign' => [ [ 'uid' => local_channel (), 'xchan' => $_GET [ 'ignore' ] ]]] );
}
}
function get () {
$o = '' ;
if ( ! local_channel ()) {
notice ( t ( 'Permission denied.' ) . EOL );
return ;
}
if ( Apps :: system_app_installed ( local_channel (), 'Suggest Channels' )) {
goaway ( z_root () . '/directory?f=&suggest=1' );
}
$desc = t ( 'This app (when installed) displays a small number of friend suggestions on selected pages or you can run the app to display a full list of channel suggestions.' );
return '<div class="section-content-info-wrapper">' . $desc . '</div>' ;
}
}