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


PHP misc::getFid方法代码示例

本文整理汇总了PHP中misc::getFid方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::getFid方法的具体用法?PHP misc::getFid怎么用?PHP misc::getFid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在misc的用法示例。


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