function mok_follow_check() { $head = array('User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36', 'Cookie:BDUSS=' . $_GET['bduss']); $opt = unserialize(option::get('mok_follow')); foreach ($opt['mustTieba'] as $tb => $lv) { $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head); $t = $c->get(); $c->close(); if (textMiddle($t, ' (等级', ')') < $lv) { msg($opt['error'][0]); } } if (count($opt['optionTieba']) > 0) { $check = false; foreach ($opt['optionTieba'] as $tb => $lv) { $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head); $t = $c->get(); $c->close(); if (textMiddle($t, ' (等级', ')') >= $lv) { $check = true; break; } } if ($check == false) { msg($opt['error'][0]); } } }
function fyy_assistant_delus() { $key = option::xget('fyy_assistant', 'key'); foreach ($_POST['user'] as $uid) { $usname = $m->once_fetch_array("SELECT `name` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'"); $post = new wcurl("{$murl}?pub_plugin=fyy_massistant&delus&key={$key}&stname=" . SYSTEM_NAME . "&usname={$usname}"); $a = $post->exec(); } }
function cron_mok_zdwk() { //如果今天签到过了直接返回日志 if (option::get('mok_zdwk_run') == date('d')) { return option::get('mok_zdwk_log'); } global $m; $prefix = DB_PREFIX; //选出用户的options和bduss $res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` = 'mok_zdwk_wk'\nOR {$prefix}users_options.`name` = 'mok_zdwk_zd'"); $wk = $zd = 0; $bduss = array(); if ($m->num_rows($res) != 0) { while ($row = $res->fetch_array()) { //判断该选项是否开启 if ($row['value'] == 'on') { //记录bduss(数量),如果bduss数组内没有该bduss,则加入数组 if (!in_array($row['bduss'], $bduss)) { $bduss[] = $row['bduss']; } if ($row['name'] === 'mok_zdwk_wk') { $wk++; $head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest'); $c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head); $c->addCookie('BDUSS=' . $row['bduss']); $c->exec(); $c->close(); } else { if ($row['name'] === 'mok_zdwk_zd') { $zd++; $c = new wcurl('http://zhidao.baidu.com/'); $c->addCookie('BDUSS=' . $row["bduss"]); $stoken = $c->get(); $c->close(); $stoken = textMiddle($stoken, '"stoken":"', '",'); if ($stoken != "") { $c = new wcurl('http://zhidao.baidu.com/submit/user'); $c->addCookie('BDUSS=' . $row["bduss"]); $c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken)); $c->close(); } } } } } } $log = "知道、文库签到完毕<br/>" . date("Y-m-d H:i:s") . "<br/>共计百度账号: " . count($bduss) . " 个<br/>知道签到: {$zd} 个<br/>文库签到: {$wk} 个"; option::set('mok_zdwk_run', date('d')); option::set('mok_zdwk_log', $log); return $log; }
function verifyTiezi_gettie($tid, $ck) { $c = new wcurl('http://tieba.baidu.com/mo/m?kz=' . $tid, array('User-Agent: Chinese F*****g Phone')); $c->addcookie('BDUSS=' . $ck); $t = $c->exec(); preg_match('/<form action=\\"(.*?)\\" method=\\"post\\">/', $t, $formurl); preg_match('/<input type=\\"hidden\\" name=\\"ti\\" value=\\"(.*?)\\"\\/>/', $t, $ti); preg_match('/<input type=\\"hidden\\" name=\\"src\\" value=\\"(.*?)\\"\\/>/', $t, $src); preg_match('/<input type=\\"hidden\\" name=\\"word\\" value=\\"(.*?)\\"\\/>/', $t, $word); preg_match('/<input type=\\"hidden\\" name=\\"tbs\\" value=\\"(.*?)\\"\\/>/', $t, $tbs); preg_match('/<input type=\\"hidden\\" name=\\"fid\\" value=\\"(.*?)\\"\\/>/', $t, $fid); preg_match('/<input type=\\"hidden\\" name=\\"z\\" value=\\"(.*?)\\"\\/>/', $t, $z); preg_match('/<input type=\\"hidden\\" name=\\"floor\\" value=\\"(.*?)\\"\\/>/', $t, $floor); return array('__formurl' => $formurl[1], 'co' => '', 'ti' => $ti[1], 'src' => $src[1], 'word' => $word[1], 'tbs' => $tbs[1], 'ifpost' => '1', 'ifposta' => '0', 'post_info' => '0', 'tn' => 'baiduWiseSubmit', 'fid' => $fid[1], 'verify' => '', 'verify_2' => '', 'pinf' => '1_2_0', 'pic_info' => '', 'z' => $z[1], 'last' => '0', 'pn' => '0', 'r' => '0', 'see_lz' => '0', 'no_post_pic' => '0', 'floor' => $floor[1], 'sub1' => '回贴'); }
function wmzz_zan_do($kw, $pid, $tid, $b) { $pda = array('BDUSS' => $b, '_client_id' => 'wappc_1396611108603_817', '_client_type' => '2', '_client_version' => '5.7.0', '_phone_imei' => '642b43b58d21b7a5814e1fd41b08e2a6', 'action' => 'like', 'from' => 'tieba', 'kw' => $kw, 'post_id' => $pid, 'thread_id' => $tid); $ex = ''; foreach ($pda as $k => $v) { $ex .= $k . '=' . $v; } $pda['sign'] = md5($ex . 'tiebaclient!!!'); //!! $x = new wcurl('http://c.tieba.baidu.com/c/c/zan/like', array('Content-Type: application/x-www-form-urlencoded')); $x->addcookie('BDUSS=' . $b); $x->set(CURLOPT_TIMEOUT, 1); return $x->post($pda); //$x->close(); }
function cron_wmzz_ban() { global $m; $s = unserialize(option::get('plugin_wmzz_ban')); $now = strtotime(date('Y-m-d')); $y = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_ban` WHERE `nextdo` <= '{$now}' LIMIT {$s['limit']}"); while ($x = $m->fetch_array($y)) { $r = wmzz_ban_getTime($x['date']); if ($r != '-1') { $bduss = misc::getCookie($x['pid']); $c = new wcurl('http://tieba.baidu.com/pmc/blockid'); $c->addcookie('BDUSS=' . $bduss); $c->post(array('user_name[]' => $x['user'], 'day' => $r, 'fid' => misc::getFid($x['tieba']), 'tbs' => misc::getTbs($x['uid'], $bduss), 'ie' => 'utf-8', 'reason' => $s['msg'])); $next = $now + $r * 86400; $m->query("UPDATE `" . DB_PREFIX . "wmzz_ban` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } else { $m->query("DELETE FROM `" . DB_PREFIX . "wmzz_ban` WHERE `id` = '{$x['id']}'"); } } }
function mok_bgimg_header() { global $i; $mok_bgimg = unserialize($i['opt']['mok_bgimg']); $mok_bgimg_img = unserialize($i['opt']['mok_bgimg_img']); $mok_bgimg_bing = unserialize($i['opt']['mok_bgimg_bing']); $img = explode("\r\n", $mok_bgimg['img']); //图片列表 if (count($img) > 0 || $mok_bgimg_img['bing'] == '1') { //至少要有一张图片或开启bing每日壁纸 //自动更换 if ($mok_bgimg['change'] != 0) { $change = false; //是否更换 if ($mok_bgimg['change'] == 1) { //每天更换 if ($mok_bgimg_img['day'] != date('d')) { $change = true; } } elseif ($mok_bgimg['change'] == 2) { //每小时更换 if ($mok_bgimg_img['hour'] != date('H')) { $change = true; } } elseif ($mok_bgimg['change'] == 3) { //每次访问更换 $change = true; } if ($change) { //记录背景更换时间 $mok_bgimg_img['day'] = date('d'); $mok_bgimg_img['hour'] = date('H'); if ($mok_bgimg['bing'] == '1') { //如果使用bing每日壁纸 $c = new wcurl('http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1'); $data = json_decode($c->get(), true); $c->close(); if (!empty($data['images'][0]['url'])) { option::set('mok_bgimg_bing', serialize(array('img' => $data['images'][0]['url']))); $mok_bgimg_img['img'] = $data['images'][0]['url']; } } else { if ($mok_bgimg['mode'] == 0) { //顺序更换 $key = array_search($mok_bgimg_img['img'], $img); //在图片列表中寻找当前背景图的序号 if ($key !== false) { if (count($img) == $key + 1) { //如果当前图片已经是最后一张 $mok_bgimg_img['img'] = $img[0]; } else { $mok_bgimg_img['img'] = $img[$key + 1]; } } else { //如果在图片列表中没有找到当前背景图,就从第一张背景图开始 $mok_bgimg_img['img'] = $img[0]; } } elseif ($mok_bgimg['mode'] == 1) { //随机更换 $mok_bgimg_img['img'] = $img[mt_rand(0, count($img) - 1)]; } } } } //第一次安装插件时此值为空,自动使用第一张图 if ($mok_bgimg_img['img'] == '') { $mok_bgimg_img['img'] = $img[0]; } //背景重复 if ($mok_bgimg['repeat'] == 3 || $mok_bgimg['repeat'] == 4) { //静态悬浮 if ($mok_bgimg['repeat'] == 3) { echo '<div id="mok_bgimg" style="width:100%;height:100%;background-size:100% 100%;background-image:url(\'' . $mok_bgimg_img['img'] . '\');position:fixed;"></div>'; } else { echo '<div id="mok_bgimg" style="width:100%;height:100%;background-size:100% auto;background-image:url(\'' . $mok_bgimg_img['img'] . '\');position:fixed;"></div>'; } } else { if ($mok_bgimg['repeat'] == 0) { //纵向重复 $tmp[] = 'background-repeat:repeat-y'; } else { $tmp[] = 'background-repeat:no-repeat'; } if ($mok_bgimg['repeat'] == 2) { //拉伸全屏 $tmp[] = 'background-size:100% 100%'; } else { $tmp[] = 'background-size:100% auto'; } $tmp[] = 'background-image:url(' . $mok_bgimg_img['img'] . ')'; $css = implode(';', $tmp) . ';'; echo '<style>body {' . $css . '}</style>'; } option::set('mok_bgimg_img', serialize($mok_bgimg_img)); //保存背景图片和更换时间 //透明选项 $css = '<style>'; if ($mok_bgimg['daohang'] == 1) { $css .= '.navbar{background:none !important}'; } if ($mok_bgimg['chengxuxinxi'] == 1) { $css .= '.panel{background:none !important}'; } if ($mok_bgimg['yonghuxinxi'] == 1) { $css .= '.list-group-item{background:none !important}'; } if ($mok_bgimg['liebiao'] == 1) { $css .= '.table-striped>tbody>tr:nth-of-type(odd){background:none !important}'; } if ($mok_bgimg['liebiaoxian'] == 1) { $css .= '.table>tbody>tr>td{border-top:none !important}'; } if ($mok_bgimg['tishikuang'] == 1) { $css .= '.alert{background:none !important}'; } if ($mok_bgimg['caidan'] == 1) { $css .= '.nav>li>a:hover, .nav>li>a:focus{background:none !important}'; } if ($mok_bgimg['shurukuang'] == 1) { $css .= '.form-control{background:none !important}'; } if ($mok_bgimg['anniu'] == 1) { $css .= '.btn{background:none !important}'; } //字体颜色 if (!empty($mok_bgimg['c_putong'])) { $css .= 'body{color:' . $mok_bgimg['c_putong'] . '}'; } if (!empty($mok_bgimg['c_zuoce'])) { $css .= '.container .nav>li>a{color:' . $mok_bgimg['c_zuoce'] . '}'; } if (!empty($mok_bgimg['c_dingbu'])) { $css .= '.navbar-default .navbar-nav>li>a,.navbar-default .navbar-brand{color:' . $mok_bgimg['c_dingbu'] . ' !important}'; } if (!empty($mok_bgimg['c_shurukuang'])) { $css .= '.form-control{color:' . $mok_bgimg['c_shurukuang'] . '}'; } $css .= '</style>'; echo $css; } }
unlink($floderName . '/config.php'); } if (file_exists($floderName . '/app.conf')) { unlink($floderName . '/app.conf'); } if (file_exists($floderName . '/config.yaml')) { unlink($floderName . '/config.yaml'); } //覆盖文件 if (CopyAll($floderName, SYSTEM_ROOT) !== true) { DeleteFile(UPDATE_CACHE); msg('错误 - 更新失败:<br/><br/>无法更新文件'); } DeleteFile(UPDATE_CACHE); //获取最新的版本号 $c = new wcurl('http://kenvix.oschina.io/tieba-cloud-sign/'); $data = json_decode($c->exec(), true); $c->close(); //修改版本号 option::set('vid', $data['vid']); //暂不支持更新脚本 msg('恭喜您,更新成功!', SYSTEM_URL . 'index.php?mod=admin:update&ok'); break; case 'admin:update:changeServer': if (isset($_GET['server'])) { option::set('update_server', $_GET['server']); } break; case 'baiduid:getverify': global $m; if (option::get('bduss_num') == '-1' && ROLE != 'admin') {
/** * 扫描指定PID的所有贴吧 * @param $pid PID */ public static function scanTiebaByPid($pid) { global $i; global $m; $cma = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "baiduid` WHERE `id` = '{$pid}';"); $uid = $cma['uid']; $ubduss = $cma['bduss']; $isvip = self::isvip($uid); $pid = $cma['id']; $table = self::getTable($uid); $n3 = 1; $n = 0; $n2 = 0; $addnum = 0; $list = array(); $o = option::get('tb_max'); while (true) { $url = 'http://tieba.baidu.com/f/like/mylike?&pn=' . $n3; $n3++; $addnum = 0; $c = new wcurl($url, array('User-Agent: Phone XXX')); $c->addcookie("BDUSS=" . $ubduss); $ch = $c->exec(); $c->close(); preg_match_all('/\\<td\\>(.*?)\\<a href=\\"\\/f\\?kw=(.*?)\\" title=\\"(.*?)\\">(.*?)\\<\\/a\\>\\<\\/td\\>/', $ch, $list); foreach ($list[3] as $v) { $n++; if (!empty($o) && $isvip == false && $n > $o) { break 2; } $v = addslashes(htmlspecialchars(mb_convert_encoding($v, "UTF-8", "GBK"))); $osq = $m->once_fetch_array("SELECT COUNT(*) AS `C` FROM `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` WHERE `uid` = " . $uid . " AND `pid` = '{$pid}' AND `tieba` = '{$v}';"); if ($osq['C'] == '0') { $m->query("INSERT INTO `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` (`id`, `pid`, `uid`, `tieba`, `no`, `latest`) VALUES (NULL, {$pid}, " . $uid . ", '{$v}', 0, 0);"); } $addnum++; } if ($n3 > 100) { break; //100页后重复 } if (!isset($list[3][0])) { break; //完成 } elseif ($o != 0 && $n2 >= $o && $isvip == false) { break; //超限 } $n2 = $n2 + $addnum; } }
/** * 执行一个网络请求而不等待返回结果 * @param string $url URL * @param string $post post数据包,留空为get * @param string $cookie cookies * @return bool fsockopen是否成功 */ function sendRequest($url, $post = '', $cookie = '') { if (function_exists('fsockopen')) { $matches = parse_url($url); $host = $matches['host']; if (substr($url, 0, 8) == 'https://') { $host = 'ssl://' . $host; } $path = $matches['path'] ? $matches['path'] . ($matches['query'] ? '?' . $matches['query'] : '') : '/'; $port = !empty($matches['port']) ? $matches['port'] : 80; if (!empty($post)) { $out = "POST {$path} HTTP/1.1\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "Host: {$host}\r\n"; $out .= "Connection: Close\r\n\r\n"; $out .= $post; } else { $out = "GET {$path} HTTP/1.1\r\n"; $out .= "Host: {$host}\r\n"; $out .= "Connection: Close\r\n\r\n"; } $fp = fsockopen($host, $port); if (!$fp) { return false; } else { stream_set_blocking($fp, 0); stream_set_timeout($fp, 0); fwrite($fp, $out); fclose($fp); return true; } } else { $x = new wcurl($url); $x->set(CURLOPT_CONNECTTIMEOUT, 1); $x->set(CURLOPT_TIMEOUT, 1); $x->addcookie($cookie); if (empty($post)) { $x->post($post); } else { $x->exec(); } return true; } }
if (option::get('same_pid') == '2') { echo '{"error":"-11","msg":"你已经绑定了这个百度账号或者该账号已被其他人绑定,若要重新绑定,请先解绑"}'; } elseif (option::get('same_pid') == '1' && $checkSame['uid'] == UID) { echo '{"error":"-10","msg":"你已经绑定了这个百度账号,若要重新绑定,请先解绑"}'; } die; } } $m->query("INSERT INTO `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` (`uid`,`bduss`,`name`) VALUES (" . UID . ", '{$loginResult[1]}', '{$loginResult[2]}')"); echo '{"error":"0","msg":"获取BDUSS成功","bduss":"' . $loginResult[1] . '","name":"' . $loginResult[2] . '"}'; } else { echo '{"error":"' . $loginResult[0] . '","msg":"' . $loginResult[1] . '"}'; } break; case 'admin:c_update:check': global $i; $c = new wcurl(SUPPORT_URL . 'getplug.php?m=ver&pname=' . $_GET['plug']); $cloud = json_decode($c->exec(), true); $c->close(); if (empty($cloud['version'])) { die('未找到该产品信息'); } echo '最新版本:' . $cloud['version']; if ($cloud['version'] > $i['plugins']['desc'][$_GET['plug']]['plugin']['version']) { echo '//' . $i['plugins']['desc'][$_GET['plug']]['plugin']['name'] . ' - 发现新版本//最新版本:' . $cloud['version'] . '<br/>版本描述:' . $cloud['whatsnew'] . '<br/>' . '本次更新需要支付 ' . $cloud['updateXB'] . ' XB。<a href="setting.php?mod=admin:cloud&upd=' . $_GET['plug'] . '">立即更新</a>'; } break; default: msg('未定义操作'); break; }
doAction('set_save2'); Redirect('index.php?mod=set&ok'); break; case 'admin:testmail': global $i; $x = misc::mail($i['user']['email'], SYSTEM_FN . ' V' . SYSTEM_VER . ' - 邮件发送测试', '这是一封关于 ' . SYSTEM_FN . ' 的测试邮件,如果你收到了此邮件,表示邮件系统可以正常工作<br/><br/>站点地址:' . SYSTEM_URL, array('测试附件.txt' => '这是一个测试附件')); if ($x === true) { Redirect('index.php?mod=admin:set&mailtestok'); } else { msg('邮件发送失败,发件日志:<br/>' . $x); } break; case 'admin:testbbs': global $i; $ch_url = SUPPORT_URL . 'getplug.php?m=check&user='******'bbs_us') . '&pw=' . option::get('bbs_pw'); $c = new wcurl($ch_url); $x = $c->exec(); $c->close(); if ($x == 'RIGHT') { Redirect('index.php?mod=admin:set&bbstestok'); } else { if (empty($x)) { $x = '错误 - 与产品中心连接失败'; } msg('错误 - ' . $x); } break; } if (ROLE == 'admin' && $i['mode'][0] == 'plugin') { option::pset($i['mode'][1], $_POST); Redirect("index.php?mod=admin:setplug&plug={$i['mode'][1]}&ok");
<tr> <th style="width:20%">功能 / 举例</th> <th style="width:15%">需求</th> <th style="width:15%">当前</th> <th style="width:50%">用途</th> </tr> </thead> <tbody> <tr> <td>连接百度服务器</td> <td>必须</td> <td> <?php if (function_exists('curl_exec')) { require_once SYSTEM_ROOT . '/lib/class.wcurl.php'; $x = new wcurl('http://wappass.baidu.com/passport/', array('User-Agent: Phone' . mt_rand())); $result = $x->exec(); $result = strpos($result, '登录百度帐号'); if (!empty($result)) { echo '<font color="green">可用</font>'; } else { echo '<font color="red">无法连接到百度服务器。请询问您的主机商。</font>'; } } else { echo '<font color="red">请先联系您的主机商开启cURL功能。</font>'; } ?> </td> <td>执行签到等</td> </tr> </tbody>
$result = $m->query("SELECT `bduss`,`bdname` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo`"); $allrow = $result->num_rows; $die = 0; $onrow = 0; while ($onrow < $allrow) { $thresult = $m->fetch_array($result); $bduss = $thresult['bduss']; $bdid = getBaiduId($bduss); sleep($sleep); if (empty($bdid)) { $stname = $m->once_fetch_array("SELECT `stname` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo` WHERE `bduss`='{$bduss}'"); $stname = $stname['stname']; $sturl = $m->once_fetch_array("SELECT `sturl` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "fyy_massistant_url` WHERE `stname`='{$stname}'"); $sturl = $sturl['sturl']; $bdname = $thresult['bdname']; $post = new wcurl("{$sturl}?pub_plugin=fyy_assistant&del&key={$key}&bdname={$bdname}"); $a = $post->exec(); $die++; $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo` WHERE `bduss` = '{$bduss}'"); sleep($sleep); } $onrow++; } echo '</br><div class="alert alert-success">为您检测了' . "{$allrow}条绑定信息,其中有{$die}条失效,已经删除</div>"; } ?> <h3>删除用户</h3></br> 1.<font color="red">严禁</font>使用非本页提供的方式删除用户</br> 2.您可以先使用<a href="<?php echo SYSTEM_URL; ?>
$m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `id` = '{$pid}'"); $uid = $one['uid']; $t = $m->once_fetch_array("SELECT `t` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'"); if (empty($t)) { $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `bduss` = '{$bduss}'"); } else { $t = $t['t']; $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t . "` WHERE `pid` = '{$pid}'"); } } else { $bduss = $one['bduss']; $uid = $one['uid']; $info = $m->once_fetch_array("SELECT `name`,`email` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'"); $usname = $info['name']; $email = $info['email']; $post2 = new wcurl("{$murl}?pub_plugin=fyy_massistant&bind&key={$key}&stname=" . SYSTEM_NAME . "&usname={$usname}&bduss={$bduss}&bdname={$bdname}&email={$email}"); $a2 = $post2->exec(); sleep(0.015); if ($a2 == 'found') { /*重复绑定*/ $pid = $one['id']; $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `id` = '{$pid}'"); /* AND `bduss` = '{$bduss}'*/ $uid = $one['uid']; $t = $m->once_fetch_array("SELECT `t` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'"); if (empty($t)) { $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `bduss` = '{$bduss}'"); } else { $t = $t['t']; $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t . "` WHERE `pid` = '{$pid}'"); }
public static function getTieba($userid, $bduss, $pn) { $head = array(); $head[] = 'Content-Type: application/x-www-form-urlencoded'; $head[] = 'User-Agent: Mozilla/5.0 (SymbianOS/9.3; Series60/3.2 NokiaE72-1/021.021; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.1.16352'; $tl = new wcurl('http://c.tieba.baidu.com/c/f/forum/like', $head); $data = array('_client_id' => 'wappc_' . time() . '_' . '258', '_client_type' => 2, '_client_version' => '6.5.8', '_phone_imei' => '357143042411618', 'from' => 'baidu_appstore', 'is_guest' => 1, 'model' => 'H60-L01', 'page_no' => $pn, 'page_size' => 200, 'timestamp' => time() . '903', 'uid' => $userid); $sign_str = ''; foreach ($data as $k => $v) { $sign_str .= $k . '=' . $v; } $sign = strtoupper(md5($sign_str . 'tiebaclient!!!')); $data['sign'] = $sign; $tl->addCookie(array('BDUSS' => $bduss)); $tl->set(CURLOPT_RETURNTRANSFER, true); $rt = $tl->post($data); return $rt; }