Passed
Pull Request — master (#81)
by Michael
02:53
created

search.php (11 issues)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
13
/**
14
 * @copyright    XOOPS Project https://xoops.org/
15
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @author       Marcello Brandão aka  Suico
17
 * @author       XOOPS Development Team
18
 * @since
19
 */
20
21
use Xmf\Request;
22
23
require __DIR__ . '/header.php';
24
25
$myts   = MyTextSanitizer::getInstance();
26
$op     = Request::getString('op', 'search');
27
$groups = $xoopsUser ? $xoopsUser->getGroups() : [XOOPS_GROUP_ANONYMOUS];
28
switch ($op) {
29
    default:
30
    case 'search':
31
        $xoopsOption['cache_group']              = implode('', $groups);
32
        $GLOBALS['xoopsOption']['template_main'] = 'yogurt_search.tpl';
33
        require XOOPS_ROOT_PATH . '/header.php';
34
35
        // Dynamic fields
36
        $profileHandler = xoops_getModuleHandler('profile');
37
        // Get fields
38
        $fields = $profileHandler->loadFields();
39
        // Get ids of fields that can be searched
40
        $gpermHandler      = xoops_getHandler('groupperm');
41
        $searchable_fields = $gpermHandler->getItemIds('smartprofile_search', $groups, $xoopsModule->getVar('mid'));
0 ignored issues
show
The method getItemIds() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsGroupPermHandler or XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
        /** @scrutinizer ignore-call */ 
42
        $searchable_fields = $gpermHandler->getItemIds('smartprofile_search', $groups, $xoopsModule->getVar('mid'));
Loading history...
42
43
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
44
        $searchform = new XoopsThemeForm('', 'searchform', 'search.php', 'post');
45
46
        $name_tray = new XoopsFormElementTray(_MD_YOGURT_PROFILE_DISPLAYNAME);
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_DISPLAYNAME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
47
        $name_tray->addElement(new XoopsFormSelectMatchOption('', 'uname_match'));
48
        $name_tray->addElement(new XoopsFormText('', 'uname', 35, 255));
49
        $searchform->addElement($name_tray);
50
        $sortby_arr['uname'] = _MD_YOGURT_PROFILE_DISPLAYNAME;
51
52
        $email_tray = new XoopsFormElementTray(_MD_YOGURT_PROFILE_EMAIL);
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_EMAIL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
53
        $email_tray->addElement(new XoopsFormSelectMatchOption('', 'email_match'));
54
        $email_tray->addElement(new XoopsFormText('', 'email', 35, 255));
55
        $searchform->addElement($email_tray);
56
        $sortby_arr['email'] = _MD_YOGURT_PROFILE_EMAIL;
57
58
        $searchable_types = [
59
            'textbox',
60
            'select',
61
            'radio',
62
            'yesno',
63
            'date',
64
            'datetime',
65
            'timezone',
66
            'language',
67
        ];
68
        foreach (array_keys($fields) as $i) {
69
            if (in_array($fields[$i]->getVar('fieldid'), $searchable_fields, true)
70
                && in_array(
71
                    $fields[$i]->getVar('field_type'),
72
                    $searchable_types,
73
                    true
74
                )) {
75
                $sortby_arr[$fields[$i]->getVar('fieldid')] = $fields[$i]->getVar('field_title');
76
                switch ($fields[$i]->getVar('field_type')) {
77
                    case 'textbox':
78
                        if (XOBJ_DTYPE_INT === $fields[$i]->getVar('field_valuetype')) {
79
                            $searchform->addElement(
80
                                new XoopsFormText(
81
                                    sprintf(
82
                                        _MD_YOGURT_PROFILE_LARGERTHAN,
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_LARGERTHAN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
83
                                        $fields[$i]->getVar('field_title')
84
                                    ), $fields[$i]->getVar(
85
                                         'field_name'
86
                                     ) . '_larger', 35, 35
87
                                )
88
                            );
89
                            $searchform->addElement(
90
                                new XoopsFormText(
91
                                    sprintf(
92
                                        _MD_YOGURT_PROFILE_SMALLERTHAN,
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_SMALLERTHAN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
93
                                        $fields[$i]->getVar('field_title')
94
                                    ), $fields[$i]->getVar(
95
                                         'field_name'
96
                                     ) . '_smaller', 35, 35
97
                                )
98
                            );
99
                        } else {
100
                            $tray = new XoopsFormElementTray($fields[$i]->getVar('field_title'));
101
                            $tray->addElement(
102
                                new XoopsFormSelectMatchOption('', $fields[$i]->getVar('field_name') . '_match')
103
                            );
104
                            $tray->addElement(
105
                                new XoopsFormText(
106
                                    '', $fields[$i]->getVar('field_name'), 35, $fields[$i]->getVar(
107
                                    'field_maxlength'
108
                                )
109
                                )
110
                            );
111
                            $searchform->addElement($tray);
112
                            unset($tray);
113
                        }
114
                        break;
115
                    case 'radio':
116
                    case 'select':
117
                        $size    = count($fields[$i]->getVar('field_options')) > 10 ? 10 : count(
118
                            $fields[$i]->getVar('field_options')
119
                        );
120
                        $element = new XoopsFormSelect(
121
                            $fields[$i]->getVar('field_title'), $fields[$i]->getVar(
122
                            'field_name'
123
                        ), null, $size, true
124
                        );
125
                        $options = $fields[$i]->getVar('field_options');
126
                        asort($options);
127
                        $element->addOptionArray($options);
128
                        $searchform->addElement($element);
129
                        unset($element);
130
                        break;
131
                    case 'yesno':
132
                        $element = new XoopsFormSelect(
133
                            $fields[$i]->getVar('field_title'), $fields[$i]->getVar(
134
                            'field_name'
135
                        ), null, 2, true
136
                        );
137
                        $element->addOption(1, _YES);
138
                        $element->addOption(0, _NO);
139
                        $searchform->addElement($element);
140
                        unset($element);
141
                        break;
142
                    case 'date':
143
                    case 'datetime':
144
                        $searchform->addElement(
145
                            new XoopsFormTextDateSelect(
146
                                sprintf(
147
                                    _MD_YOGURT_PROFILE_LATERTHAN,
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_LATERTHAN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
148
                                    $fields[$i]->getVar('field_title')
149
                                ), $fields[$i]->getVar(
150
                                     'field_name'
151
                                 ) . '_larger', 15, 0
152
                            )
153
                        );
154
                        $searchform->addElement(
155
                            new XoopsFormTextDateSelect(
156
                                sprintf(
157
                                    _MD_YOGURT_PROFILE_EARLIERTHAN,
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_EARLIERTHAN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
158
                                    $fields[$i]->getVar('field_title')
159
                                ), $fields[$i]->getVar(
160
                                     'field_name'
161
                                 ) . '_smaller', 15, time()
162
                            )
163
                        );
164
                        break;
165
                    //                    case "datetime":
166
                    //                        $searchform->addElement(new XoopsFormDateTime(sprintf(_MD_YOGURT_PROFILE_LATERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name')."_larger", 15, 1));
167
                    //                        $searchform->addElement(new XoopsFormDateTime(sprintf(_MD_YOGURT_PROFILE_EARLIERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name')."_smaller", 15, 0));
168
                    //                        break;
169
170
                    case 'timezone':
171
                        $element = new XoopsFormSelect(
172
                            $fields[$i]->getVar('field_title'), $fields[$i]->getVar(
173
                            'field_name'
174
                        ), null, 6, true
175
                        );
176
                        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
177
                        $element->addOptionArray(XoopsLists::getTimeZoneList());
178
                        $searchform->addElement($element);
179
                        unset($element);
180
                        break;
181
                    case 'language':
182
                        $element = new XoopsFormSelectLang(
183
                            $fields[$i]->getVar('field_title'), $fields[$i]->getVar(
184
                            'field_name'
185
                        ), null, 6
186
                        );
187
                        $searchform->addElement($element);
188
                        unset($element);
189
                        break;
190
                }
191
            }
192
        }
193
        asort($sortby_arr);
194
        $sortby_select = new XoopsFormSelect(_MD_YOGURT_PROFILE_SORTBY, 'sortby');
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_SORTBY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
195
        $sortby_select->addOptionArray($sortby_arr);
196
        $searchform->addElement($sortby_select);
197
198
        $order_select = new XoopsFormRadio(_MD_YOGURT_PROFILE_ORDER, 'order', 0);
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_ORDER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
199
        $order_select->addOption(0, _ASCENDING);
200
        $order_select->addOption(1, _DESCENDING);
201
        $searchform->addElement($order_select);
202
203
        $limit_text = new XoopsFormText(_MD_YOGURT_PROFILE_PERPAGE, 'limit', 15, 10);
0 ignored issues
show
The constant _MD_YOGURT_PROFILE_PERPAGE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
204
        $searchform->addElement($limit_text);
205
        $searchform->addElement(new XoopsFormHidden('op', 'results'));
206
207
        $searchform->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
208
209
        $searchform->assign($xoopsTpl);
210
        break;
211
    case 'results':
212
        $GLOBALS['xoopsOption']['template_main'] = 'smartprofile_results.tpl';
213
        require_once XOOPS_ROOT_PATH . '/header.php';
214
215
        $memberHandler = xoops_getHandler('member');
216
        // Dynamic fields
217
        $profileHandler = xoops_getModuleHandler('profile');
218
        // Get fields
219
        $fields = $profileHandler->loadFields();
220
        // Get ids of fields that can be searched
221
        $gpermHandler      = xoops_getHandler('groupperm');
222
        $searchable_fields = $gpermHandler->getItemIds('smartprofile_search', $groups, $xoopsModule->getVar('mid'));
223
        $searchvars        = [];
224
225
        $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
226
        if (isset($_REQUEST['uname']) && '' !== Request::getString('uname', '', 'REQUEST')) {
227
            $string = $myts->addSlashes(trim(Request::getString('uname', '', 'REQUEST')));
228
            switch ($_REQUEST['uname_match']) {
229
                case XOOPS_MATCH_START:
230
                    $string .= '%';
231
                    break;
232
                case XOOPS_MATCH_END:
233
                    $string = '%' . $string;
234
                    break;
235
                case XOOPS_MATCH_CONTAIN:
236
                    $string = '%' . $string . '%';
237
                    break;
238
            }
239
            $criteria->add(new Criteria('uname', $string, 'LIKE'));
240
            $searchvars[] = 'uname';
241
        }
242
        if (isset($_REQUEST['email']) && '' !== Request::getString('email', '', 'REQUEST')) {
243
            $string = $myts->addSlashes(trim(Request::getString('email', '', 'REQUEST')));
244
            switch (Request::getString('email_match', '', 'REQUEST')) {
245
                case XOOPS_MATCH_START:
246
                    $string .= '%';
247
                    break;
248
                case XOOPS_MATCH_END:
249
                    $string = '%' . $string;
250
                    break;
251
                case XOOPS_MATCH_CONTAIN:
252
                    $string = '%' . $string . '%';
253
                    break;
254
            }
255
            $searchvars[] = 'email';
256
            $criteria->add(new Criteria('email', $string, 'LIKE'));
257
            $criteria->add(new Criteria('user_viewemail', 1));
258
        }
259
        $searchable_types = [
260
            'textbox',
261
            'select',
262
            'radio',
263
            'yesno',
264
            'date',
265
            'datetime',
266
            'timezone',
267
            'language',
268
        ];
269
270
        foreach (array_keys($fields) as $i) {
271
            if (in_array($fields[$i]->getVar('fieldid'), $searchable_fields, true)
272
                && in_array(
273
                    $fields[$i]->getVar('field_type'),
274
                    $searchable_types,
275
                    true
276
                )) {
277
                $fieldname = $fields[$i]->getVar('field_name');
278
                if (in_array($fields[$i]->getVar('field_type'), ['select', 'radio'], true)) {
279
                    if (isset($_REQUEST[$fieldname]) && $_REQUEST[$fieldname]) {
280
                        //If field value is sent through request and is not an empty value
281
                        switch ($fields[$i]->getVar(
282
                            'field_valuetype'
283
                        )) {
284
                            case XOBJ_DTYPE_OTHER:
285
                            case XOBJ_DTYPE_INT:
286
                                $value        = array_map('\intval', $_REQUEST[$fieldname]);
287
                                $searchvars[] = $fieldname;
288
                                $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
289
                                break;
290
                            case XOBJ_DTYPE_URL:
291
                            case XOBJ_DTYPE_TXTBOX:
292
                            case XOBJ_DTYPE_TXTAREA:
293
                                $value        = array_map([$xoopsDB, 'quoteString'], $_REQUEST[$fieldname]);
294
                                $searchvars[] = $fieldname;
295
                                $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
296
                                break;
297
                        }
298
                    }
299
                } else {
300
                    switch ($fields[$i]->getVar('field_valuetype')) {
301
                        case XOBJ_DTYPE_OTHER:
302
                        case XOBJ_DTYPE_INT:
303
                            switch ($fields[$i]->getVar('field_type')) {
304
                                case 'date':
305
                                case 'datetime':
306
                                    $value = $_REQUEST[$fieldname . '_larger'];
307
                                    if (!($value = strtotime($_REQUEST[$fieldname . '_larger']))) {
308
                                        $value = (int)$_REQUEST[$fieldname . '_larger'];
309
                                    }
310
                                    if ($value > 0) {
311
                                        $search_url[] = $fieldname . '_larger=' . $value;
312
                                        $searchvars[] = $fieldname;
313
                                        $criteria->add(new Criteria($fieldname, $value, '>='));
314
                                    }
315
316
                                    $value = $_REQUEST[$fieldname . '_smaller'];
317
                                    if (!($value = strtotime($_REQUEST[$fieldname . '_smaller']))) {
318
                                        $value = (int)$_REQUEST[$fieldname . '_smaller'];
319
                                    }
320
                                    if ($value > 0) {
321
                                        $search_url[] = $fieldname . '_smaller=' . $value;
322
                                        $searchvars[] = $fieldname;
323
                                        $criteria->add(new Criteria($fieldname, $value, '<='));
324
                                    }
325
                                    break;
326
                                //                                case "datetime":
327
                                //                                    $value = $_REQUEST[$fieldname."_larger"]['date'];
328
                                //                                    if (intval($value) < 0) { //intval() of a date string is -1
329
                                //                                        $value = strtotime($_REQUEST[$fieldname."_larger"]['date']);
330
                                //                                    }
331
                                //                                    else {
332
                                //                                        $value = intval($_REQUEST[$fieldname."_larger"]['date']);
333
                                //                                    }
334
                                //                                    $search_url[] = $fieldname."_larger=".$value;
335
                                //                                    $searchvars[] = $fieldname;
336
                                //                                    $criteria->add(new Criteria($fieldname, $value, ">="));
337
                                //
338
                                //                                    $value = $_REQUEST[$fieldname."_smaller"]['date'];
339
                                //                                    if (intval($value) < 0) { //intval() of a date string is -1
340
                                //                                        $value = strtotime($_REQUEST[$fieldname."_smaller"]['date']);
341
                                //                                    }
342
                                //                                    else {
343
                                //                                        $value = intval($_REQUEST[$fieldname."_smaller"]['date']);
344
                                //                                    }
345
                                //                                    $search_url[] = $fieldname."_smaller=".$value;
346
                                //                                    $searchvars[] = $fieldname;
347
                                //                                    $criteria->add(new Criteria($fieldname, $value, "<="));
348
                                //                                    break;
349
350
                                default:
351
                                    if (isset($_REQUEST[$fieldname . '_larger']) && 0 !== (int)$_REQUEST[$fieldname . '_larger']) {
352
                                        $value        = (int)$_REQUEST[$fieldname . '_larger'];
353
                                        $search_url[] = $fieldname . '_larger=' . $value;
354
                                        $searchvars[] = $fieldname;
355
                                        $criteria->add(new Criteria($fieldname, $value, '>='));
356
                                    }
357
358
                                    if (isset($_REQUEST[$fieldname . '_smaller']) && 0 !== (int)$_REQUEST[$fieldname . '_smaller']) {
359
                                        $value        = (int)$_REQUEST[$fieldname . '_smaller'];
360
                                        $search_url[] = $fieldname . '_smaller=' . $value;
361
                                        $searchvars[] = $fieldname;
362
                                        $criteria->add(new Criteria($fieldname, $value, '<='));
363
                                    }
364
                                    break;
365
                            }
366
367
                            if (isset($_REQUEST[$fieldname]) && !isset($_REQUEST[$fieldname . '_smaller']) && !isset($_REQUEST[$fieldname . '_larger'])) {
368
                                if (!is_array($_REQUEST[$fieldname])) {
369
                                    $value        = (int)$_REQUEST[$fieldname];
370
                                    $search_url[] = $fieldname . '=' . $value;
371
                                    $criteria->add(new Criteria($fieldname, $value, '='));
372
                                } else {
373
                                    $value = array_map('\intval', $_REQUEST[$fieldname]);
374
                                    foreach ($value as $thisvalue) {
375
                                        $search_url[] = $fieldname . '[]=' . $thisvalue;
376
                                    }
377
                                    $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
378
                                }
379
380
                                $searchvars[] = $fieldname;
381
                            }
382
                            break;
383
                        case XOBJ_DTYPE_URL:
384
                        case XOBJ_DTYPE_TXTBOX:
385
                        case XOBJ_DTYPE_TXTAREA:
386
                            if (isset($_REQUEST[$fieldname]) && '' !== $_REQUEST[$fieldname]) {
387
                                $value = $myts->addSlashes(trim($_REQUEST[$fieldname]));
388
                                switch ($_REQUEST[$fieldname . '_match']) {
389
                                    case XOOPS_MATCH_START:
390
                                        $value .= '%';
391
                                        break;
392
                                    case XOOPS_MATCH_END:
393
                                        $value = '%' . $value;
394
                                        break;
395
                                    case XOOPS_MATCH_CONTAIN:
396
                                        $value = '%' . $value . '%';
397
                                        break;
398
                                }
399
                                $search_url[] = $fieldname . '=' . $value;
400
                                $operator     = 'LIKE';
401
                                $criteria->add(new Criteria($fieldname, $value, $operator));
402
                                $searchvars[] = $fieldname;
403
                            }
404
                            break;
405
                    }
406
                }
407
            }
408
        }
409
410
        if ($searchvars === []) {
411
            break;
412
        }
413
414
        if ('name' === Request::getString('sortby', '', 'REQUEST')) {
415
            $criteria->setSort('name');
416
        } elseif ('email' === Request::getString('sortby', '', 'REQUEST')) {
417
            $criteria->setSort('email');
418
        } elseif ('uname' === Request::getString('sortby', '', 'REQUEST')) {
419
            $criteria->setSort('uname');
420
        } elseif (isset($fields[Request::getString('sortby', '', 'REQUEST')])) {
421
            $criteria->setSort($fields[Request::getString('sortby', '', 'REQUEST')]->getVar('field_name'));
422
        }
423
        $order = 0 === $_REQUEST['order'] ? 'ASC' : 'DESC';
424
        $criteria->setOrder($order);
425
426
        $limit = isset($_REQUEST['limit']) && Request::getInt('limit', 0, 'REQUEST') > 0 ? Request::getInt('limit', 0, 'REQUEST') : 20;
427
        $criteria->setLimit($limit);
428
429
        $start = Request::getInt('start', 0, 'REQUEST');
430
        $criteria->setStart($start);
431
432
        //Get users based on criteria
433
        $profileHandler = xoops_getModuleHandler('profile');
434
        [$users, $profiles, $total_users] = $profileHandler->search($criteria, $searchvars);
0 ignored issues
show
The method search() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

434
        /** @scrutinizer ignore-call */ 
435
        [$users, $profiles, $total_users] = $profileHandler->search($criteria, $searchvars);
Loading history...
435
436
        //Sort information
437
        foreach (array_keys($users) as $k) {
438
            $userarray['output'][] = "<a href='userinfo.php?uid=" . (int)$users[$k]->getVar(
439
                    'uid'
440
                ) . "'>" . $users[$k]->getVar(
441
                    'uname'
442
                ) . '</a>';
443
            $userarray['output'][] = 1 === $users[$k]->getVar(
444
                'user_viewemail'
445
            )
446
                                     || $xoopsUser->isAdmin() ? $users[$k]->getVar(
447
                'email'
448
            ) : '';
449
450
            foreach (array_keys($fields) as $i) {
451
                if (in_array($fields[$i]->getVar('fieldid'), $searchable_fields, true)
452
                    && in_array(
453
                        $fields[$i]->getVar('field_type'),
454
                        $searchable_types,
455
                        true
456
                    )
457
                    && in_array(
458
                        $fields[$i]->getVar('field_name'),
459
                        $searchvars,
460
                        true
461
                    )) {
462
                    $userarray['output'][] = $fields[$i]->getOutputValue($users[$k], $profiles[$k]);
463
                }
464
            }
465
            $xoopsTpl->append('users', $userarray);
466
            unset($userarray);
467
        }
468
469
        //Get captions
470
        $captions[] = _MD_YOGURT_PROFILE_DISPLAYNAME;
471
        $captions[] = _MD_YOGURT_PROFILE_EMAIL;
472
        foreach (array_keys($fields) as $i) {
473
            if (in_array($fields[$i]->getVar('fieldid'), $searchable_fields, true)
474
                && in_array(
475
                    $fields[$i]->getVar('field_type'),
476
                    $searchable_types,
477
                    true
478
                )
479
                && in_array(
480
                    $fields[$i]->getVar('field_name'),
481
                    $searchvars,
482
                    true
483
                )) {
484
                $captions[] = $fields[$i]->getVar('field_title');
485
            }
486
        }
487
        $xoopsTpl->assign('captions', $captions);
488
489
        if ($total_users > $limit) {
490
            $search_url[] = 'op=results';
491
            $search_url[] = 'order=' . $order;
492
            $search_url[] = 'sortby=' . Request::getString('sortby', '', 'REQUEST');
493
            $search_url[] = 'limit=' . $limit;
494
            if (isset($search_url)) {
495
                $args = implode('&amp;', $search_url);
496
            }
497
            require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
498
            $nav = new XoopsPageNav($total_users, $limit, $start, 'start', $args);
499
            $xoopsTpl->assign('nav', $nav->renderNav(5));
500
        }
501
        break;
502
}
503
require XOOPS_ROOT_PATH . '/footer.php';
504