exit; } $list = ''; $domain_sub = file_get_contents('./template/domain_sub.html'); foreach ($response['domains'] as $id => $domain) { $list_sub = str_replace('{{id}}', $domain['id'], $domain_sub); $list_sub = str_replace('{{domain}}', $domain['name'], $list_sub); $list_sub = str_replace('{{grade}}', $dnspod->grade_list[$domain['grade']], $list_sub); $list_sub = str_replace('{{status}}', $dnspod->status_list[$domain['status']], $list_sub); $list_sub = str_replace('{{status_new}}', $domain['status'] == 'pause' ? 'enable' : 'disable', $list_sub); $list_sub = str_replace('{{status_text}}', $domain['status'] == 'pause' ? '启用' : '暂停', $list_sub); $list_sub = str_replace('{{records}}', $domain['records'], $list_sub); $list_sub = str_replace('{{updated_on}}', $domain['updated_on'], $list_sub); $list .= $list_sub; } $text = $dnspod->get_template('domain'); $text = str_replace('{{title}}', '域名列表', $text); $text = str_replace('{{list}}', $list, $text); } elseif ($_GET['action'] == 'domaincreate') { if ($_POST['domain'] == '') { $dnspod->message('danger', '参数错误。', -1); } $response = $dnspod->api_call('Domain.Create', array('domain' => $_POST['domain'])); $dnspod->message('success', '添加成功。', '?action=domainlist'); } elseif ($_GET['action'] == 'domainstatus') { if ($_GET['domain_id'] == '') { $dnspod->message('danger', '参数错误。', -1); } if ($_GET['status'] == '') { $dnspod->message('danger', '参数错误。', -1); }