Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 925 lines (819 sloc) 34.437 kB
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
1 <?php
2 /**
3 *
4 * @package Icy Phoenix
5 * @version $Id$
6 * @copyright (c) 2008 Icy Phoenix
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 *
9 */
10
11 /**
12 *
13 * @Icy Phoenix is based on phpBB
14 * @copyright (c) 2008 phpBB Group
15 *
16 */
17
18 // MG Cash MOD For IP - BEGIN
19 define('IN_CASHMOD', true);
20 define('CM_MEMBERLIST', true);
21 // MG Cash MOD For IP - END
b7a59d9 @MightyGorgon New poll system and minor bug fixes.
authored
22 define('IN_ICYPHOENIX', true);
06ce0f8 @MightyGorgon Brand new version...
authored
23 if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
24 if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
25 include(IP_ROOT_PATH . 'common.' . PHP_EXT);
2c2bc4a @MightyGorgon Many updates to the core code.
authored
26 include_once(IP_ROOT_PATH . 'includes/functions_users.' . PHP_EXT);
06ce0f8 @MightyGorgon Brand new version...
authored
27 include_once(IP_ROOT_PATH . 'includes/functions_groups.' . PHP_EXT);
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
28 include(IP_ROOT_PATH . 'includes/class_form.' . PHP_EXT);
29 $class_form = new class_form();
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
30
31 // Start session management
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
32 $user->session_begin();
d164727 @MightyGorgon First implementation of the new permissions system in CMS.
authored
33 $auth->acl($user->data);
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
34 $user->setup();
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
35 // End session management
36
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
37 $cms_page['page_id'] = 'memberlist';
38 $cms_page['page_nav'] = (!empty($cms_config_layouts[$cms_page['page_id']]['page_nav']) ? true : false);
39 $cms_page['global_blocks'] = (!empty($cms_config_layouts[$cms_page['page_id']]['global_blocks']) ? true : false);
40 $cms_auth_level = (isset($cms_config_layouts[$cms_page['page_id']]['view']) ? $cms_config_layouts[$cms_page['page_id']]['view'] : AUTH_ALL);
41 check_page_auth($cms_page['page_id'], $cms_auth_level);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
42
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
43 $mode = request_var('mode', '');
44 $action = request_var('action', '');
45 $sort_order = request_var('order', '');
46 $sort_key = request_var('sk', '');
47 $sort_dir = request_var('sd', '');
48 $user_id = request_var(POST_USERS_URL, ANONYMOUS);
49 $username = request_var('un', '', true);
50 $group_id = request_var(POST_GROUPS_URL, 0);
51 $topic_id = request_var(POST_TOPIC_URL, 0);
52
53 $alphanum = request_var('alphanum', '');
54 if (!empty($alphanum))
55 {
56 $alphanum = ($alphanum == '#') ? '#' : (phpbb_clean_username(ip_clean_username(urldecode($alphanum))));
57 $alpha_where = ($alphanum == '#') ? "AND username NOT RLIKE '^[A-Z]'" : "AND username LIKE '" . $db->sql_escape($alphanum) . "%'";
58 }
59
a4ea299 @MightyGorgon First commit with UTF-8 modifications, almost all files have been edi…
authored
60 $start = request_var('start', 0);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
61 $start = ($start < 0) ? 0 : $start;
62
a4ea299 @MightyGorgon First commit with UTF-8 modifications, almost all files have been edi…
authored
63 $page_number = request_var('page_number', 0);
64 $page_number = ($page_number < 1) ? 0 : $page_number;
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
65
a4ea299 @MightyGorgon First commit with UTF-8 modifications, almost all files have been edi…
authored
66 $start = (empty($page_number) ? $start : (($page_number * $config['topics_per_page']) - $config['topics_per_page']));
67
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
68 $users_per_page = request_var('users_per_page', $config['topics_per_page']);
69 $users_per_page = ((!$users_per_page || ($users_per_page < 0) || ($users_per_page > 200)) ? $config['topics_per_page'] : $users_per_page);
a4ea299 @MightyGorgon First commit with UTF-8 modifications, almost all files have been edi…
authored
70
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
71 // SORT - BEGIN
72 $sort_array = array(
73 'a' => array('lang' => $lang['SORT_USERNAME'], 'mode' => 'username', 'sql' => 'u.username'),
74 'b' => array('lang' => $lang['SORT_LOCATION'], 'mode' => 'location', 'sql' => 'u.user_from'),
75 'c' => array('lang' => $lang['SORT_JOINED'], 'mode' => 'joined', 'sql' => 'u.user_regdate'),
76 'd' => array('lang' => $lang['SORT_POSTS'], 'mode' => 'posts', 'sql' => 'u.user_posts'),
77 'f' => array('lang' => $lang['SORT_WEBSITE'], 'mode' => 'website', 'sql' => 'u.user_website'),
78 'g' => array('lang' => $lang['ICQ'], 'mode' => 'icq', 'sql' => 'u.user_icq'),
79 'h' => array('lang' => $lang['AIM'], 'mode' => 'aim', 'sql' => 'u.user_aim'),
80 'i' => array('lang' => $lang['MSNM'], 'mode' => 'msn', 'sql' => 'u.user_msnm'),
81 'j' => array('lang' => $lang['YIM'], 'mode' => 'yahoo', 'sql' => 'u.user_yim'),
82 'k' => array('lang' => $lang['JABBER'], 'mode' => 'jabber', 'sql' => 'u.user_jabber'),
83 'm' => array('lang' => $lang['SORT_RANK'], 'mode' => 'rank', 'sql' => 'u.user_rank'),
84 'n' => array('lang' => $lang['SORT_FAST'], 'mode' => 'fast', 'sql' => 'u.username'),
85 'o' => array('lang' => $lang['SORT_STANDARD'], 'mode' => 'standard', 'sql' => 'u.username'),
86 's' => array('lang' => $lang['SORT_STAFF'], 'mode' => 'staff', 'sql' => 'u.user_level'),
87 't' => array('lang' => $lang['SORT_TOP_TEN'], 'mode' => 'topten', 'sql' => 'u.user_posts'),
88 'u' => array('lang' => $lang['SORT_BIRTHDAY'], 'mode' => 'birthday', 'sql' => 'u.user_birthday'),
89 'v' => array('lang' => $lang['SORT_STYLE'], 'mode' => 'style', 'sql' => 'u.user_style'),
90 'w' => array('lang' => $lang['SORT_ONLINE'], 'mode' => 'online', 'sql' => 'u.user_session_time'),
91 );
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
92
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
93 if ($user->data['user_level'] == ADMIN)
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
94 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
95 $sort_array['e'] = array('lang' => $lang['SORT_EMAIL'], 'mode' => 'email', 'sql' => 'u.user_email');
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
96 }
97
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
98 if (!empty($user->data['session_logged_in']))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
99 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
100 $sort_array['l'] = array('lang' => $lang['SORT_LASTLOGON'], 'mode' => 'lastlogon', 'sql' => 'u.user_session_time');
5c8be12 @MightyGorgon Fixed some bugs hunted by Andrea75
authored
101 //$sort_array['l'] = array('lang' => $lang['SORT_LASTLOGON'], 'mode' => 'lastlogon', 'sql' => 'u.user_lastvisit');
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
102 }
103
104 // MG Cash MOD For IP - BEGIN
2405be5 @MightyGorgon Recoded some parts of the new Plugins section
authored
105 if (!empty($config['plugins']['cash']['enabled']))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
106 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
107 $cm_memberlist->droplists($sort_array);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
108 }
109 // MG Cash MOD For IP - END
110
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
111 $mode_types_key = array();
112 $mode_types = array();
113 $mode_types_text = array();
114 $mode_types_sql = array();
115 $sort_key_text = array();
116 $sort_key_sql = array();
117 foreach ($sort_array as $k => $v)
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
118 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
119 $mode_types_key[$v['mode']] = $k;
120 $mode_types[] = $v['mode'];
121 $mode_types_text[] = $v['lang'];
122 $mode_types_sql[] = $v['sql'];
123 $sort_key_text[] = $v['lang'];
124 $sort_key_sql[] = $v['sql'];
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
125 }
126
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
127 $mode = (empty($mode) && !empty($sort_array[$sort_key]['mode'])) ? $sort_array[$sort_key]['mode'] : $mode;
128 if ((empty($mode) || !in_array($mode, $mode_types)) && (strpos($mode, 'cash_') === false))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
129 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
130 $mode = 'joined';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
131 }
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
132 $sort_key = $mode_types_key[$mode];
133 $sort_dir_types = array('a' => 'ASC', 'd' => 'DESC');
134 $sort_order_types = array('ASC' => 'a', 'DESC' => 'd');
135 $sort_order = (empty($sort_order) && !empty($sort_dir_types[$sort_dir])) ? $sort_dir_types[$sort_dir] : $sort_order;
136 $sort_order = check_var_value($sort_order, array('ASC', 'DESC'));
137 $sort_dir = $sort_order_types[$sort_order];
138
139 $select_sort_mode = $class_form->build_select_box('mode', $mode, $mode_types, $mode_types_text, '');
140 $select_sort_order = $class_form->build_select_box('order', $sort_order, array('ASC', 'DESC'), array($lang['ASCENDING'], $lang['DESCENDING']), '');
141 // SORT - END
142
143 // Additional sorting options for user search ... if search is enabled, if not then only admins can make use of this (for ACP functionality)
144 $sql_select = '';
145 $sql_where_data = '';
146 $sql_where = '';
147 $order_by = '';
148
149 $form = request_var('form', '');
150 $field = request_var('field', '');
151 $select_single = request_var('select_single', false);
152
153 // Search URL parameters, if any of these are in the URL we do a search
154 $search_params = array('username', 'email', 'icq', 'aim', 'yahoo', 'msn', 'jabber', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');
155
156 // We validate form and field here, only id/class allowed
157 $form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
158 $field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
159 if ((($action == 'searchuser') || sizeof(array_intersect(array_keys($_GET), $search_params)) > 0) && ($user->data['user_level'] == ADMIN))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
160 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
161 $username = request_var('username', '', true);
162 $email = strtolower(request_var('email', ''));
163 $aim = request_var('aim', '');
164 $icq = request_var('icq', '');
165 $jabber = request_var('jabber', '');
166 $msn = request_var('msn', '');
167 $skype = request_var('skype', '');
168 $yahoo = request_var('yahoo', '');
169 $search_group_id = request_var('search_group_id', 0);
170
171 // when using these, make sure that we actually have values defined in $find_key_match
172 $joined_select = request_var('joined_select', 'lt');
173 $active_select = request_var('active_select', 'lt');
174 $count_select = request_var('count_select', 'eq');
175
176 $joined = explode('-', request_var('joined', ''));
177 $active = explode('-', request_var('active', ''));
178 $count = (request_var('count', '') !== '') ? request_var('count', 0) : '';
179 $ipdomain = request_var('ip', '');
180
181 $find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
182
183 $find_count = array('lt' => $lang['LESS_THAN'], 'eq' => $lang['EQUAL_TO'], 'gt' => $lang['MORE_THAN']);
184 $s_find_count = '';
185 foreach ($find_count as $key => $value)
186 {
187 $selected = ($count_select == $key) ? ' selected="selected"' : '';
188 $s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
189 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
190
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
191 $find_time = array('lt' => $lang['BEFORE'], 'gt' => $lang['AFTER']);
192 $s_find_join_time = '';
193 foreach ($find_time as $key => $value)
194 {
195 $selected = ($joined_select == $key) ? ' selected="selected"' : '';
196 $s_find_join_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
197 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
198
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
199 $s_find_active_time = '';
200 foreach ($find_time as $key => $value)
201 {
202 $selected = ($active_select == $key) ? ' selected="selected"' : '';
203 $s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
204 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
205
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
206 $sql_where .= ($username) ? ' AND LOWER(u.username) ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
207 $sql_where .= (($user->data['user_level'] == ADMIN) && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
208 $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : '';
209 $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', $db->any_char, $icq)) . ' ' : '';
210 $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
211 $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';
212 $sql_where .= ($skype) ? ' AND u.user_skype ' . $db->sql_like_expression(str_replace('*', $db->any_char, $skype)) . ' ' : '';
213 $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : '';
214 $sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
215 $sql_where .= (sizeof($joined) > 1 && isset($find_key_match[$joined_select])) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
5c8be12 @MightyGorgon Fixed some bugs hunted by Andrea75
authored
216 $sql_where .= (!empty($user->data['session_logged_in']) && sizeof($active) > 1 && isset($find_key_match[$active_select])) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
217 $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';
218
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
219 if ($ipdomain && ($user->data['user_level'] == ADMIN))
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
220 {
221 if (strspn($ipdomain, 'abcdefghijklmnopqrstuvwxyz'))
222 {
223 $hostnames = gethostbynamel($ipdomain);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
224
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
225 if ($hostnames !== false)
226 {
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
227 $ips = "'" . implode('\', \'', array_map(array($db, 'sql_escape'), preg_replace('#([0-9]{1,3}\.[0-9]{1,3}[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#', "\\1", gethostbynamel($ipdomain)))) . "'";
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
228 }
229 else
230 {
231 $ips = false;
232 }
233 }
234 else
235 {
236 $ips = "'" . str_replace('*', '%', $db->sql_escape($ipdomain)) . "'";
237 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
238
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
239 if ($ips === false)
240 {
241 // A minor fudge but it does the job :D
242 $sql_where .= " AND u.user_id = 0";
243 }
244 else
245 {
246 $sql = "SELECT DISTINCT poster_id
247 FROM " . POSTS_TABLE . "
248 WHERE poster_ip " . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips)";
249 $result = $db->sql_query($sql);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
250
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
251 if ($row = $db->sql_fetchrow($result))
252 {
fa5aa7d @MightyGorgon Some bugs fixes in CMS added a couple of new features for tags and im…
authored
253 $user_ip_sql = array();
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
254 do
255 {
fa5aa7d @MightyGorgon Some bugs fixes in CMS added a couple of new features for tags and im…
authored
256 $user_ip_sql[] = $row['poster_id'];
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
257 }
258 while ($row = $db->sql_fetchrow($result));
259
fa5aa7d @MightyGorgon Some bugs fixes in CMS added a couple of new features for tags and im…
authored
260 $sql_where .= " AND " . $db->sql_in_set('u.user_id', $user_ip_sql);
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
261 }
262 else
263 {
264 // A minor fudge but it does the job :D
265 $sql_where .= " AND u.user_id = 0";
266 }
267 $db->sql_freeresult($result);
268 }
269 }
270 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
271
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
272 $first_char = request_var('first_char', '');
273
274 if ($first_char == 'other')
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
275 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
276 for ($i = 97; $i < 123; $i++)
277 {
278 $sql_where .= ' AND u.username NOT ' . $db->sql_like_expression(chr($i) . $db->any_char);
279 }
280 }
281 elseif ($first_char)
282 {
283 $sql_where .= ' AND u.username ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->any_char);
284 }
285
286 // Sorting and order
287 $order_by .= $sort_array[$sort_key]['sql'] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
288 // Unfortunately we must do this here for sorting by rank, else the sort order is applied wrongly
289 if ($sort_key == 'm')
290 {
291 $order_by .= ', u.user_posts DESC';
292 }
293
294 if (($sort_key == 'a') || ($sort_key == 'n') || ($sort_key == 'o'))
295 {
296 $order_by = ' LOWER(u.username) ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
297 }
298
299 // Mighty Gorgon - Multiple Ranks - BEGIN
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
300 $ranks_array = $cache->obtain_ranks(false);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
301 // Mighty Gorgon - Multiple Ranks - END
302
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
303 $last_x_mins = time() - ONLINE_REFRESH;
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
304 $sql_style = false;
305
306 $cash_condition = false;
307 // MG Cash MOD For IP - BEGIN
2405be5 @MightyGorgon Recoded some parts of the new Plugins section
authored
308 if (!empty($config['plugins']['cash']['enabled']))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
309 {
310 switch($mode)
311 {
312 case $cm_memberlist->modecheck($mode):
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
313 $order_by = $cm_memberlist->getfield($mode) . " $sort_order";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
314 $cash_condition = true;
315 break;
316 }
317 }
318 // MG Cash MOD For IP - END
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
319
320 if (empty($cash_condition))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
321 {
322 switch($mode)
323 {
324 case 'topten':
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
325 $order_by = $sort_array[$sort_key]['sql'] . ' DESC';
326 $users_per_page = 10;
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
327 break;
328 case 'staff':
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
329 $sql_where = "AND u.user_level != 0";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
330 break;
331 case 'online':
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
332 if ($user->data['user_level'] == ADMIN)
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
333 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
334 $sql_where = "AND u.user_session_time >= $last_x_mins";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
335 }
336 else
337 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
338 $sql_where = "AND u.user_session_time >= $last_x_mins AND u.user_allow_viewonline <> 0";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
339 }
340 break;
341 case 'lastlogon':
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
342 if ($user->data['user_level'] != ADMIN)
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
343 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
344 $sql_where = "AND u.user_allow_viewonline <> 0";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
345 }
346 break;
347 }
348 }
349
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
350 $s_char_options = '<option value=""' . ((!$first_char) ? ' selected="selected"' : '') . '>&nbsp; &nbsp;</option>';
351 for ($i = 97; $i < 123; $i++)
352 {
353 $s_char_options .= '<option value="' . chr($i) . '"' . (($first_char == chr($i)) ? ' selected="selected"' : '') . '>' . chr($i - 32) . '</option>';
354 }
355 $s_char_options .= '<option value="other"' . (($first_char == 'other') ? ' selected="selected"' : '') . '>' . $lang['OTHER'] . '</option>';
356
357 // Build a relevant pagination_url
358 $params = array();
359 $sort_params = array();
360
361 // We do not use request_var() here directly to save some calls (not all variables are set)
362 $check_params = array(
363 'g' => array('g', 0),
364 'sk' => array('sk', $sort_key),
365 'sd' => array('sd', 'a'),
366 'form' => array('form', ''),
367 'field' => array('field', ''),
368 'select_single' => array('select_single', $select_single),
369 'username' => array('username', '', true),
370 'email' => array('email', ''),
371 'aim' => array('aim', ''),
372 'icq' => array('icq', ''),
373 'jabber' => array('jabber', ''),
374 'msn' => array('msn', ''),
375 'skype' => array('skype', ''),
376 'yahoo' => array('yahoo', ''),
377 'joined_select' => array('joined_select', 'lt'),
378 'active_select' => array('active_select', 'lt'),
379 'count_select' => array('count_select', 'eq'),
380 'joined' => array('joined', ''),
381 'active' => array('active', ''),
382 'count' => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),
383 'ip' => array('ip', ''),
384 'first_char' => array('first_char', ''),
385 );
386
387 foreach ($check_params as $key => $call)
388 {
389 if (!isset($_REQUEST[$key]))
390 {
391 continue;
392 }
393
394 $param = call_user_func_array('request_var', $call);
395 $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
396 $params[] = $param;
397
398 if (($key != 'sk') && ($key != 'sd'))
399 {
400 $sort_params[] = $param;
401 }
402 }
403
404 if ($action == 'searchuser')
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
405 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
406 $params[] = 'action=searchuser';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
407 }
408 else
409 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
410 if (!empty($alphanum))
411 {
412 $params[] = 'alphanum=' . $alphanum;
413 $sort_params[] = 'alphanum=' . $alphanum;
414 }
415
416 $params[] = 'users_per_page=' . $users_per_page;
417 $sort_params[] = 'users_per_page=' . $users_per_page;
418 $params[] = 'mode=' . $mode;
419 $sort_params[] = 'mode=' . $mode;
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
420 }
421
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
422 $pagination_url = append_sid(CMS_PAGE_MEMBERLIST, false, false, implode('&amp;', $params));
423 $sort_url = append_sid(CMS_PAGE_MEMBERLIST, false, false, implode('&amp;', $sort_params));
424
425 unset($search_params, $sort_params);
426
427 if (!empty($alphanum))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
428 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
429 $alphanum = ($alphanum == '#') ? '#' : (phpbb_clean_username(ip_clean_username(strtolower(urldecode($alphanum)))));
430 $sql_where = ($alphanum == '#') ? "AND LOWER(username) NOT RLIKE '^[a-z]'" : "AND LOWER(username) LIKE '" . $db->sql_escape($alphanum) . "%'";
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
431 }
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
432
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
433 if (($action == 'searchuser') && ($user->data['user_level'] == ADMIN))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
434 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
435 $template->assign_vars(array(
436 'USERNAME' => $username,
437 'EMAIL' => $email,
438 'AIM' => $aim,
439 'ICQ' => $icq,
440 'JABBER' => $jabber,
441 'MSNM' => $msn,
442 'SKYPE' => $skype,
443 'YAHOO' => $yahoo,
444 'JOINED' => implode('-', $joined),
445 'ACTIVE' => implode('-', $active),
446 'COUNT' => $count,
447 'IP' => $ipdomain,
448
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
449 'S_IP_SEARCH_ALLOWED' => ($user->data['user_level'] == ADMIN) ? true : false,
450 'S_EMAIL_SEARCH_ALLOWED' => ($user->data['user_level'] == ADMIN) ? true : false,
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
451 'S_IN_SEARCH_POPUP' => ($form && $field) ? true : false,
452 'S_SEARCH_USER' => true,
453 'S_FORM_NAME' => $form,
454 'S_FIELD_NAME' => $field,
455 'S_SELECT_SINGLE' => $select_single,
456 'S_COUNT_OPTIONS' => $s_find_count,
457 'S_SORT_OPTIONS' => $s_sort_key,
458 'S_JOINED_TIME_OPTIONS' => $s_find_join_time,
459 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time,
460 'S_USER_SEARCH_ACTION' => append_sid(CMS_PAGE_MEMBERLIST, false, false, 'action=searchuser&amp;form=' . $form . '&amp;field=' . $field, implode('&amp;', $params))
461 )
462 );
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
463 }
464
25a5f25 @MightyGorgon Fixed some bugs around... as username sorts, small things in CMS and …
authored
465 // Get the users
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
466 $sql_active_users = empty($config['inactive_users_memberlists']) ? 'AND u.user_active = 1' : '';
25a5f25 @MightyGorgon Fixed some bugs around... as username sorts, small things in CMS and …
authored
467 $sql_from_where_part = " FROM " . USERS_TABLE . " u
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
468 WHERE u.user_id <> " . ANONYMOUS . "
25a5f25 @MightyGorgon Fixed some bugs around... as username sorts, small things in CMS and …
authored
469 $sql_active_users
470 $sql_where";
471
472 // Count the users ...
473 $sql_count = "SELECT COUNT(u.user_id) AS total_users " . $sql_from_where_part;
474 $result = $db->sql_query($sql_count);
475 $total_users = (int) $db->sql_fetchfield('total_users');
476 $db->sql_freeresult($result);
477
478 // Get us some users :D
479 $sql = "SELECT u.user_id " . $sql_from_where_part . " ORDER BY $order_by";
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
480 $result = $db->sql_query_limit($sql, $users_per_page, $start);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
481
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
482 $user_list = array();
483 while ($row = $db->sql_fetchrow($result))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
484 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
485 $user_list[] = (int) $row['user_id'];
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
486 }
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
487 $db->sql_freeresult($result);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
488
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
489 // So, did we get any users?
490 if (sizeof($user_list))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
491 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
492 //phpBB 3 way to get sessions... currently disabled!
493 /*
494 // Session time?! Session time...
495 $sql = "SELECT session_user_id, MAX(session_time) AS session_time
496 FROM " . SESSIONS_TABLE . "
497 WHERE session_time >= " . (time() - ONLINE_REFRESH) . "
498 AND " . $db->sql_in_set('session_user_id', $user_list) . "
499 GROUP BY session_user_id";
500 $result = $db->sql_query($sql);
501
502 $session_times = array();
503 while ($row = $db->sql_fetchrow($result))
504 {
505 $session_times[$row['session_user_id']] = $row['session_time'];
506 }
507 $db->sql_freeresult($result);
508 */
509
510 // Do the SQL thang
511 $sql_style_select = '';
512 $sql_style_from = '';
513 $sql_style_where = '';
514 if (!empty($sql_style))
515 {
516 $sql_style_select = ', t.themes_id, t.style_name';
517 $sql_style_from = ', ' . THEMES_TABLE . ' t';
518 $sql_style_where = 'AND t.themes_id = u.user_style';
519 }
520
521 //$sql = "SELECT u.*" . $sql_style_select . "
1ceca97 @MightyGorgon Some fixes around the package, plus a new feature:
authored
522 $sql = "SELECT u.username, u.user_id, u.user_active, u.user_color, u.user_level, u.user_allow_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_skype, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_from, u.user_from_flag, u.user_rank, u.user_rank2, u.user_rank3, u.user_rank4, u.user_rank5, u.user_birthday, u.user_gender, u.user_allow_viewonline, u.user_lastvisit, u.user_session_time, u.user_style, u.user_lang" . $sql_style_select . "
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
523 FROM " . USERS_TABLE . " u" . $sql_style_from . "
524 WHERE " . $db->sql_in_set('u.user_id', $user_list) . " " . $sql_style_where;
525 // MG Cash MOD For IP - BEGIN
526 // This portion of code must be here... because this edits directly $sql var
527 if (!empty($config['plugins']['cash']['enabled']))
528 {
529 $cm_memberlist->generate_columns($template, $sql, 8);
530 }
531 // MG Cash MOD For IP - END
532 $result = $db->sql_query($sql);
533
534 $id_cache = array();
535 while ($row = $db->sql_fetchrow($result))
536 {
5c8be12 @MightyGorgon Fixed some bugs hunted by Andrea75
authored
537 $row['last_visit'] = (!empty($row['user_session_time'])) ? $row['user_session_time'] : $row['user_lastvisit'];
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
538 //phpBB 3 way to get sessions... currently disabled!
539 //$row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : 0;
5c8be12 @MightyGorgon Fixed some bugs hunted by Andrea75
authored
540 //$row['last_visit'] = (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit'];
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
541
542 $id_cache[$row['user_id']] = $row;
543 }
544 $db->sql_freeresult($result);
545
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
546 // Custom Profile Fields MOD - BEGIN
9dea0d4 @MightyGorgon New Icy Phoenix structure.
authored
547 include_once(IP_ROOT_PATH . 'includes/functions_profile.' . PHP_EXT);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
548 $profile_data = get_fields('WHERE view_in_memberlist = ' . VIEW_IN_MEMBERLIST . ' AND users_can_view = ' . ALLOW_VIEW);
549
550 foreach($profile_data as $field)
551 {
552 $template->assign_block_vars('custom_field_names', array('FIELD_NAME' => $field['field_name']));
553 }
554
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
555 $template->assign_var('NUMCOLS', sizeof($profile_data) + 12);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
556 // Custom Profile Fields MOD - END
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
557
558 // If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date...
559 if ($sort_key == 'l')
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
560 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
561 usort($user_list, '_sort_last_active');
562 }
563
b7d543e @MightyGorgon Some bugs fixed and package prepared for RC:
authored
564 $row_class = '';
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
565 for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
566 {
567 $user_id = $user_list[$i];
568 $row =& $id_cache[$user_id];
569
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
570 if ($mode == 'fast')
571 {
572 $username = $row['username'];
573 $user_id = $row['user_id'];
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
574 $temp_url = append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $user_id);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
575 $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
576 $from = (!empty($row['user_from'])) ? $row['user_from'] : '&nbsp;';
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
577 $joined = create_date($lang['JOINED_DATE_FORMAT'], $row['user_regdate'], $config['board_timezone']);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
578 $posts = ($row['user_posts']) ? $row['user_posts'] : 0;
579
2d7e806 @MightyGorgon Some bugs fixes:
authored
580 $user_ranks['rank_01_html'] = '';
581 $user_ranks['rank_01_img_html'] = '';
582 $user_ranks['rank_02_html'] = '';
583 $user_ranks['rank_02_img_html'] = '';
584 $user_ranks['rank_03_html'] = '';
585 $user_ranks['rank_03_img_html'] = '';
586 $user_ranks['rank_04_html'] = '';
587 $user_ranks['rank_04_img_html'] = '';
588 $user_ranks['rank_05_html'] = '';
589 $user_ranks['rank_05_img_html'] = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
590
591 $gender_image = '';
592 $level = '';
593 $poster_avatar = '';
594 $flag = '';
595 $style = '';
596 $lastlogon = '';
597 $user_birthday = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
598 $profile_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
599 $profile_img = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
600 $profile = '';
601 $pm_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
602 $pm_img = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
603 $pm = '';
604 $email_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
605 $email_img = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
606 $email = '';
607 $www_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
608 $www_img = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
609 $www = '';
610 $aim_url = '';
611 $aim_img = '';
612 $aim = '';
613 $icq_url = '';
614 $icq_status_img = '';
615 $icq_img = '';
616 $icq = '';
617 $msn_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
618 $msn_img = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
619 $msn = '';
620 $skype_url = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
621 $skype_img = '';
622 $skype = '';
0e2484a @MightyGorgon Added some fields to profile (Last Name, First Name, Twitter, Faceboo…
authored
623 $yahoo_url = '';
624 $yahoo_img = '';
625 $yahoo = '';
2c2bc4a @MightyGorgon Many updates to the core code.
authored
626 $online_status_url = '';
627 $online_status_img = '';
628 $online_img = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
629 }
630 else
631 {
632 $username = $row['username'];
633 $user_id = $row['user_id'];
634
635 // Mighty Gorgon - Multiple Ranks - BEGIN
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
636 $user_ranks = generate_ranks($row, $ranks_array);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
637 // Mighty Gorgon - Multiple Ranks - END
638
841b23a @MightyGorgon New beta candidate... with many many changes and new features respect…
authored
639 $username = colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
640
2c2bc4a @MightyGorgon Many updates to the core code.
authored
641 $user_info = array();
642 $user_info = generate_user_info($row);
643 foreach ($user_info as $k => $v)
644 {
645 $$k = $v;
646 }
647
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
648 $poster_avatar = '';
649 if ($mode == 'staff')
650 {
2c2bc4a @MightyGorgon Many updates to the core code.
authored
651 $poster_avatar = $user_info['avatar'];
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
652 }
653
2c2bc4a @MightyGorgon Many updates to the core code.
authored
654 $style = '';
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
655 if ($sql_style == true)
656 {
657 $style = '<br />' . $lang['Style'] . ':&nbsp;' . $row['style_name'];
658 }
659 }
660
2c2bc4a @MightyGorgon Many updates to the core code.
authored
661 // Gender - BEGIN
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
662 $gender_image = '';
663 if (!empty($row['user_gender']))
664 {
665 switch ($row['user_gender'])
666 {
667 case 1:
668 $gender_image = '<img src="' . $images['icon_minigender_male'] . '" alt="' . $lang['Gender']. ': ' . $lang['Male'] . '" title="' . $lang['Gender'] . ': ' . $lang['Male'] . '" />';
669 break;
670 case 2:
671 $gender_image = '<img src="' . $images['icon_minigender_female'] . '" alt="' . $lang['Gender']. ': ' . $lang['Female'] . '" title="' . $lang['Gender'] . ': ' . $lang['Female'] . '" />';
672 break;
673 default:
674 $gender_image = '';
675 break;
676 }
677 }
2c2bc4a @MightyGorgon Many updates to the core code.
authored
678 // Gender - END
679
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
680 if ($row['user_birthday'] != 999999)
681 {
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
682 $age = realdate('Y', (time() / 86400)) - realdate('Y', $row['user_birthday']);
683 if (gmdate('md') < realdate('md', $row['user_birthday']))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
684 {
685 $age--;
686 }
687 $age = '(' . $age . ')';
688 }
689 else
690 {
691 $age = ' ';
692 }
693
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
694 $deluser_url = (($user->data['user_level'] == ADMIN) ? append_sid('delete_users.' . PHP_EXT . '?mode=user_id&amp;del_user=' . $user_id) : '');
b7d543e @MightyGorgon Some bugs fixed and package prepared for RC:
authored
695 $row_class = ip_zebra_rows($row_class);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
696 $template->assign_block_vars('memberrow', array(
697 'ROW_NUMBER' => $i + ($start + 1),
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
698 //'ROW_NUMBER' => $i + ($_GET['start'] + 1) . (($user->data['user_level'] == ADMIN) ? '&nbsp;<a href="' . append_sid('delete_users.' . PHP_EXT . '?mode=user_id&amp;del_user=' . $user_id) . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" /></a>&nbsp;':''),
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
699 'ROW_CLASS' => $row_class,
841b23a @MightyGorgon New beta candidate... with many many changes and new features respect…
authored
700 'USERNAME' => colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']),
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
701 'FROM' => $from,
702 'JOINED' => $joined,
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
703 'DELETE' => (($user->data['user_level'] == ADMIN) ? '&nbsp;<a href="' . $deluser_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" /></a>&nbsp;':''),
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
704
705 // Start add - Last visit MOD
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
706 'LAST_LOGON' => ($user->data['user_level'] == ADMIN || (!$config['hidde_last_logon'] && $row['user_allow_viewonline'])) ? (!empty($row['last_visit']) ? create_date($config['default_dateformat'], $row['last_visit'], $config['board_timezone']) : $lang['Never_last_logon']) : $lang['Hidde_last_logon'],
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
707 // End add - Last visit MOD
708
709 'POSTS' => $posts,
710 'AVATAR_IMG' => $poster_avatar,
711 'PROFILE_IMG' => $profile_img,
712 'PROFILE' => $profile,
713 'SEARCH_IMG' => $search_img,
714 'SEARCH' => $search,
715 'PM_IMG' => $pm_img,
716 'PM' => $pm,
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
717 'EMAIL_IMG' => (!$user->data['session_logged_in']) ? '' : $email_img,
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
718 'EMAIL' => $email,
719 'WWW_IMG' => $www_img,
720 'WWW' => $www,
2c2bc4a @MightyGorgon Many updates to the core code.
authored
721 'AIM_IMG' => $aim_img,
722 'AIM' => $aim,
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
723 'ICQ_STATUS_IMG' => $icq_status_img,
724 'ICQ_IMG' => $icq_img,
725 'ICQ' => $icq,
726 'MSN_IMG' => $msn_img,
727 'MSN' => $msn,
728 'SKYPE_IMG' => $skype_img,
729 'SKYPE' => $skype,
0e2484a @MightyGorgon Added some fields to profile (Last Name, First Name, Twitter, Faceboo…
authored
730 'YIM_IMG' => $yahoo_img,
731 'YIM' => $yahoo,
2c2bc4a @MightyGorgon Many updates to the core code.
authored
732 'POSTER_GENDER' => $gender_image,
733 'STYLE' => $style,
734 'BIRTHDAY' => $row['user_birthday'],
735 'AGE' => $age,
736 'ONLINE_STATUS_IMG' => $online_status_img,
737
738 'U_PROFILE' => $profile_url,
739 'U_PM' => $pm_url,
740 'U_EMAIL' => $email_url,
741 'U_WWW' => $www_url,
742 'U_AIM' => $aim_url,
743 'U_ICQ' => $icq_url,
744 'U_MSN' => $msn_url,
745 'U_SKYPE' => $skype_url,
0e2484a @MightyGorgon Added some fields to profile (Last Name, First Name, Twitter, Faceboo…
authored
746 'U_YIM' => $yahoo_url,
2c2bc4a @MightyGorgon Many updates to the core code.
authored
747 'L_POSTER_ONLINE_STATUS' => $online_status_lang,
748 'POSTER_ONLINE_STATUS_CLASS' => $online_status_class,
749 'U_POSTER_ONLINE_STATUS' => $online_status_url,
750 'U_DELETE' => $deluser_url,
751
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
752 // Mighty Gorgon - Multiple Ranks - BEGIN
753 'USER_LEVEL' => $level,
2d7e806 @MightyGorgon Some bugs fixes:
authored
754 'USER_RANK_01' => $user_ranks['rank_01_html'],
755 'USER_RANK_01_IMG' => $user_ranks['rank_01_img_html'],
756 'USER_RANK_02' => $user_ranks['rank_02_html'],
757 'USER_RANK_02_IMG' => $user_ranks['rank_02_img_html'],
758 'USER_RANK_03' => $user_ranks['rank_03_html'],
759 'USER_RANK_03_IMG' => $user_ranks['rank_03_img_html'],
760 'USER_RANK_04' => $user_ranks['rank_04_html'],
761 'USER_RANK_04_IMG' => $user_ranks['rank_04_img_html'],
762 'USER_RANK_05' => $user_ranks['rank_05_html'],
763 'USER_RANK_05_IMG' => $user_ranks['rank_05_img_html'],
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
764 // Mighty Gorgon - Multiple Ranks - END
765
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
766 'U_VIEWPROFILE' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $user_id)
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
767 )
768 );
769 // MG Cash MOD For IP - BEGIN
2405be5 @MightyGorgon Recoded some parts of the new Plugins section
authored
770 if (!empty($config['plugins']['cash']['enabled']))
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
771 {
772 $cm_memberlist->listing($template, $row);
773 }
774 // MG Cash MOD For IP - END
775
776 // Custom Profile Fields MOD - BEGIN
777 foreach($profile_data as $field)
778 {
779 $name = text_to_column($field['field_name']);
780 $sql2 = "SELECT $name FROM " . USERS_TABLE . "
781 WHERE user_id = $user_id";
2d81429 @MightyGorgon New Icy Phoenix version based on some new core functions.php
authored
782 $result2 = $db->sql_query($sql2);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
783 $val = $db->sql_fetchrow($result2);
9dea0d4 @MightyGorgon New Icy Phoenix structure.
authored
784 $val = displayable_field_data($val[$name], $field['field_type']);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
785
786 $template->assign_block_vars('memberrow.custom_fields',array('CUSTOM_FIELD' => $val));
787 }
788 // Custom Profile Fields MOD - END
789
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
790 unset($id_cache[$user_id]);
791 }
792
793 if (sizeof($user_list))
794 {
795 $template->assign_var('NUMCOLS', 20);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
796 }
797 }
798 else
799 {
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
800 $template->assign_var('S_NO_USERS', true);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
801 }
802
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
803 // Generate page
804 make_jumpbox(CMS_PAGE_VIEWFORUM);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
805
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
806 build_groups_list_template();
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
807
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
808 $template->assign_vars(array(
809 // phpBB3 - BEGIN
810 /*
811 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start),
812 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start),
813 'TOTAL_USERS' => ($total_users == 1) ? $lang['LIST_USER'] : sprintf($lang['LIST_USERS'], $total_users),
814 */
815 'U_FIND_MEMBER' => append_sid(CMS_PAGE_MEMBERLIST . (($action == 'searchuser') ? '' : '?action=searchuser')),
816 'L_FIND_MEMBER' => (($action == 'searchuser') ? $lang['FIND_USERNAME_HIDE'] : $lang['FIND_USERNAME']),
817 'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
818 'U_SORT_FROM' => $sort_url . '&amp;sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
819 'U_SORT_JOINED' => $sort_url . '&amp;sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
820 'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
821 'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
822 'U_SORT_WEBSITE' => $sort_url . '&amp;sk=f&amp;sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
823 'U_SORT_LOCATION' => $sort_url . '&amp;sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
824 'U_SORT_ICQ' => $sort_url . '&amp;sk=g&amp;sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'),
825 'U_SORT_AIM' => $sort_url . '&amp;sk=h&amp;sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'),
826 'U_SORT_MSN' => $sort_url . '&amp;sk=i&amp;sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'),
827 'U_SORT_YIM' => $sort_url . '&amp;sk=j&amp;sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'),
09f38bc @MightyGorgon Another milestone almost achieved for new Icy Phoenix version: user/s…
authored
828 'U_SORT_ACTIVE' => ($user->data['user_level'] == ADMIN) ? $sort_url . '&amp;sk=l&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '',
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
829 'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'),
830 'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'),
831
832 'S_SORT_OPTIONS' => $s_sort_key,
833 'S_JOINED_TIME_OPTIONS' => $s_find_join_time,
834 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time,
835 'S_CHAR_OPTIONS' => $s_char_options,
836
837 'S_MODE_SELECT_BB3' => $s_sort_key,
838 'S_ORDER_SELECT_BB3' => $s_sort_dir,
839 'S_MODE_ACTION_BB3' => $pagination_url,
840 // phpBB3 - END
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
841
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
842 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
843 'L_EMAIL' => $lang['Email'],
844 'L_WEBSITE' => $lang['Website'],
845 'L_FROM' => $lang['Location'],
846 'L_ORDER' => $lang['Order'],
847 'L_SORT' => $lang['Sort'],
848 'L_SUBMIT' => $lang['Sort'],
849 'L_JOINED' => $lang['Joined'],
850 'L_USER_DELETE' => $lang['Delete'],
851 'L_USER_WWW' => $lang['Website'],
852 'L_USER_EMAIL' => $lang['Send_Email'],
853 'L_USER_PROFILE' => $lang['Profile'],
854 'L_LOGON' => $lang['Last_logon'],
855 'L_POSTS' => $lang['Posts'],
856 'L_ONLINE_STATUS' => $lang['Online_status'],
857 'L_LEGEND' => $lang['legend'],
858
859 // Mighty Gorgon - Power Memberlist - BEGIN
860 'L_PM' => $lang['Private_Message'],
861 'L_CONTACTS' => $lang['User_Contacts'],
862 'L_USER_RANK' => $lang['Poster_rank'],
863 'L_GENDER' => $lang['Gender'],
864 'L_STYLE' => $lang['Style'],
865 'L_CONTACT' => $lang['Contact'],
866 'L_AVATAR' => $lang['Avatar'],
867 'L_USERS_PER_PAGE' => $lang['Memberlist_Users_Display'],
868 'S_USERS_PER_PAGE' => $users_per_page,
869 // Mighty Gorgon - Power Memberlist - END
870
871 'L_GO_TO_PAGE_NUMBER' => $lang['Go_To_Page_Number'],
872
873 'S_MODE_SELECT' => $select_sort_mode,
874 'S_ORDER_SELECT' => $select_sort_order,
875 //'S_MODE_ACTION' => append_sid(CMS_PAGE_MEMBERLIST)
876 'S_MODE_ACTION' => append_sid($pagination_url)
877
878 )
879 );
880
881 // Mighty Gorgon - Power Memberlist - BEGIN
882 $alpha_range = range('A', 'Z');
883 $alphanum_range = array_merge(array('' => 'All'), array('%23' => '#'), $alpha_range);
884 foreach ($alphanum_range as $key => $alpha)
885 {
886 if (in_array($alpha, $alpha_range)) $key = $alpha;
887 //$alphanum_search_url = append_sid(CMS_PAGE_MEMBERLIST . '?mode=' . $mode . '&amp;sort=' . $sort_order . '&amp;alphanum=' . strtolower($key));
888 $alphanum_search_url = append_sid(CMS_PAGE_MEMBERLIST . '?mode=username&amp;sort=' . $sort_order . '&amp;alphanum=' . strtolower($key));
889 $template->assign_block_vars('alphanumsearch', array(
890 'SEARCH_SIZE' => floor(100 / sizeof($alphanum_range)) . '%',
891 'SEARCH_TERM' => $alpha,
892 'SEARCH_LINK' => $alphanum_search_url)
893 );
894 }
895 // Mighty Gorgon - Power Memberlist - END
896
57caebd Normalised the PAGINATION variable.
John leach authored
897 $pagination = '&nbsp;';
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
898 if (($mode != 'topten') || ($users_per_page < 10))
899 {
900 $pagination = generate_pagination(CMS_PAGE_MEMBERLIST . '?mode=' . $mode . '&amp;order=' . $sort_order . '&amp;users_per_page=' . $users_per_page . (!empty($alphanum) ? '&amp;alphanum=' . htmlspecialchars($alphanum) : ''), $total_users, $users_per_page, $start);
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
901 }
1896175 @MightyGorgon A lot of bug fixes, thanks to JHL and also a beta version of the new …
authored
902 else
903 {
904 $total_users = 10;
905 }
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
906
907 $template->assign_vars(array(
908 'PAGINATION' => $pagination,
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
909 'PAGE_NUMBER' => sprintf($lang['Page_of'], (floor($start / $users_per_page) + 1), ceil($total_users / $users_per_page)),
25a5f25 @MightyGorgon Fixed some bugs around... as username sorts, small things in CMS and …
authored
910 'L_GOTO_PAGE' => $lang['Goto_page']
911 )
d07f25e @MightyGorgon git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
authored
912 );
913
914
815b92e @MightyGorgon Some bugs fixed and few functions rewritten for images, thumbs and so…
authored
915 $breadcrumbs['bottom_right_links'] .= (($breadcrumbs['bottom_right_links'] != '') ? ('&nbsp;' . MENU_SEP_CHAR . '&nbsp;') : '') . '<a href="' . append_sid(CMS_PAGE_GROUP_CP) . '">' . $lang['LINK_USERGROUPS'] . '</a>';
916 full_page_generation('memberlist_body.tpl', $lang['Memberlist'], '', '');
f407213 @MightyGorgon Some small bugs fixes and added memberlist search for admins.
authored
917
918 function _sort_last_active($first, $second)
919 {
920 global $id_cache, $sort_dir;
921
922 $lesser_than = ($sort_dir === 'd') ? -1 : 1;
923 return $lesser_than * (int) ($id_cache[$first]['last_visit'] - $id_cache[$second]['last_visit']);
924 }
1896175 @MightyGorgon A lot of bug fixes, thanks to JHL and also a beta version of the new …
authored
925 ?>
Something went wrong with that request. Please try again.