aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Bookmarkedchats.php
blob: 5d6d000c18e7772efed7c1b945a8b3ce5559d0b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

/**
 *   * Name: Bookmarked chats
 *   * Description: A menu with bookmarked chats
 */

namespace Zotlabs\Widget;

class Bookmarkedchats {

	function widget($arr) {
		$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
		));
	}
}