streams/Code/Widget/Pubtagcloud.php

34 lines
852 B
PHP
Raw Normal View History

2018-04-18 03:08:14 +00:00
<?php
2022-02-16 04:08:28 +00:00
namespace Code\Widget;
2018-04-18 03:08:14 +00:00
2022-10-23 21:18:44 +00:00
class Pubtagcloud implements WidgetInterface
2021-12-02 23:02:31 +00:00
{
2018-04-18 03:08:14 +00:00
2022-10-24 03:39:49 +00:00
public function widget(array $arguments): string
2021-12-02 23:02:31 +00:00
{
2018-04-18 03:08:14 +00:00
2022-10-24 03:39:49 +00:00
$trending = ((array_key_exists('trending', $arguments)) ? intval($arguments['trending']) : 0);
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
if (!intval(get_config('system', 'open_pubstream', 0))) {
if (!local_channel()) {
2018-04-18 03:08:14 +00:00
return EMPTY_STR;
}
}
2021-12-02 23:02:31 +00:00
$public_stream_mode = intval(get_config('system', 'public_stream_mode', PUBLIC_STREAM_NONE));
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
if (!$public_stream_mode) {
2018-04-18 03:08:14 +00:00
return EMPTY_STR;
}
2021-12-02 23:02:31 +00:00
$safemode = get_xconfig(get_observer_hash(), 'directory', 'safemode', 1);
2018-04-18 03:08:14 +00:00
2022-10-24 03:39:49 +00:00
$limit = ((array_key_exists('limit', $arguments)) ? intval($arguments['limit']) : 75);
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
return pubtagblock($public_stream_mode, $limit, $trending, $safemode);
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
}
2018-04-18 03:08:14 +00:00
}