XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
legacy_siteinfo.php
1<?php
14
19function b_legacy_siteinfo_show($options)
20{
21 global $xoopsConfig, $xoopsUser;
22 $xoopsDB =& Database::getInstance();
24 $block = [];
25 if (!empty($options[3])) {
26 $block['showgroups'] = true;
27 $result = $xoopsDB->query(
28 'SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM '
29 . $xoopsDB->prefix('groups_users_link') . ' l LEFT JOIN '
30 . $xoopsDB->prefix('users') . ' u ON l.uid=u.uid LEFT JOIN '
31 . $xoopsDB->prefix('groups') . " g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
32 if ($xoopsDB->getRowsNum($result) > 0) {
33 $prev_caption = '';
34 $i = 0;
35 while ($userinfo = $xoopsDB->fetchArray($result)) {
36 if ($prev_caption != $userinfo['groupname']) {
37 $prev_caption = $userinfo['groupname'];
38 $block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
39 }
40 if (is_object($xoopsUser)) {
41 $block['groups'][$i]['users'][] = [
42 'id' => $userinfo['uid'],
43 'name' => $myts->htmlspecialchars($userinfo['uname']),
44 'msglink' => '<a href="'
45 . XOOPS_URL . '/modules/message/index.php?action=new&to_userid='
46 . $userinfo['uid'] . '"><img class="svg email" src="'
47 . XOOPS_URL . '/images/icons/mail.svg" width="1em" height="1em" alt="message"></a>',
48 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']];
49 } else {
50 if ($userinfo['user_viewemail']) {
51 $block['groups'][$i]['users'][] = [
52 'id' => $userinfo['uid'],
53 'name' => $myts->htmlspecialchars($userinfo['uname']),
54 'msglink' => '<a href="mailto:'
55 . $userinfo['email'] . '"><img class="svg mail" src="'
56 . XOOPS_URL . '/images/icons/mail.svg" width="1em" height="1em" alt="send email"></a>',
57 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']];
58 } else {
59 $block['groups'][$i]['users'][] = [
60 'id' => $userinfo['uid'],
61 'name' => $myts->htmlspecialchars($userinfo['uname']),
62 'msglink' => '&nbsp;', 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']
63 ];
64 }
65 }
66 $i++;
67 }
68 }
69 } else {
70 $block['showgroups'] = false;
71 }
72 $block['logourl'] = XOOPS_URL.'/images/'.$options[2];
73 if (is_object($xoopsUser)) {
74 $block['recoomendtime'] = time();
75 } else {
76 $block['recoomendtime'] = 0;
77 }
78 $block['popup_width'] = $options[0];
79 $block['popup_height'] = $options[1];
80 return $block;
81}
82
83function b_legacy_siteinfo_edit($options)
84{
85 $form = _MB_LEGACY_PWWIDTH . '&nbsp;';
86 $form .= "<input type='text' name='options[]' value='".$options[0]."'>";
87 $form .= '<br>' . _MB_LEGACY_PWHEIGHT . '&nbsp;';
88 $form .= "<input type='text' name='options[]' value='".$options[1]."'>";
89 $form .= '<br>' . sprintf(_MB_LEGACY_LOGO, XOOPS_URL . '/images/') . '&nbsp;';
90 $form .= "<input type='text' name='options[]' value='".$options[2]."'>";
91 $chk = '';
92 $form .= '<br>' . _MB_LEGACY_SADMIN . '&nbsp;';
93 if (1 == $options[3]) {
94 $chk = " checked='checked'";
95 }
96 $form .= "<input type='radio' name='options[3]' value='1'".$chk . '>&nbsp;' . _YES . '';
97 $chk = '';
98 if (0 == $options[3]) {
99 $chk = ' checked="checked"';
100 }
101 $form .= "&nbsp;<input type='radio' name='options[3]' value='0'".$chk . '>' . _NO . '';
102 return $form;
103}