streams/Zotlabs/Widget/Bookmarkedchats.php

36 lines
784 B
PHP
Raw Normal View History

<?php
namespace Zotlabs\Widget;
2021-12-02 22:33:36 +00:00
use App;
2021-12-02 23:02:31 +00:00
class Bookmarkedchats
{
2021-12-02 23:02:31 +00:00
public function widget($arr)
{
2021-12-03 03:01:39 +00:00
if (!feature_enabled(App::$profile['profile_uid'], 'ajaxchat')) {
2021-12-02 23:02:31 +00:00
return '';
2021-12-03 03:01:39 +00:00
}
2021-12-02 23:02:31 +00:00
$h = get_observer_hash();
2021-12-03 03:01:39 +00:00
if (!$h) {
2021-12-02 23:02:31 +00:00
return;
2021-12-03 03:01:39 +00:00
}
$r = q(
"select xchat_url, xchat_desc from xchat where xchat_xchan = '%s' order by xchat_desc",
2021-12-02 23:02:31 +00:00
dbesc($h)
);
if ($r) {
for ($x = 0; $x < count($r); $x++) {
$r[$x]['xchat_url'] = zid($r[$x]['xchat_url']);
}
}
return replace_macros(get_markup_template('bookmarkedchats.tpl'), array(
'$header' => t('Bookmarked Chatrooms'),
'$rooms' => $r
));
}
}