forked from XoopsModules25x/xoopsmembers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rank.php
33 lines (27 loc) · 1.15 KB
/
rank.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
<?php
// Author: Trabis
// URL: http://www.xuups.com
// E-Mail: [email protected]
$GLOBALS['xoopsOption']['template_main'] = 'xoopsmembers_rank.tpl';
require_once __DIR__ . '/header.php';
global $xoopsModule;
$db = XoopsDatabaseFactory::getDatabaseConnection();
$result = $db->query('SELECT * FROM ' . $db->prefix('ranks') . ' ORDER BY rank_id');
$ranks = [];
$sranks = [];
while (false !== ($rank = $db->fetchArray($result))) {
$i = $rank['rank_id'];
if (0 == $rank['rank_special']) {
$ranks[$i]['title'] = $rank['rank_title'];
$ranks[$i]['min'] = $rank['rank_min'];
$ranks[$i]['max'] = $rank['rank_max'];
$ranks[$i]['image'] = ($rank['rank_image'] > '') ? '<img src="' . XOOPS_URL . '/uploads/' . $rank['rank_image'] . '" alt="" >' : ' ';
} else {
$sranks[$i]['title'] = $rank['rank_title'];
$sranks[$i]['image'] = ($rank['rank_image'] > '') ? '<img src="' . XOOPS_URL . '/uploads/' . $rank['rank_image'] . '" alt="" >' : ' ';
}
}
$xoopsTpl->assign('ranks', $ranks);
$xoopsTpl->assign('sranks', $sranks);
require __DIR__ . '/footer.php';
require_once XOOPS_ROOT_PATH . '/footer.php';