• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP discuz_process类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中discuz_process的典型用法代码示例。如果您正苦于以下问题:PHP discuz_process类的具体用法?PHP discuz_process怎么用?PHP discuz_process使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了discuz_process类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 function run($cronid = 0)
 {
     global $_G;
     $timestamp = TIMESTAMP;
     $cron = DB::fetch_first("SELECT * FROM " . DB::table('common_cron') . "\n\t\t\t\tWHERE " . ($cronid ? "cronid='{$cronid}'" : "available>'0' AND nextrun<='{$timestamp}'") . "\n\t\t\t\tORDER BY nextrun LIMIT 1");
     $processname = 'DZ_CRON_' . (empty($cron) ? 'CHECKER' : $cron['cronid']);
     if ($cronid && !empty($cron)) {
         discuz_process::unlock($processname);
     }
     if (discuz_process::islocked($processname, 600)) {
         return false;
     }
     if ($cron) {
         $cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
         $cronfile = DISCUZ_ROOT . './source/include/cron/' . $cron['filename'];
         $cron['minute'] = explode("\t", $cron['minute']);
         discuz_cron::setnextime($cron);
         @set_time_limit(1000);
         @ignore_user_abort(TRUE);
         if (!@(include $cronfile)) {
             return false;
         }
     }
     discuz_cron::nextcron();
     discuz_process::unlock($processname);
     return true;
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:27,代码来源:class_cron.php


示例2: global_footer

    function global_footer()
    {
        global $_G;
        if (!$this->_secStatus) {
            return false;
        }
        $formhash = formhash();
        $ajaxReportScript = '';
        $processName = 'securitOperate';
        if ($this->isAdminGroup && !discuz_process::islocked($processName, 10)) {
            $ajaxReportScript = <<<EOF
\t\t\t<script type='text/javascript'>
\t\t\tvar url = SITEURL + '/plugin.php?id=security:sitemaster';
\t\t\tvar x = new Ajax();
\t\t\tx.post(url, 'formhash={$formhash}', function(s){});
\t\t\t</script>
EOF;
        }
        $processName = 'securitRetry';
        $time = 5;
        if ($_G['gp_d']) {
            $time = 1;
        }
        if (!discuz_process::islocked($processName, $time)) {
            $ajaxRetryScript = <<<EOF
\t\t\t<script type='text/javascript'>
\t\t\tvar urlRetry = SITEURL + '/plugin.php?id=security:job';
\t\t\tvar ajaxRetry = new Ajax();
\t\t\tajaxRetry.post(urlRetry, 'formhash={$formhash}', function(s){});
\t\t\t</script>
EOF;
        }
        return $ajaxReportScript . $ajaxRetryScript;
    }
开发者ID:v998,项目名称:discuzx-en,代码行数:34,代码来源:security.class.php


示例3: updatersscache

function updatersscache($num)
{
    global $_G;
    $processname = 'portal_rss_cache';
    if (discuz_process::islocked($processname, 600)) {
        return false;
    }
    DB::query("DELETE FROM " . DB::table('portal_rsscache') . "");
    require_once libfile('function/post');
    foreach ($_G['cache']['portalcategory'] as $catid => $catarray) {
        $query = DB::query("SELECT aid, username, author, dateline, title, summary\r\n\t\t\tFROM " . DB::table('portal_article_title') . "\r\n\t\t\tWHERE catid='{$catid}' AND status=0\r\n\t\t\tORDER BY aid DESC LIMIT {$num}");
        $catarray['catname'] = addslashes($catarray['catname']);
        while ($article = DB::fetch($query)) {
            $article['author'] = $article['author'] != '' ? addslashes($article['author']) : ($article['username'] ? addslashes($article['username']) : 'Anonymous');
            $article['title'] = addslashes($article['title']);
            $articleattach = DB::fetch_first("SELECT * FROM " . DB::table('portal_attachment') . " WHERE aid='" . $article['aid'] . "' AND isimage=1");
            $attachdata = '';
            if (!empty($articleattach)) {
                $attachdata = "\t" . $articleattach['remote'] . "\t" . $articleattach['attachment'] . "\t" . $articleattach['filesize'];
            }
            $article['description'] = addslashes(messagecutstr($article['summary'], 250 - strlen($attachdata)) . $attachdata);
            DB::query("REPLACE INTO " . DB::table('portal_rsscache') . " (lastupdate, catid, aid, dateline, catname, author, subject, description)\r\n\t\t\t\tVALUES ('{$_G['timestamp']}', '{$catid}', '{$article['aid']}', '{$article['dateline']}', '{$catarray['catname']}', '{$article['author']}', '{$article['title']}', '{$article['description']}')");
        }
    }
    discuz_process::unlock($processname);
    return true;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:27,代码来源:portal_rss.php


示例4: run

 public static function run($cronid = 0)
 {
     global $_G;
     $cron = $cronid ? C::t('common_cron')->fetch($cronid) : C::t('common_cron')->fetch_nextrun(TIMESTAMP);
     $processname = 'DZ_CRON_' . (empty($cron) ? 'CHECKER' : $cron['cronid']);
     if ($cronid && !empty($cron)) {
         discuz_process::unlock($processname);
     }
     if (discuz_process::islocked($processname, 600)) {
         return false;
     }
     if ($cron) {
         $cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
         $cronfile = DISCUZ_ROOT . './source/include/cron/' . $cron['filename'];
         $cron['minute'] = explode("\t", $cron['minute']);
         self::setnextime($cron);
         @set_time_limit(1000);
         @ignore_user_abort(TRUE);
         if (!@(include $cronfile)) {
             return false;
         }
     }
     self::nextcron();
     discuz_process::unlock($processname);
     return true;
 }
开发者ID:dalinhuang,项目名称:healthshop,代码行数:26,代码来源:discuz_cron.php


示例5: build_cache_heats

function build_cache_heats()
{
    global $_G;
    $addsql = '';
    $data = array();
    if (discuz_process::islocked('update_heats_list')) {
        return false;
    }
    if ($_G['setting']['indexhot']['status']) {
        require_once libfile('function/post');
        $_G['setting']['indexhot'] = array('status' => 1, 'limit' => intval($_G['setting']['indexhot']['limit'] ? $_G['setting']['indexhot']['limit'] : 10), 'days' => intval($_G['setting']['indexhot']['days'] ? $_G['setting']['indexhot']['days'] : 7), 'expiration' => intval($_G['setting']['indexhot']['expiration'] ? $_G['setting']['indexhot']['expiration'] : 900), 'messagecut' => intval($_G['setting']['indexhot']['messagecut'] ? $_G['setting']['indexhot']['messagecut'] : 200));
        $messageitems = 2;
        $limit = $_G['setting']['indexhot']['limit'];
        foreach (C::t('forum_thread')->fetch_all_heats() as $heat) {
            $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($heat['tid']);
            $heat = array_merge($heat, (array) $post);
            if ($limit == 0) {
                break;
            }
            if ($messageitems > 0) {
                $heat['message'] = !$heat['price'] ? messagecutstr($heat['message'], $_G['setting']['indexhot']['messagecut']) : '';
                $data['message'][$heat['tid']] = $heat;
            } else {
                unset($heat['message']);
                $data['subject'][$heat['tid']] = $heat;
            }
            $messageitems--;
            $limit--;
        }
        $data['expiration'] = TIMESTAMP + $_G['setting']['indexhot']['expiration'];
    }
    savecache('heats', $data);
    discuz_process::unlock('update_heats_list');
}
开发者ID:softhui,项目名称:discuz,代码行数:34,代码来源:cache_heats.php


示例6: global_footer

    public function global_footer()
    {
        global $_G, $_GET;
        if (self::$securityStatus != TRUE) {
            return false;
        }
        $formhash = formhash();
        if ($_G['adminid']) {
            $processName = 'securityOperate';
            if (self::$isAdminGroup && !discuz_process::islocked($processName, 30)) {
                $ajaxReportScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar url = SITEURL + '/plugin.php?id=security:sitemaster';
\t\t\t\t\tvar x = new Ajax();
\t\t\t\t\tx.post(url, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        $processName = 'securityRetry';
        $time = 10;
        if (!discuz_process::islocked($processName, $time)) {
            if (C::t('#security#security_failedlog')->count()) {
                $ajaxRetryScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar urlRetry = SITEURL + '/plugin.php?id=security:job';
\t\t\t\t\tvar ajaxRetry = new Ajax();
\t\t\t\t\tajaxRetry.post(urlRetry, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        return $ajaxReportScript . $ajaxRetryScript;
    }
开发者ID:softhui,项目名称:discuz,代码行数:34,代码来源:security.class.php


示例7: viewthread_updateviews

function viewthread_updateviews($tableid)
{
    global $_G;
    if (!$_G['setting']['preventrefresh'] || $_G['cookie']['viewid'] != 'tid_' . $_G['tid']) {
        if (!$tableid && $_G['setting']['optimizeviews']) {
            if ($_G['forum_thread']['addviews']) {
                if ($_G['forum_thread']['addviews'] < 100) {
                    C::t('forum_threadaddviews')->update_by_tid($_G['tid']);
                } else {
                    if (!discuz_process::islocked('update_thread_view')) {
                        $row = C::t('forum_threadaddviews')->fetch($_G['tid']);
                        C::t('forum_threadaddviews')->update($_G['tid'], array('addviews' => 0));
                        C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews'] + 1), true);
                        discuz_process::unlock('update_thread_view');
                    }
                }
            } else {
                C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => 1), false, true);
            }
        } else {
            C::t('forum_thread')->increase($_G['tid'], array('views' => 1), true, $tableid);
        }
    }
    dsetcookie('viewid', 'tid_' . $_G['tid']);
}
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:25,代码来源:forum_viewthread_x25.php


示例8: _cmd

 private static function _cmd($cmd, $name, $ttl = 0)
 {
     static $allowmem;
     if ($allowmem === null) {
         $mc = memory('check');
         $allowmem = $mc == 'memcache' || $mc == 'redis';
     }
     if ($allowmem) {
         return discuz_process::_process_cmd_memory($cmd, $name, $ttl);
     } else {
         return discuz_process::_process_cmd_db($cmd, $name, $ttl);
     }
 }
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:13,代码来源:discuz_process.php


示例9: run

 /**
  * 运行cron
  *
  * @param int $cronid 执行某个cron,如果不指定则运行当前需要运行的
  * @return true
  */
 public static function run($cronid = 0)
 {
     global $_G;
     $cron = $cronid ? C::t('common_cron')->fetch($cronid) : C::t('common_cron')->fetch_nextrun(TIMESTAMP);
     //取出一条符合执行条件的计划任务
     $processname = 'DZ_CRON_' . (empty($cron) ? 'CHECKER' : $cron['cronid']);
     if ($cronid && !empty($cron)) {
         discuz_process::unlock($processname);
         //为手动执行计划任务解锁
     }
     if (discuz_process::islocked($processname, 600)) {
         //检查计划任务进程是否上锁
         return false;
     }
     if ($cron) {
         //计划任务执行
         $cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
         $efile = explode(':', $cron['filename']);
         if (count($efile) > 1) {
             $cronfile = in_array($efile[0], $_G['setting']['plugins']['available']) ? DISCUZ_ROOT . './source/plugin/' . $efile[0] . '/cron/' . $efile[1] : '';
         } else {
             $cronfile = DISCUZ_ROOT . './source/include/cron/' . $cron['filename'];
         }
         if ($cronfile) {
             $cron['minute'] = explode("\t", $cron['minute']);
             self::setnextime($cron);
             //根据后台设置,更新该计划任务执行的时间
             @set_time_limit(1000);
             @ignore_user_abort(TRUE);
             //设置与客户机断开不会终止脚本的执行
             if (!@(include $cronfile)) {
                 //执行具体计划任务程序
                 return false;
             }
         }
     }
     self::nextcron();
     //设置最近一次计划任务执行的时间
     discuz_process::unlock($processname);
     //解锁
     return true;
 }
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:48,代码来源:discuz_cron.php


示例10: array

            if ($thread['lastpost'] < $_G['timestamp']) {
                $fieldarr['lastpost'] = array($_G['timestamp']);
            }
            C::t('forum_thread')->increase($tid, $fieldarr);
            $postionid = C::t('forum_post')->fetch_maxposition_by_tid($thread['posttableid'], $tid);
            C::t('forum_thread')->update($tid, array('maxposition' => $postionid));
            $lastpost = "{$thread['tid']}\t{$thread['subject']}\t{$_G['timestamp']}\t" . '';
            C::t('forum_forum')->update($thread['fid'], array('lastpost' => $lastpost));
            C::t('forum_forum')->update_forum_counter($thread['fid'], 0, count($pids), count($pids));
            if ($forum['type'] == 'sub') {
                C::t('forum_forum')->update($forum['fup'], array('lastpost' => $lastpost));
            }
        }
        //note 同时还要记录最后一条的id和时间
        $setarr['pagetime'] = $post['timestamp'];
        $setarr['lasttwid'] = $post['id'];
        //if(count($response['result']) < $param['req_num']) {
        if (count($responseinfo) < $param['reqnum']) {
            $setarr['nexttime'] = $_G['timestamp'] + 2 * 3600;
        } else {
            $setarr['nexttime'] = $_G['timestamp'] + 30 * 60;
        }
    } else {
        $setarr['nexttime'] = $_G['timestamp'] + 3 * 3600;
    }
    $setarr['updatetime'] = $_G['timestamp'];
    //DB::update('connect_tthreadlog', $setarr, array('twid' => $tthread['twid']));
    C::t('#qqconnect#connect_tthreadlog')->update($tthread['twid'], $setarr);
    discuz_process::unlock($processname);
    exit;
}
开发者ID:dalinhuang,项目名称:healthshop,代码行数:31,代码来源:spacecp.inc.php


示例11: _cmd

 function _cmd($cmd, $name, $ttl = 0)
 {
     static $allowmem;
     if ($allowmem === null) {
         $allowmem = memory('check') == 'memcache';
     }
     if ($allowmem) {
         return discuz_process::_process_cmd_memory($cmd, $name, $ttl);
     } else {
         return discuz_process::_process_cmd_db($cmd, $name, $ttl);
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:12,代码来源:class_core.php


示例12: block_updatecache

function block_updatecache($bid, $forceupdate = false)
{
    global $_G;
    if (isset($_G['block'][$bid]['cachetime']) && $_G['block'][$bid]['cachetime'] < 0 || !$forceupdate && discuz_process::islocked('block_update_cache', 5)) {
        return false;
    }
    C::t('common_block')->clear_cache($bid);
    $block = empty($_G['block'][$bid]) ? array() : $_G['block'][$bid];
    if (!$block) {
        return false;
    }
    $obj = block_script($block['blockclass'], $block['script']);
    if (is_object($obj)) {
        C::t('common_block')->update($bid, array('dateline' => TIMESTAMP));
        $_G['block'][$bid]['dateline'] = TIMESTAMP;
        $theclass = block_getclass($block['blockclass']);
        $thestyle = !empty($block['styleid']) ? block_getstyle($block['styleid']) : dunserialize($block['blockstyle']);
        if (in_array($block['blockclass'], array('forum_thread', 'group_thread', 'space_blog', 'space_pic', 'portal_article'))) {
            $datalist = array();
            $mapping = array('forum_thread' => 'tid', 'group_thread' => 'tid', 'space_blog' => 'blogid', 'space_blog' => 'picid', 'portal_article' => 'aid');
            $idtype = $mapping[$block['blockclass']];
            $bannedids = !empty($block['param']['bannedids']) ? explode(',', $block['param']['bannedids']) : array();
            $bannedsql = $bannedids ? ' AND id NOT IN (' . dimplode($bannedids) . ')' : '';
            $shownum = intval($block['shownum']);
            $titlelength = !empty($block['param']['titlelength']) ? intval($block['param']['titlelength']) : 40;
            $summarylength = !empty($block['param']['summarylength']) ? intval($block['param']['summarylength']) : 80;
            foreach (C::t('common_block_item_data')->fetch_all_by_bid($bid, 1, 0, $shownum * 2, $bannedids, false) as $value) {
                $value['title'] = cutstr($value['title'], $titlelength, '');
                $value['summary'] = cutstr($value['summary'], $summarylength, '');
                $value['itemtype'] = '3';
                $datalist[] = $value;
                $bannedids[] = intval($value['id']);
            }
            $leftnum = $block['shownum'] - count($datalist);
            if ($leftnum > 0 && empty($block['isblank'])) {
                if ($leftnum != $block['param']['items']) {
                    $block['param']['items'] = $leftnum;
                    $block['param']['bannedids'] = implode(',', $bannedids);
                }
                $return = $obj->getdata($thestyle, $block['param']);
                $return['data'] = array_merge($datalist, (array) $return['data']);
            } else {
                $return['data'] = $datalist;
            }
        } else {
            $return = $obj->getdata($thestyle, $block['param']);
        }
        if ($return['data'] === null) {
            $_G['block'][$block['bid']]['summary'] = $return['html'];
            C::t('common_block')->update($bid, array('summary' => $return['html']));
        } else {
            $_G['block'][$block['bid']]['itemlist'] = block_updateitem($bid, $return['data']);
        }
    } else {
        C::t('common_block')->update($bid, array('dateline' => TIMESTAMP + 999999, 'cachetime' => 0));
        $_G['block'][$bid]['dateline'] = TIMESTAMP + 999999;
    }
    if (C::t('common_block')->allowmem) {
        memory('set', 'blockcache_' . $bid, $_G['block'][$bid], C::t('common_block')->cache_ttl);
        $styleid = $_G['block'][$bid]['styleid'];
        if ($styleid && $_G['blockstyle_' . $styleid]) {
            memory('set', 'blockstylecache_' . $styleid, $_G['blockstyle_' . $styleid], C::t('common_block')->cache_ttl);
        }
    }
    discuz_process::unlock('block_update_cache');
}
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:66,代码来源:function_block.php


示例13: block_updatecache

function block_updatecache($bid, $forceupdate = false)
{
    global $_G;
    if (!$forceupdate && discuz_process::islocked('block_update_cache', 5)) {
        return false;
    }
    block_memory_clear($bid);
    $block = empty($_G['block'][$bid]) ? array() : $_G['block'][$bid];
    if (!$block) {
        return;
    }
    $obj = block_script($block['script']);
    if ($obj) {
        DB::update('common_block', array('dateline' => TIMESTAMP), array('bid' => $bid));
        $block['param'] = empty($block['param']) ? array() : unserialize($block['param']);
        $theclass = block_getclass($block['blockclass']);
        if ($block['blockclass'] == 'portal_article') {
            $parameter = array('aids' => array());
            $query = DB::query('SELECT aid FROM ' . DB::table('portal_article_title') . " WHERE bid='{$bid}'");
            while ($value = DB::fetch($query)) {
                $parameter['aids'][] = intval($value['aid']);
            }
            $datalist = array();
            if (!empty($parameter['aids'])) {
                $bannedids = !empty($block['param']['bannedids']) ? explode(',', $block['param']['bannedids']) : array();
                if (!empty($bannedids)) {
                    $parameter['aids'] = array_diff($parameter['aids'], $bannedids);
                }
                $bannedids = array_merge($bannedids, $parameter['aids']);
                $block['param']['bannedids'] = implode(',', $bannedids);
                $parameter['aids'] = implode(',', $parameter['aids']);
                $return = $obj->getdata($theclass['style'][$block['styleid']], $parameter);
                $datalist = $return['data'];
            }
            $return = $obj->getdata($theclass['style'][$block['styleid']], $block['param']);
            if ($datalist) {
                $return['data'] = array_merge($datalist, $return['data']);
            }
        } else {
            $return = $obj->getdata($theclass['style'][$block['styleid']], $block['param']);
        }
        if ($return['data'] === null) {
            $_G['block'][$block['bid']]['summary'] = $return['html'];
            DB::update('common_block', array('summary' => daddslashes($return['html'])), array('bid' => $bid));
        } else {
            $_G['block'][$block['bid']]['itemlist'] = block_updateitem($bid, $return['data']);
        }
    } else {
        DB::update('common_block', array('dateline' => TIMESTAMP + 999999, 'cachetime' => 0), array('bid' => $bid));
    }
    discuz_process::unlock('block_update_cache');
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:52,代码来源:function_block.php


示例14: updatersscache

function updatersscache($num)
{
    global $_G;
    $processname = 'portal_rss_cache';
    if (discuz_process::islocked($processname, 600)) {
        return false;
    }
    C::t('portal_rsscache')->truncate();
    require_once libfile('function/post');
    foreach ($_G['cache']['portalcategory'] as $catid => $catarray) {
        $query = C::t('portal_article_title')->fetch_all_for_cat($catid, 0, 1, 0, $num);
        $catarray['catname'] = addslashes($catarray['catname']);
        foreach ($query as $article) {
            $article['author'] = $article['author'] != '' ? addslashes($article['author']) : ($article['username'] ? addslashes($article['username']) : 'Anonymous');
            $article['title'] = addslashes($article['title']);
            $articleattach = C::t('portal_attachment')->fetch_by_aid_image($article['aid']);
            $attachdata = '';
            if (!empty($articleattach)) {
                $attachdata = "\t" . $articleattach['remote'] . "\t" . $articleattach['attachment'] . "\t" . $articleattach['filesize'];
            }
            $article['description'] = addslashes(messagecutstr($article['summary'], 250 - strlen($attachdata)) . $attachdata);
            C::t('portal_rsscache')->insert(array('lastupdate' => $_G['timestamp'], 'catid' => $catid, 'aid' => $article['aid'], 'dateline' => $article['dateline'], 'catname' => $catarray['catname'], 'author' => $article['author'], 'subject' => $article['title'], 'description' => $article['description']));
        }
    }
    discuz_process::unlock($processname);
    return true;
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:portal_rss.php


示例15: getqrcode

 public static function getqrcode()
 {
     global $_G;
     if (!$_G['wechat']['setting']) {
         $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
     }
     require_once DISCUZ_ROOT . './source/plugin/wechat/wechat.lib.class.php';
     $wechat_client = new WeChatClient($_G['wechat']['setting']['wechat_appId'], $_G['wechat']['setting']['wechat_appsecret']);
     $ticket = '';
     if (!$_G['cookie']['wechat_ticket'] || $_G['wechat']['setting']['wechat_mtype'] == 1) {
         $code = 0;
         $i = 0;
         do {
             $code = rand(100000, 999999);
             $codeexists = C::t('#wechat#mobile_wechat_authcode')->fetch_by_code($code);
             $i++;
         } while ($codeexists && $i < 10);
         if ($_G['wechat']['setting']['wechat_mtype'] == 2) {
             $option = array('scene_id' => $code, 'expire' => self::$QRCODE_EXPIRE, 'ticketOnly' => '1');
             $ticket = $wechat_client->getQrcodeTicket($option);
             if (!$ticket) {
                 showmessage('wechat:wechat_message_codefull');
             }
             dsetcookie('wechat_ticket', authcode($ticket . "\t" . $code, 'ENCODE'), self::$QRCODE_EXPIRE);
         }
     } else {
         list($ticket, $code) = explode("\t", authcode($_G['cookie']['wechat_ticket'], 'DECODE'));
     }
     $isqrapi = $ticket ? $ticket : '';
     if ($codeexists) {
         showmessage('wechat:wechat_message_codefull');
     }
     $qrcodeurl = !$isqrapi ? $_G['setting']['attachurl'] . 'common/' . $_G['wechat']['setting']['wechat_qrcode'] : $_G['siteurl'] . 'plugin.php?id=wechat:qrcode&rand=' . random(5);
     $codeenc = urlencode(base64_encode(authcode($code, 'ENCODE', $_G['config']['security']['authkey'])));
     C::t('#wechat#mobile_wechat_authcode')->insert(array('sid' => $_G['cookie']['saltkey'], 'uid' => $_G['uid'], 'code' => $code, 'createtime' => TIMESTAMP), 0, 1);
     if (!discuz_process::islocked('clear_wechat_authcode')) {
         C::t('#wechat#mobile_wechat_authcode')->delete_history();
         discuz_process::unlock('clear_wechat_authcode');
     }
     return array($isqrapi, $qrcodeurl, $codeenc, $code);
 }
开发者ID:deepziyu,项目名称:JX3PVE,代码行数:41,代码来源:wechat.class.php


示例16: checkflood

function checkflood()
{
    global $_G;
    if (!$_G['group']['disablepostctrl'] && $_G['uid']) {
        if ($_G['setting']['floodctrl'] && discuz_process::islocked("post_lock_" . $_G['uid'], $_G['setting']['floodctrl'])) {
            return true;
        }
        return false;
    }
    return FALSE;
}
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:11,代码来源:function_post.php


示例17: getranklistdata

function getranklistdata($type, $view = '', $orderby = 'all')
{
    global $_G;
    $cache_time = $_G['setting']['ranklist'][$type]['cache_time'];
    $cache_num = $_G['setting']['ranklist'][$type]['show_num'];
    if ($cache_time <= 0) {
        $cache_time = 5;
    }
    $cache_time = $cache_time * 3600;
    if ($cache_num <= 0) {
        $cache_num = 20;
    }
    $ranklistvars = array();
    loadcache('ranklist_' . $type);
    $ranklistvars =& $_G['cache']['ranklist_' . $type][$view][$orderby];
    if (empty($ranklistvars['lastupdated']) || TIMESTAMP - $ranklistvars['lastupdated'] > $cache_time) {
        $functionname = 'getranklist_' . $type;
        if (!discuz_process::islocked('ranklist_update', 600)) {
            $ranklistvars = $functionname($cache_num, $view, $orderby);
            $ranklistvars['lastupdated'] = TIMESTAMP;
            $ranklistvars['lastupdate'] = dgmdate(TIMESTAMP);
            $ranklistvars['nextupdate'] = dgmdate(TIMESTAMP + $cache_time);
            $_G['cache']['ranklist_' . $type][$view][$orderby] = $ranklistvars;
            save_syscache('ranklist_' . $type, $_G['cache']['ranklist_' . $type]);
        }
        discuz_process::unlock('ranklist_update');
    }
    $_G['lastupdate'] = $ranklistvars['lastupdate'];
    $_G['nextupdate'] = $ranklistvars['nextupdate'];
    unset($ranklistvars['lastupdated'], $ranklistvars['lastupdate'], $ranklistvars['nextupdate']);
    return $ranklistvars;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:32,代码来源:misc_ranklist.php


示例18: update_guide_rsscache

function update_guide_rsscache($type, $perpage)
{
    global $_G;
    $processname = 'guide_rss_cache';
    if (discuz_process::islocked($processname, 600)) {
        return false;
    }
    C::t('forum_rsscache')->delete_by_guidetype($type);
    require_once libfile('function/post');
    $data = get_guide_list($type, 0, $perpage);
    foreach ($data['threadlist'] as $thread) {
        $thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous';
        $thread['subject'] = addslashes($thread['subject']);
        $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
        $attachdata = '';
        if ($post['attachment'] == 2) {
            $attach = C::t('forum_attachment_n')->fetch_max_image('tid:' . $thread['tid'], 'pid', $post['pid']);
            $attachdata = "\t" . $attach['remote'] . "\t" . $attach['attachment'] . "\t" . $attach['filesize'];
        }
        $thread['message'] = $post['message'];
        $thread['status'] = $post['status'];
        $thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(messagecutstr($thread['message'], 250 - strlen($attachdata)) . $attachdata);
        C::t('forum_rsscache')->insert(array('lastupdate' => $_G['timestamp'], 'fid' => $thread['fid'], 'tid' => $thread['tid'], 'dateline' => $thread['dbdateline'], 'forum' => strip_tags($data['forumnames'][$thread[fid]]['name']), 'author' => $thread['author'], 'subject' => $thread['subject'], 'description' => $thread['description'], 'guidetype' => $type), false, true);
    }
    discuz_process::unlock($processname);
    return true;
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:forum_guide.php


示例19: updatersscache

function updatersscache($num)
{
    global $_G;
    $processname = 'forum_rss_cache';
    if (discuz_process::islocked($processname, 600)) {
        return false;
    }
    DB::query("DELETE FROM " . DB::table('forum_rsscache') . "");
    require_once libfile('function/post');
    foreach ($_G['cache']['forums'] as $fid => $forum) {
        if ($forum['type'] != 'group') {
            $query = DB::query("SELECT tid, readperm, author, dateline, subject\n\t\t\t\tFROM " . DB::table('forum_thread') . "\n\t\t\t\tWHERE fid='{$fid}' AND displayorder>='0'\n\t\t\t\tORDER BY tid DESC LIMIT {$num}");
            $forum['name'] = addslashes($forum['name']);
            while ($thread = DB::fetch($query)) {
                $thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous';
                $thread['subject'] = addslashes($thread['subject']);
                $posttable = getposttablebytid($thread['tid']);
                $post = DB::fetch_first("SELECT pid, attachment, message, status FROM " . DB::table($posttable) . " WHERE tid='{$thread['tid']}' AND first='1'");
                $attachdata = '';
                if ($post['attachment'] == 2) {
                    $attach = DB::fetch_first("SELECT remote, attachment, filesize FROM " . DB::table(getattachtablebytid($thread['tid'])) . " WHERE pid='{$post['pid']}' AND isimage='1' ORDER BY dateline LIMIT 1");
                    $attachdata = "\t" . $attach['remote'] . "\t" . $attach['attachment'] . "\t" . $attach['filesize'];
                }
                $thread['message'] = $post['message'];
                $thread['status'] = $post['status'];
                $thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(messagecutstr($thread['message'], 250 - strlen($attachdata)) . $attachdata);
                DB::query("REPLACE INTO " . DB::table('forum_rsscache') . " (lastupdate, fid, tid, dateline, forum, author, subject, description)\n\t\t\t\t\tVALUES ('{$_G['timestamp']}', '{$fid}', '{$thread['tid']}', '{$thread['dateline']}', '{$forum['name']}', '{$thread['author']}', '{$thread['subject']}', '{$thread['description']}')");
            }
        }
    }
    discuz_process::unlock($processname);
    return true;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:33,代码来源:forum_rss.php


示例20: global_footer

    public function global_footer()
    {
        global $_G, $_GET;
        if (self::$securityStatus != TRUE) {
            return false;
        }
        $formhash = formhash();
        if ($_G['adminid']) {
            $processName = 'securityOperate';
            if (self::$isAdminGroup && !discuz_process::islocked($processName, 30)) {
                $ajaxReportScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar url = SITEURL + '/plugin.php?id=security:sitemaster';
\t\t\t\t\tvar x = new Ajax();
\t\t\t\t\tx.post(url, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        $processName = 'securityRetry';
        $time = 10;
        if (!discuz_process::islocked($processName, $time)) {
            if (C::t('#security#security_failedlog')->count()) {
                $ajaxRetryScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar urlRetry = SITEURL + '/plugin.php?id=security:job';
\t\t\t\t\tvar ajaxRetry = new Ajax();
\t\t\t\t\tajaxRetry.post(urlRetry, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        if ($_G['setting']['connect']['allow'] && !$_G['uid'] && $_G['setting']['security_qqlogin_alone']) {
            $loginboxdisappear = <<<EOF
\t\t\t\t<script type="text/javascript">
\t\t\t\tif(\$('lsform')) {
\t\t\t\t\tvar divs = \$('lsform').getElementsByTagName('div');
\t\t\t\t\tfor(i in divs) {
\t\t\t\t\t\tif(divs[i] && divs[i].className == 'y pns') {
\t\t\t\t\t\t\tdivs[i].style.display = 'none';
\t\t\t\t\t\t}
\t\t\t\t\t\tif(divs[i] && divs[i].className == 'fastlg_fm y') {
\t\t\t\t\t\t\tdivs[i].style.borderWidth = '0px';
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t</script>
EOF;
            if (!(CURMODULE == 'connect' && $_G['connectguest'])) {
                $_G['connect']['referer'] = !$_G['inajax'] && CURSCRIPT != 'member' ? $_G['basefilename'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '') : dreferer();
                $_G['connect']['login_url'] = $_G['siteurl'] . 'connect.php?mod=login&op=init&referer=' . urlencode($_G['connect']['referer'] ? $_G['connect']['referer'] : 'index.php');
                $loginstr = '<div class="rfm bw0"><table><tr><th>' . lang('plugin/security', 'quicklogin') . ': </th><td><a href="' . $_G['connect']['login_url'] . '&statfrom=login" target="_top" rel="nofollow"><img src="' . IMGDIR . '/qq_login.gif" class="vm" /></a></td></tr></table></div>';
                $loginboxdisappear .= <<<EOF
\t\t\t\t<script type="text/javascript">
\t\t\t\tvar loginform = document.getElementsByTagName('form');
\t\t\t\tif(loginform) {
\t\t\t\t\tfor(i in loginform) {
\t\t\t\t\t\tif(loginform[i].id && loginform[i].id.substr(0, 11) == 'loginform_L') {
\t\t\t\t\t\t\tloginform[i].innerHTML = '{$loginstr}';
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t</script>
EOF;
            }
        }
        if ($_G['setting']['connect']['allow'] && $_G['uid'] && $_G['setting']['security_safelogin'] && !$_G['member']['conisbind'] && CURMODULE != 'post' && getcookie('safelogintips')) {
            $msg = '<p>' . lang('plugin/security', 'safelogintips') . '</p><p class="mtm"><a href="connect.php?mod=config" target="_blank"><img src="' . IMGDIR . '/qq_bind_small.gif" class="qq_bind" align="absmiddle" /></a></p>';
            $safelogintips = <<<EOF
\t\t\t\t<script type="text/javascript">
\t\t\t\thideWindow('safelogintips');
\t\t\t\tshowDialog('{$msg}', 'notice', null, '(function() { window.location.href="connect.php?mod=config"; })();', 0, null, null, null, null, null, null);
\t\t\t\t</script>
EOF;
            dsetcookie('safelogintips');
        }
        return $ajaxReportScript . $ajaxRetryScript . $loginboxdisappear . $safelogintips;
    }
开发者ID:wait121000,项目名称:discuz3.0forsae,代码行数:78,代码来源:security.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP discuz_table类代码示例发布时间:2022-05-23
下一篇:
PHP discuz_core类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap