当前位置: 首页>>代码示例>>PHP>>正文


PHP misc::GetCookie方法代码示例

本文整理汇总了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' => '');
    }
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:29,代码来源:verifyTiezi_cron.php

示例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']);
    }
    */
}
开发者ID:chajianku,项目名称:Cloud_Click,代码行数:43,代码来源:run.php


注:本文中的misc::GetCookie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。