Passed
Push — master ( e97b8d...400506 )
by Michael
01:59 queued 11s
created
Severity
1
<?php
2
//  Author: Trabis
3
//  URL: http://www.xuups.com
4
//  E-Mail: [email protected]
5
6
$xoopsOption['template_main'] = 'xoopsmembers_rank.tpl';
7
require_once  __DIR__ . '/header.php';
8
9
global $xoopsModule;
10
11
$db=Database::getInstance();
0 ignored issues
show
Bug Best Practice introduced by
The method Database::getInstance() is not static, but was called statically. ( Ignorable by Annotation )

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

11
$db=Database::/** @scrutinizer ignore-call */ getInstance();
Loading history...
12
13
$result = $db->query("SELECT * FROM ".$db->prefix("ranks")." ORDER BY rank_id");
14
$ranks = array();
15
$sranks = array();
16
17
while ( $rank = $db->fetchArray($result) ) {
18
    $i = $rank['rank_id'];
19
    if ($rank['rank_special']==0){
20
        $ranks[$i]['title'] = $rank['rank_title'];
21
        $ranks[$i]['min'] = $rank['rank_min'];
22
        $ranks[$i]['max'] = $rank['rank_max'];
23
        $ranks[$i]['image'] = ($rank['rank_image'] > '')?'<img src="'.XOOPS_URL.'/uploads/'.$rank['rank_image'].'" alt="" />':'&nbsp;';
24
    } else {
25
        $sranks[$i]['title'] = $rank['rank_title'];
26
        $sranks[$i]['image'] = ($rank['rank_image'] > '')?'<img src="'.XOOPS_URL.'/uploads/'.$rank['rank_image'].'" alt="" />':'&nbsp;';
27
    }
28
}
29
$xoopsTpl->assign('ranks', $ranks);
30
$xoopsTpl->assign('sranks', $sranks);
31
32
include 'footer.php';
33
include_once XOOPS_ROOT_PATH."/footer.php";
34
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
35
36