PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/upload/admin/admin_bt_tracker_cfg.php

http://torrentpier2.googlecode.com/
PHP | 66 lines | 49 code | 13 blank | 4 comment | 3 complexity | a4a5ac02394f923d077f9f9ce0f0dae3 MD5 | raw file
 1<?php
 2
 3// ACP Header - START
 4if (!empty($setmodules))
 5{
 6	if(IS_SUPER_ADMIN){
 7	$module['TorrentPier']['Tracker_Config'] = basename(__FILE__);}
 8	return;
 9}
10require('./pagestart.php');
11// ACP Header - END
12
13if(!IS_SUPER_ADMIN) bb_die($lang['NOT_ADMIN']);
14
15require(INC_DIR .'functions_admin_torrent.php');
16
17$submit       = isset($_POST['submit']);
18$confirmed    = isset($_POST['confirm']);
19
20// All config names with default values
21$default_cfg_str = array(
22	'off_reason'             => 'Tracker is disabled',
23	'browser_redirect_url'   => 'http://yourdomain.com/',
24);
25
26$default_cfg_bool = array(
27	'autoclean'              => 1,
28	'off'                    => 0,
29	'compact_mode'           => 1,
30	'update_dlstat'          => 1,
31	'limit_active_tor'       => 0,
32	'limit_concurrent_ips'   => 0,
33);
34
35$default_cfg_num = array(
36	'numwant'                => 50,
37	'expire_factor'          => 4,
38	'limit_seed_count'       => 20,
39	'limit_leech_count'      => 4,
40	'leech_expire_factor'    => 60,
41	'limit_seed_ips'         => 0,
42	'limit_leech_ips'        => 0,
43);
44
45// Set template vars
46set_tpl_vars      ($default_cfg_str, $tr_cfg);
47set_tpl_vars_lang ($default_cfg_str);
48
49set_tpl_vars_bool ($default_cfg_bool, $tr_cfg);
50set_tpl_vars_lang ($default_cfg_bool);
51
52set_tpl_vars      ($default_cfg_num, $tr_cfg);
53set_tpl_vars_lang ($default_cfg_num);
54
55$template->assign_vars(array(
56	'IGNORE_REPORTED_IP' => $bb_cfg['ignore_reported_ip'],
57	'ANNOUNCE_INTERVAL'  => $bb_cfg['announce_interval'],
58	'PASSKEY_KEY'        => $bb_cfg['passkey_key'],
59	'GOLD_SILVER_ENABLED' => $tr_cfg['gold_silver_enabled'],
60	'DISABLE_SUBMIT'     => true,
61
62	'S_HIDDEN_FIELDS' => '',
63	'S_CONFIG_ACTION' => "admin_bt_tracker_cfg.php",
64));
65
66print_page('admin_bt_tracker_cfg.tpl', 'admin');