mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 00:15:57 +00:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Code\Module;
|
|
|
|
use Code\Lib\Libsync;
|
|
use Code\Lib\Apps;
|
|
use Code\Web\Controller;
|
|
|
|
|
|
class Suggestions extends Controller
|
|
{
|
|
|
|
public 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']]]]);
|
|
}
|
|
}
|
|
|
|
|
|
public 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>';
|
|
}
|
|
}
|