1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22: function b_legacy_siteinfo_show($options) {
23: global $xoopsConfig, $xoopsUser;
24: $xoopsDB =& Database::getInstance();
25: $myts =& MyTextSanitizer::getInstance();
26: $block = array();
27: if (!empty($options[3])) {
28: $block['showgroups'] = true;
29: $result = $xoopsDB->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM ".$xoopsDB->prefix("groups_users_link")." l LEFT JOIN ".$xoopsDB->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$xoopsDB->prefix("groups")." g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
30: if ($xoopsDB->getRowsNum($result) > 0) {
31: $prev_caption = "";
32: $i = 0;
33: while ($userinfo = $xoopsDB->fetchArray($result)) {
34: if ($prev_caption != $userinfo['groupname']) {
35: $prev_caption = $userinfo['groupname'];
36: $block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
37: }
38: if (is_object($xoopsUser)) {
39: $block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => "<a href=\"".XOOPS_URL."/modules/message/index.php?action=new&to_userid=".$userinfo['uid']."\"><img src=\"".XOOPS_URL."/images/icons/pm_small.gif\" border=\"0\" alt=\"\" /></a>", 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
40: } else {
41: if ($userinfo['user_viewemail']) {
42: $block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '<a href="mailto:'.$userinfo['email'].'"><img src="'.XOOPS_URL.'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a>', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
43: } else {
44: $block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => ' ', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
45: }
46: }
47: $i++;
48: }
49: }
50: } else {
51: $block['showgroups'] = false;
52: }
53: $block['logourl'] = XOOPS_URL.'/images/'.$options[2];
54: if (is_object($xoopsUser)) {
55: $block['recoomendtime'] = time();
56: } else {
57: $block['recoomendtime'] = 0;
58: }
59: $block['popup_width'] = $options[0];
60: $block['popup_height'] = $options[1];
61: return $block;
62: }
63:
64: function b_legacy_siteinfo_edit($options) {
65: $form = _MB_LEGACY_PWWIDTH." ";
66: $form .= "<input type='text' name='options[]' value='".$options[0]."' />";
67: $form .= "<br />"._MB_LEGACY_PWHEIGHT." ";
68: $form .= "<input type='text' name='options[]' value='".$options[1]."' />";
69: $form .= "<br />".sprintf(_MB_LEGACY_LOGO,XOOPS_URL."/images/")." ";
70: $form .= "<input type='text' name='options[]' value='".$options[2]."' />";
71: $chk = "";
72: $form .= "<br />"._MB_LEGACY_SADMIN." ";
73: if ( $options[3] == 1 ) {
74: $chk = " checked='checked'";
75: }
76: $form .= "<input type='radio' name='options[3]' value='1'".$chk." /> "._YES."";
77: $chk = "";
78: if ( $options[3] == 0 ) {
79: $chk = " checked=\"checked\"";
80: }
81: $form .= " <input type='radio' name='options[3]' value='0'".$chk." />"._NO."";
82: return $form;
83: }
84: ?>
85: