Skip to content

Instantly share code, notes, and snippets.

@Adjokip
Created August 10, 2018 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adjokip/6ba0986fd2e433557e0cec1509c0210c to your computer and use it in GitHub Desktop.
Save Adjokip/6ba0986fd2e433557e0cec1509c0210c to your computer and use it in GitHub Desktop.
<?php
$files = [
'.',
'..',
'35hp.cc',
'35hp_2',
'aim_ak-colt',
'aim_headshot',
'awp_map',
'awp_india'
];
unset($files[0], $files[1]);
$perPage = 2;
$currentPage = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;
$offset = ($currentPage - 1)*$perPage;
$fileCount = count($files);
$pageCount = ceil($fileCount/$perPage);
$files = array_slice($files, $offset, $perPage);
echo "Showing $offset-".($offset+$perPage)." of $fileCount files.\n\n";
foreach ($files as $file) {
echo basename($file)."\n";
}
$uri = '?m=gamemanager&p=install_map&home_id='.$_GET['home_id'].'&mod_id='.$_GET['mod_id'].'&ip='.$_GET['ip'].'&port='.$_GET['port'].'&page=';
echo paginationPages($fileCount, $currentPage, $perPage, $uri, 3, 'gamemanager');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment