HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/inspirationdigital.com.old/wp-content/plugins/file-away/lib/inc/inc.sort.php
<?php
defined('fileaway') or die('Water, water everywhere, but not a drop to drink.');
$limit = $limit && is_numeric($limit) ? round($limit, 0) : false;
if(!$limit)
{
	if(phpversion() < '5.4') array_multisort($rawnames, SORT_ASC, SORT_STRING, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
	else array_multisort($rawnames, SORT_ASC, SORT_NATURAL, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
}
elseif($limitby == 'random')
{
	$i = 0;
	$keys = array_keys($rawnames); 
	shuffle($keys); 
	$rawrandom = array(); 
	foreach($keys as $key)
	{
		if($i > $limit) break;
		$rawrandom[$key] = $rawnames[$key]; 
		$i++;
	}
	$rawnames = array_intersect_key($rawrandom, $rawnames);	
}
elseif($limitby == 'mostrecent')
{
	array_multisort($times, SORT_DESC, SORT_NUMERIC, $rawnames, $links, $locs, $exts, $fulls, $dirs, $dynamics);
	array_splice($rawnames, $limit);
}
elseif($limitby == 'oldest')
{
	array_multisort($times, SORT_ASC, SORT_NUMERIC, $rawnames, $links, $locs, $exts, $fulls, $dirs, $dynamics);
	array_splice($rawnames, $limit);
}
elseif($limitby == 'alpha')
{
	if(phpversion() < '5.4') array_multisort($rawnames, SORT_ASC, SORT_STRING, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
	else array_multisort($rawnames, SORT_ASC, SORT_NATURAL, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
	array_splice($rawnames, $limit);
}
elseif($limitby == 'alpha-desc')
{
	if(phpversion() < '5.4') array_multisort($rawnames, SORT_DESC, SORT_STRING, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
	else array_multisort($rawnames, SORT_DESC, SORT_NATURAL, $links, $locs, $exts, $fulls, $dirs, $times, $dynamics); 
	array_splice($rawnames, $limit);
}