2017-03-17 00:11:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zotlabs\Widget;
|
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
use App;
|
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class Bookmarkedchats
|
|
|
|
{
|
2017-03-17 00:11:48 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
public function widget($arr)
|
|
|
|
{
|
2017-03-17 00:11:48 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
if (!feature_enabled(App::$profile['profile_uid'], 'ajaxchat'))
|
|
|
|
return '';
|
2017-03-17 00:11:48 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
$h = get_observer_hash();
|
|
|
|
if (!$h)
|
|
|
|
return;
|
|
|
|
$r = q("select xchat_url, xchat_desc from xchat where xchat_xchan = '%s' order by xchat_desc",
|
|
|
|
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
|
|
|
|
));
|
|
|
|
}
|
2017-03-17 00:11:48 +00:00
|
|
|
}
|