當前位置: 首頁>>代碼示例>>PHP>>正文


PHP misc::getCookie方法代碼示例

本文整理匯總了PHP中misc::getCookie方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::getCookie方法的具體用法?PHP misc::getCookie怎麽用?PHP misc::getCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc的用法示例。


在下文中一共展示了misc::getCookie方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: cron_wmzz_ban

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']}'");
        }
    }
}
開發者ID:chajianku,項目名稱:wmzz_ban,代碼行數:20,代碼來源:wmzz_ban_cron.php

示例2: DoSign_All

 /**
  * 對一個貼吧執行完整的簽到任務
  */
 public static function DoSign_All($uid, $kw, $id, $table, $sign_mode, $pid, $fid)
 {
     global $m;
     $again_error_id = 160002;
     //重複簽到錯誤代碼
     $again_error_id_2 = 1101;
     //特殊的重複簽到錯誤代碼!!!簽到過快=已簽到
     $again_error_id_3 = 1102;
     //特殊的重複簽到錯誤代碼!!!簽到過快=已簽到
     $status_succ = false;
     $ck = misc::getCookie($pid);
     $kw = addslashes($kw);
     $today = date('d');
     if (empty($fid)) {
         $fid = misc::getFid($kw);
         $m->query("UPDATE  `" . DB_PREFIX . $table . "` SET  `fid` =  '{$fid}' WHERE  `" . DB_PREFIX . $table . "`.`id` = '{$id}';", true);
     }
     //dump(json_decode(self::DoSign_Client($uid,$kw,$id,$pid,$fid,$ck),true),true);die;
     if (!empty($sign_mode) && in_array('1', $sign_mode) && $status_succ === false) {
         $r = self::DoSign_Client($uid, $kw, $id, $pid, $fid, $ck);
         $v = json_decode($r, true);
         if ($v != $r && $v != NULL) {
             //decode失敗時會直接返回原文或NULL
             if (empty($v['error_code']) || $v['error_code'] == $again_error_id) {
                 $status_succ = true;
             } else {
                 $error_code = $v['error_code'];
                 $error_msg = $v['error_msg'];
             }
         }
     }
     if (!empty($sign_mode) && in_array('3', $sign_mode) && $status_succ === false) {
         $r = self::DoSign_Mobile($uid, $kw, $id, $pid, $fid, $ck);
         $v = json_decode($r, true);
         if ($v != $r && $v != NULL) {
             //decode失敗時會直接返回原文或NULL
             if (empty($v['no']) || $v['no'] == $again_error_id_2 || $v['no'] == $again_error_id_3) {
                 $status_succ = true;
             } else {
                 $error_code = $v['no'];
                 $error_msg = $v['error'];
             }
         }
     }
     if (!empty($sign_mode) && in_array('2', $sign_mode) && $status_succ === false) {
         if (self::DoSign_Default($uid, $kw, $id, $pid, $fid, $ck) === true) {
             $status_succ = true;
         }
     }
     if ($status_succ === true) {
         $m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` SET  `latest` =  '" . $today . "',`status` =  '0',`last_error` = NULL WHERE `" . DB_PREFIX . $table . "`.`id` = '{$id}'", true);
     } else {
         $m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` SET  `latest` =  '" . $today . "',`status` =  '" . $error_code . "',`last_error` = '" . $error_msg . "' WHERE `" . DB_PREFIX . $table . "`.`id` = '{$id}'", true);
     }
     usleep(option::get('sign_sleep') * 1000);
 }
開發者ID:xiashali,項目名稱:Tieba-Cloud-Sign-OpenShift-QuickStart,代碼行數:59,代碼來源:class.misc.php


注:本文中的misc::getCookie方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。