mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-27 21:56:50 +01:00
Allow OTS_Player to be passed as object to getPlayerLink
This commit is contained in:
@@ -89,6 +89,10 @@ function getForumBoardLink($board_id, $page = NULL): string {
|
||||
|
||||
function getPlayerLink($name, $generate = true, bool $colored = false): string
|
||||
{
|
||||
if (is_object($name) and $name instanceof OTS_Player) {
|
||||
$player = $name;
|
||||
}
|
||||
else {
|
||||
$player = new OTS_Player();
|
||||
|
||||
if(is_numeric($name)) {
|
||||
@@ -97,6 +101,7 @@ function getPlayerLink($name, $generate = true, bool $colored = false): string
|
||||
else {
|
||||
$player->find($name);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$player->isLoaded()) {
|
||||
return '(error)';
|
||||
|
||||
Reference in New Issue
Block a user