1
|
|
|
<?php |
2
|
|
|
// Author: Lio MJ |
3
|
|
|
// Website: https://www.github.com/liomj/ |
4
|
|
|
|
5
|
|
|
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; |
6
|
|
|
|
7
|
|
|
function show_memberswelcome_block($options) { |
8
|
|
|
global $xoopsConfig, $xoopsUser, $xoopsModule, $xoopsDB, $_SERVER; |
9
|
|
|
|
10
|
|
|
if (is_object($xoopsUser)) { |
11
|
|
|
$block['uid']=$xoopsUser->getVar('uid'); |
|
|
|
|
12
|
|
|
$realname=$xoopsUser->getVar('name'); |
13
|
|
|
|
14
|
|
|
if ($options[1]=='1' && $realname!='') |
15
|
|
|
{ |
16
|
|
|
$block['membername']=$xoopsUser->getVar('name'); |
17
|
|
|
} |
18
|
|
|
else |
19
|
|
|
{ |
20
|
|
|
$block['membername']=$xoopsUser->getVar('uname'); |
21
|
|
|
} |
22
|
|
|
$block['user_avatar']=$xoopsUser->getVar('user_avatar'); |
23
|
|
|
|
24
|
|
|
$ranking=$xoopsUser->rank(); |
25
|
|
|
$block['rankimage']=$ranking['image']; |
26
|
|
|
$block['ranktitle']=$ranking['title']; |
27
|
|
|
$block['showrank'] = $options[0]; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
return $block; |
|
|
|
|
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
function memberswelcome_edit($options) { |
35
|
|
|
|
36
|
|
|
$form = _MB_XOOPSMEMBERS_SHOWMEMBERSRANK." "; |
37
|
|
|
if ( $options[0] == 1 ) { |
38
|
|
|
$chk = " checked='checked'"; |
39
|
|
|
} |
40
|
|
|
$form .= "<input type='radio' name='options[0]' value='1'".$chk." /> "._YES.""; |
|
|
|
|
41
|
|
|
$chk = ""; |
42
|
|
|
if ( $options[0] == 0 ) { |
43
|
|
|
$chk = " checked='checked'"; |
44
|
|
|
} |
45
|
|
|
$form .= " <input type='radio' name='options[0]' value='0'".$chk." />"._NO."<br />"; |
46
|
|
|
|
47
|
|
|
$form .= _MB_XOOPSMEMBERS_USEREALNAME." "; |
48
|
|
|
if ( $options[1] == 1 ) { |
49
|
|
|
$chk = " checked='checked'"; |
50
|
|
|
} |
51
|
|
|
$form .= "<input type='radio' name='options[1]' value='1'".$chk." /> "._YES.""; |
52
|
|
|
$chk = ""; |
53
|
|
|
if ( $options[1] == 0 ) { |
54
|
|
|
$chk = " checked='checked'"; |
55
|
|
|
} |
56
|
|
|
$form .= " <input type='radio' name='options[1]' value='0'".$chk." />"._NO."<br />"; |
57
|
|
|
|
58
|
|
|
return $form; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
?> |
|
|
|
|
62
|
|
|
|