Пример #1
0
    die('{"info":"批量导入完成。<br/><br/>匹配行数:[' . $hs . ']<br/>导入成功:[' . $ok . ']<br/>导入失败:[' . $err . ']<br/>更新记录:[' . $up . ']<br/>失效数量:[' . $sx . ']<br/>已存在数:[' . $cf . ']<br/>"' . $info . '}');
}
//基本设置
if (isset($_GET['set'])) {
    if (!empty($_POST['gs'])) {
        $gs = ' ' . $_POST['gs'];
        if (!stristr($gs, '{百度ID}')) {
            die('{"type":"error","emsg":"缺少参数 <strong>{百度ID}</strong> !"}');
        } elseif (!stristr($gs, '{百度BDUSS}')) {
            die('{"type":"error","emsg":"缺少参数 <strong>{百度BDUSS}</strong> !"}');
        }
        $check = !empty($_POST['check']) ? 1 : 0;
        $refresh = !empty($_POST['refresh']) ? 1 : 0;
        option::set('xy_import_gs', $_POST['gs']);
        option::set('xy_import_check', $_POST['check']);
        option::set('xy_import_refresh', $_POST['refresh']);
        die('{"type":"success","regular":"' . urlencode(getgs($_POST['gs'])) . '"}');
    } else {
        die('{"type":"error","emsg":"导入格式不能为空!"}');
    }
}
//删除所有绑定
if (isset($_GET['delete'])) {
    $s = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` where `uid` = '" . UID . "';");
    while ($x = $m->fetch_array($s)) {
        $t = $m->once_fetch_array("SELECT `t` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` where `id` = '" . UID . "';");
        $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t['t'] . "` WHERE `uid` = '" . UID . "' and `pid` = '" . $x['id'] . "';");
        $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `uid` = '" . UID . "' and `id` = '" . $x['id'] . "';");
    }
    echo '<script language="JavaScript">alert("删除所有绑定完成。");location.href="index.php?mod=baiduid";</script>';
}
Пример #2
0
<!-- END NAVI -->

<!-- PAGE1: ADMINID-->
<div class="tab-pane fade in active" id="adminid">
	<form id="import_set" action="index.php?mod=view:xy_import:ajax&set" method="post">
		<div class="input-group">
			<span class="input-group-addon">导入格式</span>
			<input type="text" name="gs" class="form-control" value="<?php 
echo option::get('xy_import_gs');
?>
" placeholder="参考格式:{百度ID}----BDUSS={百度BDUSS}" required/>
		</div><br/>
		<div class="input-group">
			<span class="input-group-addon">正则预览</span>
			<input type="text" id="zzyl" class="form-control" value="<?php 
echo getgs(option::get('xy_import_gs'));
?>
" placeholder="警告,当前没有设置格式,将无法导入" disabled/>
		</div><br/>
		<div class="input-group">
        	<label><input type="checkbox" name="check" value="1" <?php 
echo option::get('xy_import_check') == 1 ? 'checked' : '';
?>
> 导入时效验BDUSS有效性</label>
		</div><br/>
		<div class="input-group">
        	<label><input type="checkbox" name="refresh" value="1" <?php 
echo option::get('xy_import_refresh') == 1 ? 'checked' : '';
?>
> 导入后自动刷新贴吧列表</label>
		</div><br/>