forked from lonalore/fb_chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfb_chat_menu.php
More file actions
62 lines (46 loc) · 1.42 KB
/
fb_chat_menu.php
File metadata and controls
62 lines (46 loc) · 1.42 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
if (!defined('e107_INIT')) {
exit;
}
if (!plugInstalled('fb_chat')) {
exit;
}
require_once("classes/fb_chat_main.class.php");
// [PLUGINS]/fb_chat/languages/[LANGUAGE]/[LANGUAGE]_front.php
e107::lan('fb_chat', false, true);
class fb_chat_menu extends fb_chat_main {
private $onlineList = array();
protected $plugPrefs = array();
/**
* List online users after check current user permission.
*
* @return
*/
function __construct() {
$this->plugPrefs = e107::getPlugConfig('fb_chat')->getPref();
if (!$this->check_permission()) {
return;
}
$this->onlineList = $this->get_online_users();
$this->list_online_users();
}
/**
* Render output HTML.
*/
function list_online_users() {
$template = e107::getTemplate('fb_chat');
$sc = e107::getScBatch('fb_chat', TRUE);
$tp = e107::getParser();
$text = $tp->parseTemplate($template['MENU_START']);
foreach ($this->onlineList as $val) {
$sc->setVars($val);
$text .= $tp->parseTemplate($template['MENU_ITEM'], TRUE, $sc);
}
$text .= $tp->parseTemplate($template['MENU_END']);
$text = '<div class="fbcmw">' . $text . '</div>';
e107::getRender()->tablerender(LANF_FB_CHAT_01, $text);
unset($text);
}
}
new fb_chat_menu();
?>