streams/Zotlabs/Widget/Pubtagcloud.php

38 lines
886 B
PHP
Raw Normal View History

2018-04-18 03:08:14 +00:00
<?php
namespace Zotlabs\Widget;
2021-12-02 23:02:31 +00:00
class Pubtagcloud
{
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
public function widget($arr)
{
2018-04-18 03:08:14 +00:00
2021-12-02 23:02:31 +00:00
$trending = ((array_key_exists('trending', $arr)) ? intval($arr['trending']) : 0);
if ((observer_prohibited(true))) {
2018-04-18 03:08:14 +00:00
return EMPTY_STR;
}
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
2021-12-02 23:02:31 +00:00
$limit = ((array_key_exists('limit', $arr)) ? intval($arr['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
return '';
}
2018-04-18 03:08:14 +00:00
}