diff --git a/src/bf2sclone/config.inc.php b/src/bf2sclone/config.inc.php index 615e762..b62a7b3 100644 --- a/src/bf2sclone/config.inc.php +++ b/src/bf2sclone/config.inc.php @@ -37,6 +37,9 @@ function defineVar($name, $default) { defineVar('RANKING_HIDE_PIDS_START', 1); defineVar('RANKING_HIDE_PIDS_END', 999999999); +// Whether to show PIDs instead of player names hidden players from rankings +defineVar('RANKING_PIDS_AS_NAMES', false); + // Number of players to show on the leaderboard frontpage defineVar('LEADERBOARD_COUNT', 25); ?> diff --git a/src/bf2sclone/template/current-ranking.php b/src/bf2sclone/template/current-ranking.php index 0df0720..fff6872 100644 --- a/src/bf2sclone/template/current-ranking.php +++ b/src/bf2sclone/template/current-ranking.php @@ -50,14 +50,14 @@ $desc = (isset($value['desc']) && !empty($value['desc'])) ? $value['desc'] : ' '; $template .= ' - '.$value['name'].''; + ' . esc_attr($value['name']) . ''; foreach($value['data'] as $v) { $template .= ' '.getRankByID($v['rank']).' - '.$v['name'].' + ' . esc_attr(RANKING_PIDS_AS_NAMES ? $v['id'] : $v['name']) . '
'. $v['value'] .' '; } diff --git a/src/bf2sclone/template/leaderboard.php b/src/bf2sclone/template/leaderboard.php index b495683..71465ca 100644 --- a/src/bf2sclone/template/leaderboard.php +++ b/src/bf2sclone/template/leaderboard.php @@ -43,7 +43,7 @@ # - Nick + ' . (RANKING_PIDS_AS_NAMES ? 'PID' : 'Nick') . ' Global Score Country Time @@ -60,7 +60,7 @@ '.($key+1).'   - '.$value['name'].' + '. esc_attr(RANKING_PIDS_AS_NAMES ? $value['id'] : $value['name']) .' '.$value['score'].' diff --git a/src/bf2sclone/template/my-leaderboard.php b/src/bf2sclone/template/my-leaderboard.php index d634ce9..e8fa136 100644 --- a/src/bf2sclone/template/my-leaderboard.php +++ b/src/bf2sclone/template/my-leaderboard.php @@ -79,7 +79,7 @@ -  '.$value['name'].'  +  ' . esc_attr(RANKING_PIDS_AS_NAMES ? $value['id'] : $value['name']) . '  '.$value['score'].' '.$value['spm'].' diff --git a/src/bf2sclone/template/playerstats.php b/src/bf2sclone/template/playerstats.php index 6264376..d70f53e 100644 --- a/src/bf2sclone/template/playerstats.php +++ b/src/bf2sclone/template/playerstats.php @@ -3,7 +3,7 @@ - ' . esc_attr($player['name'] . ' ' . getRankByID($player['rank']) . ' Stats, ' . TITLE) . ' + ' . esc_attr((RANKING_PIDS_AS_NAMES ? $player['id'] : $player['name']) . ' ' . getRankByID($player['rank']) . ' Stats, ' . TITLE) . ' @@ -21,7 +21,7 @@

- ' . $player['name'] . ' ' . getRankByID($player['rank']) . ' + ' . esc_attr((RANKING_PIDS_AS_NAMES ? $player['id'] : $player['name'])) . ' ' . getRankByID($player['rank']) . '

@@ -43,7 +43,7 @@ $template .= $ROOT . 'game-images/soldiers/' . $playerFavorite['army'] . '_' . $playerFavorite['kit'] . '_' . $playerFavorite['weapon'] . '.jpg'; else $template .= $ROOT . 'game-images/soldiers/' . $playerFavorite['army'] . '_' . $playerFavorite['kit'] . '_5.jpg'; // show pistol... - $template .= '" alt="' . $player['name'] . ' - ' . getArmyByID($playerFavorite['army']) . '" /> + $template .= '" alt="' . esc_attr((RANKING_PIDS_AS_NAMES ? $player['id'] : $player['name'])) . ' - ' . getArmyByID($playerFavorite['army']) . '" /> ' . $weapons[$playerFavorite['weapon']]['name'] . ' ' . getVehicleByID($playerFavorite['vehicle']) . ' ' . getKitByID($playerFavorite['kit']) . ' @@ -719,7 +719,7 @@ Favorite Victim
(Kills to) '; if ($victims && trim($victims[0]['victim']) != '') - $template .= ' ' . getNickFromPID($victims[0]['victim']) . ' (' . $victims[0]['count'] . ')'; + $template .= ' ' . esc_attr(RANKING_PIDS_AS_NAMES ? $victims[0]['victim'] : getNickFromPID($victims[0]['victim'])) . ' (' . $victims[0]['count'] . ')'; else $template .= 'You are no one\'s worst enemy. Go bully someone.'; $template .= ' @@ -738,7 +738,7 @@ { if ($written != 0) $template .= ', '; $written++; - $template .= ' '.getNickFromPID($victims[$i]['victim']).' ('.$victims[$i]['count'].')'; + $template .= ' ' . esc_attr(RANKING_PIDS_AS_NAMES ? $victims[$i]['victim'] : getNickFromPID($victims[$i]['victim'])) . ' ('.$victims[$i]['count'].')'; } } $template .= ' @@ -747,7 +747,7 @@ Worst Enemy
(Deaths by)'; if ($enemies) - $template .= ' ' . getNickFromPID($enemies[0]['attacker']) . ' (' . $enemies[0]['count'] . ')'; + $template .= ' ' . esc_attr(RANKING_PIDS_AS_NAMES ? $enemies[0]['attacker'] : getNickFromPID($enemies[0]['attacker'])) . ' (' . $enemies[0]['count'] . ')'; else $template .= 'It seems you are invincible!'; $template .= ' @@ -767,7 +767,7 @@ { if ($written != 0) $template .= ', '; $written++; - $template .= ' '.getNickFromPID($enemies[$i]['attacker']).' ('.$enemies[$i]['count'].')'; + $template .= ' ' . esc_attr(RANKING_PIDS_AS_NAMES ? $enemies[$i]['attacker'] : getNickFromPID($enemies[$i]['attacker'])) . ' ('.$enemies[$i]['count'].')'; } } $template .= ' diff --git a/src/bf2sclone/template/search.php b/src/bf2sclone/template/search.php index a089871..52486b7 100644 --- a/src/bf2sclone/template/search.php +++ b/src/bf2sclone/template/search.php @@ -78,7 +78,7 @@ $template .= ' - '.$searchresults[$i]['name'].'  + ' . (RANKING_PIDS_AS_NAMES ? $searchresults[$i]['id'] : esc_attr($searchresults[$i]['name'])) . '  '.$searchresults[$i]['score'].' diff --git a/src/bf2sclone/template/server.php b/src/bf2sclone/template/server.php index d410ca6..1aa77f5 100644 --- a/src/bf2sclone/template/server.php +++ b/src/bf2sclone/template/server.php @@ -210,7 +210,7 @@ ' . ($s['data'] ? esc_attr($k+1) : '-') . ' ' . ' ' .  esc_attr(getRankByID($p['rank'])) . ' - ' . esc_attr($p['name']) . ' + ' . esc_attr(RANKING_PIDS_AS_NAMES ? $p['pid'] : $p['name']) . ' ' . ($s['data'] ? esc_attr($p['score']) : '-') . ' ' . ($s['data'] ? esc_attr($p['kills']) : '-') . '