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


PHP dbstuff::fetch_first方法代码示例

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


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

示例1: intval

require_once DISCUZ_ROOT . './forumdata/cache/cache_forums.php';
require_once DISCUZ_ROOT . './forumdata/cache/style_' . intval($_DCACHE['settings']['styleid']) . '.php';
if (!$_DCACHE['settings']['rssstatus']) {
    exit('RSS Disabled');
}
$ttl = $_DCACHE['settings']['rssttl'] ? $_DCACHE['settings']['rssttl'] : 30;
$num = 20;
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$groupid = 7;
$discuz_uid = 0;
$discuz_user = $discuz_pw = $discuz_secques = '';
if (!empty($_GET['auth'])) {
    list($uid, $fid, $auth) = explode("\t", authcode($_GET['auth'], 'DECODE', md5($_DCACHE['settings']['authkey'])));
    $member = $db->fetch_first("SELECT uid AS discuz_uid, username AS discuz_user, password AS discuz_pw, secques AS discuz_secques, groupid\r\n\t\tFROM {$tablepre}members WHERE uid='" . intval($uid) . "'");
    if ($member) {
        if ($auth == substr(md5($member['discuz_pw'] . $member['discuz_secques']), 0, 8)) {
            extract($member);
        }
    }
}
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$boardurl = 'http://' . $_SERVER['HTTP_HOST'] . substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1);
$bbname = dhtmlspecialchars(strip_tags($_DCACHE['settings']['bbname']));
$rssfid = empty($_GET['fid']) ? 0 : intval($_GET['fid']);
$forumname = '';
if (empty($rssfid)) {
    foreach ($_DCACHE['forums'] as $fid => $forum) {
        if (rssforumperm($forum)) {
            $fidarray[] = $fid;
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:rss.php

示例2: clearcookies

$prompt = $sessionexists = $seccode = 0;
$membertablefields = 'm.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques,
	m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.email, m.timeoffset, m.tpp, m.ppp, m.posts, m.digestposts,
	m.oltime, m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5,
	m.extcredits6, m.extcredits7, m.extcredits8, m.timeformat, m.dateformat, m.pmsound, m.sigstatus, m.invisible,
	m.lastvisit, m.lastactivity, m.lastpost, m.prompt, m.accessmasks, m.editormode, m.customshow, m.customaddfeed';
if ($sid) {
    if ($discuz_uid) {
        $query = $db->query("SELECT s.sid, s.styleid, s.groupid='6' AS ipbanned, s.pageviews AS spageviews, s.lastolupdate, s.seccode, {$membertablefields}\r\n\t\t\tFROM {$tablepre}sessions s, {$tablepre}members m\r\n\t\t\tWHERE m.uid=s.uid AND s.sid='{$sid}' AND CONCAT_WS('.',s.ip1,s.ip2,s.ip3,s.ip4)='{$onlineip}' AND m.uid='{$discuz_uid}'\r\n\t\t\tAND m.password='{$discuz_pw}' AND m.secques='{$discuz_secques}'");
    } else {
        $query = $db->query("SELECT sid, uid AS sessionuid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode\r\n\t\t\tFROM {$tablepre}sessions WHERE sid='{$sid}' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='{$onlineip}'");
    }
    if ($_DSESSION = $db->fetch_array($query)) {
        $sessionexists = 1;
        if (!empty($_DSESSION['sessionuid'])) {
            $_DSESSION = array_merge($_DSESSION, $db->fetch_first("SELECT {$membertablefields}\r\n\t\t\t\tFROM {$tablepre}members m WHERE uid='{$_DSESSION['sessionuid']}'"));
        }
    } else {
        if ($_DSESSION = $db->fetch_first("SELECT sid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode\r\n\t\t\tFROM {$tablepre}sessions WHERE sid='{$sid}' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='{$onlineip}'")) {
            clearcookies();
            $sessionexists = 1;
        }
    }
}
if (!$sessionexists) {
    if ($discuz_uid) {
        if (!($_DSESSION = $db->fetch_first("SELECT {$membertablefields}, m.styleid\r\n\t\t\tFROM {$tablepre}members m WHERE m.uid='{$discuz_uid}' AND m.password='{$discuz_pw}' AND m.secques='{$discuz_secques}'"))) {
            clearcookies();
        }
    }
    if (ipbanned($onlineip)) {
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:common.inc.php

示例3: foreach

            foreach ($response[0]['ads'][0]['ad'] as $k => $v) {
                $type = intval($v['typeid'][0]['VALUE']);
                $target = intval($v['target'][0]['VALUE']);
                $code = insenz_convert($v['code'][0]['VALUE'], 0);
                $db->query("INSERT INTO {$tablepre}advcaches (type, target, code) VALUES ('" . $typearray[$type] . "', '{$target}', '{$code}')");
            }
        }
    }
    $insenz['lastupdated'] = $timestamp;
    $insenz['hash'] = $hash;
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('insenz', '" . addslashes(serialize($insenz)) . "')");
    require_once DISCUZ_ROOT . './include/global.func.php';
    require_once DISCUZ_ROOT . './include/cache.func.php';
    updatecache($updateadvcache ? array('settings', 'advs_forumdisplay', 'advs_viewthread') : 'settings');
} elseif ($type == 4 && $cid) {
    $campaign = $db->fetch_first("SELECT autoupdate, lastupdated FROM {$tablepre}campaigns WHERE id='{$cid}' AND type=4");
    if (!$campaign || !$campaign['autoupdate'] || $timestamp - $campaign['lastupdated'] < 600) {
        exit;
    }
    $response = insenz_request('forum.php', '<cmd id="getForumDetails"><c_id>' . $cid . '</c_id></cmd>');
    $threads = intval($response[0]['threads'][0]['VALUE']);
    $posts = intval($response[0]['posts'][0]['VALUE']);
    $lastpost = insenz_convert($response[0]['lastpost'][0]['VALUE'], 0);
    $db->query("UPDATE {$tablepre}virtualforums SET threads='{$threads}', posts='{$posts}', lastpost='{$lastpost}' WHERE cid='{$cid}'");
    $db->query("UPDATE {$tablepre}campaigns SET lastupdated='{$timestamp}' WHERE id='{$cid}'");
} elseif (in_array($type, array(1, 2, 3)) && $cid) {
    $campaign = $db->fetch_first("SELECT tid, autoupdate, lastupdated FROM {$tablepre}campaigns WHERE id='{$cid}' AND type='{$type}'");
    if (!$campaign || !$campaign['autoupdate'] || $timestamp - $campaign['lastupdated'] < 600) {
        exit;
    }
    $response = insenz_request('campaign.php', '<cmd id="getTopicDetails"><c_id>' . $cid . '</c_id></cmd>');
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:advcache.php


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