CommunityContent/Listing

* generally use indexed/non-asssociative arrays when returning content
This commit is contained in:
Sarjuuk
2022-03-28 16:16:59 +02:00
parent b08d30d043
commit 6db77ed4f2
2 changed files with 6 additions and 6 deletions

View File

@@ -178,7 +178,7 @@ class CommunityContent
}
}
return $comments;
return array_values($comments);
}
public static function getCommentReplies(int $commentId, int $limit = 0, ?int &$nFound = 0) : array
@@ -440,7 +440,7 @@ class CommunityContent
unset($v['user']);
}
return $videos;
return array_values($videos);
}
public static function getScreenshots(int $typeOrUser = 0, int $typeId = 0, int &$nFound = 0, bool $dateFmt = true) : array
@@ -484,7 +484,7 @@ class CommunityContent
unset($s['user']);
}
return $screenshots;
return array_values($screenshots);
}
public static function getAll(int $type, int $typeId, array &$jsg) : array

View File

@@ -95,7 +95,7 @@ class UtilityPage extends GenericPage
else
{
array_walk($data, fn(&$d) => $d['date'] = date(Util::$dateFormatInternal, $d['date']));
$this->lvTabs[] = ['commentpreview', ['data' => array_values($data)]];
$this->lvTabs[] = ['commentpreview', ['data' => $data]];
}
break;
@@ -126,7 +126,7 @@ class UtilityPage extends GenericPage
else
{
array_walk($data, fn(&$d) => $d['date'] = date(Util::$dateFormatInternal, $d['date']));
$this->lvTabs[] = ['screenshot', ['data' => array_values($data)]];
$this->lvTabs[] = ['screenshot', ['data' => $data]];
}
break;
@@ -157,7 +157,7 @@ class UtilityPage extends GenericPage
else
{
array_walk($data, fn(&$d) => $d['date'] = date(Util::$dateFormatInternal, $d['date']));
$this->lvTabs[] = ['video', ['data' => array_values($data)]];
$this->lvTabs[] = ['video', ['data' => $data]];
}
break;