Gazelle/sections/ajax/top10/index.php

30 lines
651 B
PHP
Raw Permalink Normal View History

2011-09-16 08:00:13 +00:00
<?
// Already done in /sections/ajax/index.php
//enforce_login();
2013-05-04 08:00:48 +00:00
if (!check_perms('site_top10')) {
2011-09-16 08:00:13 +00:00
print json_encode(array('status' => 'failure'));
die();
}
2013-05-01 08:00:16 +00:00
if (empty($_GET['type']) || $_GET['type'] == 'torrents') {
2011-09-16 08:00:13 +00:00
include(SERVER_ROOT.'/sections/ajax/top10/torrents.php');
} else {
2013-05-01 08:00:16 +00:00
switch ($_GET['type']) {
2013-10-01 23:08:42 +00:00
case 'users':
2011-09-16 08:00:13 +00:00
include(SERVER_ROOT.'/sections/ajax/top10/users.php');
break;
2013-10-01 23:08:42 +00:00
case 'tags':
2011-09-16 08:00:13 +00:00
include(SERVER_ROOT.'/sections/ajax/top10/tags.php');
break;
2013-10-01 23:08:42 +00:00
case 'history':
2011-09-16 08:00:13 +00:00
include(SERVER_ROOT.'/sections/ajax/top10/history.php');
break;
2013-10-01 23:08:42 +00:00
default:
2011-09-16 08:00:13 +00:00
print json_encode(array('status' => 'failure'));
break;
}
}
?>