本文整理汇总了PHP中misc::GetCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::GetCookie方法的具体用法?PHP misc::GetCookie怎么用?PHP misc::GetCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::GetCookie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifyTiezi_send
function verifyTiezi_send($uid, $tid, $pid, $water = 'StusGame Tieba Cloud Sign Plugin "verifyTiezi"', $device = 4)
{
if (empty($uid) || empty($tid) || empty($pid)) {
return array('status' => '1', 'msg' => '');
}
$ck = misc::GetCookie($pid);
$xs = verifyTiezi_gettie($tid, $ck);
$x = array('BDUSS' => $ck, '_client_id' => 'wappc_136' . rand_int(10) . '_' . rand_int(3), '_client_type' => $device, '_client_version' => '5.0.0', '_phone_imei' => md5(rand_int(16)), 'anonymous' => '0', 'content' => $water, 'fid' => $xs['fid'], 'kw' => $xs['word'], 'net_type' => '3', 'tbs' => $xs['tbs'], 'tid' => $tid, 'title' => '');
$y = '';
foreach ($x as $key => $value) {
$y .= $key . '=' . $value;
}
$x['sign'] = strtoupper(md5($y . 'tiebaclient!!!'));
$c = new wcurl('http://c.tieba.baidu.com/c/c/post/add', array('Content-Type: application/x-www-form-urlencoded'));
/* //Note:普通的
$x = verifyTiezi_gettie($tid,$ck);
$c = new wcurl('http://tieba.baidu.com'.$x['__formurl']);
unset($x['__formurl']);
$x['co'] = $water;
*/
$c->addcookie('BDUSS=' . $ck);
$return = json_decode($c->post($x), true);
$c->close();
if (!empty($return['error_code']) && $return['error_code'] != '1') {
return array('status' => $return['error_code'], 'msg' => $return['error_msg']);
} else {
return array('status' => '1', 'msg' => '');
}
}
示例2: cron_wmzz_zan
function cron_wmzz_zan()
{
require_once SYSTEM_ROOT . '/plugins/Cloud_Click/zan.php';
$set = unserialize(option::get('plugin_Cloud_Click'));
$today = date('Y-m-d');
global $m;
//准备:扫描wmzz_zan表中lastdo不是今天的,然后更新wmzz_zan_data表的remain
$sy = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_zan` WHERE `lastdo` != '{$today}';");
while ($sx = $m->fetch_array($sy)) {
$m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $sx['num'] . '\' WHERE `uid` = ' . $sx['uid']);
$m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan` SET `lastdo` = \'' . $today . '\' WHERE `uid` = ' . $sx['uid']);
}
//开始:计划任务
$count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "wmzz_zan_data` WHERE `remain` > '0' LIMIT {$set['rem']};");
if ($count['c'] == $set['rem']) {
$y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $set['rem'], "`remain` > '0'");
} else {
$y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $count['c'], "`remain` > '0'");
}
//如果只有一条记录的兼容方案
if (isset($y['tieba'])) {
$y = array(0 => $y);
}
//点赞
foreach ($y as $x) {
if (!empty($x['pid'])) {
$remain = $x['remain'] - $set['num'];
$res = wmzz_zan_donow(misc::GetCookie($x['pid']), $x['tieba'], $set['num']);
$m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $remain . '\' WHERE `tieba` = \'' . $x['tieba'] . '\' AND `uid` = ' . $x['uid']);
sleep($set['sleep']);
}
}
/*
while ($v = $m->fetch_array($x)) {
$u = $m->once_fetch_array("SELECT * FROM `".DB_NAME."`.`".DB_PREFIX."users` WHERE `id` = '{$v['uid']}' LIMIT 1");
$variable = unserialize($v['tieba']);
foreach ($variable as $value) {
wmzz_zan_get_list($u['ck_bduss'],$value['tieba'],$s['sleep'],$v['max'],$s['sp']);
}
$m->query("UPDATE `".DB_NAME."`.`".DB_PREFIX."wmzz_zan` SET `lastdo` = '".$today."' WHERE `id` = ".$v['id']);
}
*/
}