-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMemberlist.template.php
144 lines (131 loc) · 4.54 KB
/
Memberlist.template.php
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Displays a sortable listing of all members registered on the forum.
*/
function template_main()
{
global $context, $settings, $scripturl, $txt;
echo '
<div class="main_section" id="memberlist">
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
', template_button_strip($context['memberlist_buttons'], 'right'), '
</div>
<div class="cat_bar">
<h3 class="catbg">
', $txt['members_list'], '
</h3>
</div>';
echo '
<div id="mlist">';
// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
{
echo '
<div class="block-member windowbg">
', !empty($settings['st_enable_avatars_mlist']) && !empty($member['avatar']) ? themecustoms_avatar($member['avatar']['href'], $member['id']) : '', '
<h4>
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span>' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
', $member['link'], '
</h4>
<span class="group">
', empty($member['group']) ? $member['post_group'] : $member['group'], '
</span>
<span class="registered">
', $txt['date_registered'], ': ', $member['registered_date'], '
</span>
', !isset($context['disabled_fields']['posts']) ? '
<span class="posts">'. $txt['posts'] . ': ' . $member['posts'] . '</span>' : '', '
', (!isset($context['disabled_fields']['website']) && !empty($member['website']['url'])) ? '
<span class="website">
<a href="' . $member['website']['url'] . '" target="_blank" rel="noopener">
<span class="main_icons www"></span> ' . $member['website']['title'] . '
</a>
</span>' : '';
// Show custom fields marked to be shown here
if (!empty($context['custom_profile_fields']['columns']))
foreach ($context['custom_profile_fields']['columns'] as $key => $column)
echo '
<span class="', $key, '">', $member['options'][$key], '</span>';
echo '
</div>';
}
}
// No members?
else
echo '
<div class="roundframe noup">
', $txt['search_no_results'], '
</div>';
echo '
</div>
<div class="pagesection">
<div class="pagelinks floatleft">', $context['page_index'], '</div>';
// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<div class="buttonlist">
<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>
</div>';
echo '
</div>
</div><!-- #memberlist -->';
}
/**
* A page allowing people to search the member list.
*/
function template_search()
{
global $context, $scripturl, $txt;
// Start the submission form for the search!
echo '
<form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '">
<div id="memberlist">
<div class="pagesection">
', template_button_strip($context['memberlist_buttons'], 'right'), '
</div>
<div class="cat_bar">
<h3 class="catbg mlist">
<span class="main_icons filter"></span>', $txt['mlist_search'], '
</h3>
</div>
<div id="advanced_search" class="roundframe">
<dl id="mlist_search" class="settings">
<dt>
<label><strong>', $txt['search_for'], ':</strong></label>
</dt>
<dd>
<input type="text" name="search" value="', $context['old_search'], '" size="40">
</dd>
<dt>
<label><strong>', $txt['mlist_search_filter'], ':</strong></label>
</dt>
<dd>
<ul>';
foreach ($context['search_fields'] as $id => $title)
echo '
<li>
<input type="checkbox" name="fields[]" id="fields-', $id, '" value="', $id, '"', in_array($id, $context['search_defaults']) ? ' checked' : '', '>
<label for="fields-', $id, '">', $title, '</label>
</li>';
echo '
</ul>
</dd>
</dl>
<input type="submit" name="submit" value="' . $txt['search'] . '" class="button floatright">
</div><!-- #advanced_search -->
</div><!-- #memberlist -->
</form>';
}