-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMemberlist.template.php
185 lines (159 loc) · 5.01 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
/**
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
* @license BSD http://opensource.org/licenses/BSD-3-Clause
*
* This software is a derived product, based on:
*
* Simple Machines Forum (SMF)
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.0.5
*
*/
/**
* Memberlist search form
*/
function template_mlsearch_above()
{
global $context, $scripturl, $txt;
$extra = '
<form id="mlsearch" action="' . $scripturl . '?action=memberlist;sa=search" method="post" accept-charset="UTF-8">
<ul class="floatright">
<li>
<input id="mlsearch_input" onfocus="toggle_mlsearch_opt();" type="text" name="search" value="' . $context['old_search_value'] . '" class="input_text" placeholder="' . $txt['search'] . '" />
<input type="submit" name="search2" value="' . $txt['search'] . '" class="button_submit" />
<ul id="mlsearch_options" class="nojs">';
foreach ($context['search_fields'] as $id => $title)
{
$extra .= '
<li class="mlsearch_option">
<label for="fields-' . $id . '">
<input type="checkbox" name="fields[]" id="fields-' . $id . '" value="' . $id . '" ' . (in_array($id, $context['search_defaults']) ? 'checked="checked"' : '') . ' class="input_check" />' . $title . '
</label>
</li>';
}
$extra .= '
</ul>
</li>
</ul>
</form>';
template_pagesection('memberlist_buttons', 'right', array('extra' => $extra));
echo '
<script><!-- // --><![CDATA[
// Removes the nojs class to properly style the dropdown according to js availability
$(\'#mlsearch_options\').removeClass(\'nojs\');
// ]]></script>';
}
/**
* Displays a sortable listing of all members registered on the forum.
*/
function template_memberlist()
{
global $context, $settings, $scripturl, $txt;
echo '
<div id="memberlist">
<h2 class="category_header">
<span class="floatleft">', $txt['members_list'], '</span>';
if (empty($context['in_search']))
echo '
<span class="floatright letter_links">', $context['letter_links'], '</span>';
echo '
</h2>
<div class="mlist_container">
<ul class="mlist">
<li class="mlist_header">';
$table_span = 0;
// Display each of the column headers of the table.
foreach ($context['columns'] as $key => $column)
{
$table_span += isset($column['colspan']) ? $column['colspan'] : 1;
// This is a selected column, so underline it or some such.
if ($column['selected'])
echo '
<div class="' . $column['class'] . '">
<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />
</div>';
// This is just some column... show the link and be done with it.
else
echo '
<div class="' . $column['class'] . '">
', $column['link'], '
</div>';
}
echo '
</li>';
// Assuming there are members loop through each one displaying their data.
$alternate = true;
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
{
if (!empty($member['sort_letter']))
{
echo '
<li class="letter_row" id="letter', $member['sort_letter'], '">
<h3>', $member['sort_letter'], '</h3>
</li>';
}
echo '
<li class="', $alternate ? 'alternate_' : 'standard_', 'row">';
foreach ($context['columns'] as $column => $values)
{
if (isset($member[$column]))
{
echo '
<div class="' . $values['class'] . '">';
if ($column == 'online')
{
echo '
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '';
}
elseif ($column == 'email_address')
{
echo '
', $member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/profile/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>';
}
else
echo '
', $member[$column];
echo '
</div>';
}
// Any custom fields on display?
elseif (!empty($context['custom_profile_fields']['columns']) && isset($context['custom_profile_fields']['columns'][$column]))
{
echo '
<div class="' . $values['class'] . '">', $member['options'][substr($column, 5)], '</div>';
}
}
echo '
</li>';
$alternate = !$alternate;
}
echo '
</ul>
</div>';
}
// No members?
else
echo '
</ul>
</div>
<div class="infobox">
', $txt['search_no_results'], '
</div>';
}
/**
* Shows the pagination
*/
function template_mlsearch_below()
{
global $context, $scripturl, $txt;
// Show the page numbers again. (makes 'em easier to find!)
template_pagesection(false, false);
echo '
</div>';
}