mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Some bugfixes (#1326)
* Some bugfixes * Update CHANGELOG.md * Update functions_admin.php
This commit is contained in:
parent
1a34072e98
commit
a46c40e106
4 changed files with 16 additions and 33 deletions
|
@ -245,25 +245,3 @@ function search_attachments($order_by, &$total_rows)
|
|||
|
||||
return $attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform limit statement on arrays
|
||||
*
|
||||
* @param $array
|
||||
* @param $start
|
||||
* @param $pagelimit
|
||||
* @return array
|
||||
*/
|
||||
function limit_array($array, $start, $pagelimit)
|
||||
{
|
||||
// array from start - start+pagelimit
|
||||
$limit = (count($array) < ($start + $pagelimit)) ? count($array) : $start + $pagelimit;
|
||||
|
||||
$limit_array = [];
|
||||
|
||||
for ($i = $start; $i < $limit; $i++) {
|
||||
$limit_array[] = $array[$i];
|
||||
}
|
||||
|
||||
return $limit_array;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue