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


PHP GetCache函数代码示例

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


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

示例1: lib_changyan

function lib_changyan(&$ctag, &$refObj)
{
    global $dsql, $envs;
    //属性处理
    $attlist = "type|code,config|,class|_DEDECY,style|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $reval = "";
    if (!$dsql->IsTable("#@__plus_changyan_setting")) {
        return '没安装畅言模块';
    }
    $client_id = changyan_get_setting('appid');
    if (empty($client_id)) {
        return '尚未注册畅言帐号,请到后台注册';
    }
    if ($type == 'code' or $type == 'code2') {
        $reval .= "<div class='{$class}' style='{$style}'>";
        $prefix = 'changyan';
        $key = 'code';
        $row = GetCache($prefix, $key);
        if (!is_array($row)) {
            $appid = changyan_get_setting('appid');
            $user = changyan_get_setting('user');
            $sign = changyan_gen_sign($user);
            $result = changyan_getcode(CHANGYAN_CLIENT_ID, $user, false, $sign, $appid);
            $row['reval'] = htmlspecialchars($result['code']);
            SetCache($prefix, $key, $row, 60 * 60 * 1);
        }
        if (!empty($config)) {
            $config_arr = array();
            $configs = explode(',', $config);
            if (count($configs) > 0) {
                foreach ($configs as $c) {
                    $item = explode(':', $c);
                    $config_arr[$item[0]] = $item[1];
                }
            }
            $config_str = json_encode($config_arr);
            $reval .= <<<EOT
<script>
    var_config={$config_str};
</script>
EOT;
        }
        $reval .= htmlspecialchars_decode($row['reval']);
        $reval = str_replace("id='SOHUCS'", "id='SOHUCS' sid='{$refObj->ArcID}'", $reval);
        if ($type == 'code2') {
            $reval = preg_replace("#window.SCS_NO_IFRAME[ ]?=[ ]?true;#i", "", $reval);
        }
        $reval = str_replace("<script>", "</div><script>", $reval);
    } elseif ($type == 'count') {
        if (!$GLOBALS['changyan_count_js']) {
            $reval .= "<script type=\"text/javascript\" src=\"http://assets.changyan.sohu.com/upload/plugins/plugins.count.js\"></script>";
        }
        $reval .= "<a href=\"#SOHUCS\" id=\"changyan_count_unit\"></a>";
        $GLOBALS['changyan_count_js'] = TRUE;
    }
    return $reval;
}
开发者ID:stonelf,项目名称:mcgmh,代码行数:59,代码来源:changyan.lib.php

示例2: dirname

 * @package        DedeCMS.Plus
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/../include/common.inc.php";
$action = isset($action) ? trim($action) : '';
$id = empty($id) ? 0 : intval(preg_replace("/[^\\d]/", '', $id));
helper('cache');
if ($id < 1) {
    exit;
}
$maintable = '#@__archives';
$prefix = 'diggCache';
$key = 'aid-' . $id;
$row = GetCache($prefix, $key);
if (!is_array($row) || $cfg_digg_update == 0) {
    $row = $dsql->GetOne("SELECT goodpost,badpost,scores FROM `{$maintable}` WHERE id='{$id}' ");
    if ($cfg_digg_update == 0) {
        if ($action == 'good') {
            $row['goodpost'] = $row['goodpost'] + 1;
            $dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET scores = scores + {$cfg_caicai_add},goodpost=goodpost+1,lastpost=" . time() . " WHERE id='{$id}'");
        } else {
            if ($action == 'bad') {
                $row['badpost'] = $row['badpost'] + 1;
                $dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET scores = scores - {$cfg_caicai_sub},badpost=badpost+1,lastpost=" . time() . " WHERE id='{$id}'");
            }
        }
        DelCache($prefix, $key);
    }
    SetCache($prefix, $key, $row, 0);
开发者ID:bthtml,项目名称:web-hwxf,代码行数:31,代码来源:digg_ajax.php

示例3: GetArcList


//.........这里部分代码省略.........
         while ($arr = $this->dsql->GetArray()) {
             $ids[] = $arr['id'];
         }
         $idstr = join(',', $ids);
         if ($idstr == '') {
             return '';
         } else {
             $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,\n                       tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n                       {$addField}\n                       FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n                       {$addJoin}\n                       WHERE arc.id in({$idstr}) {$ordersql} ";
         }
         $t2 = ExecTime();
         //echo $t2-$t1;
     }
     $this->dsql->SetQuery($query);
     $this->dsql->Execute('al');
     $t2 = ExecTime();
     //echo $t2-$t1;
     $artlist = '';
     $this->dtp2->LoadSource($innertext);
     $GLOBALS['autoindex'] = 0;
     for ($i = 0; $i < $row; $i++) {
         if ($col > 1) {
             $artlist .= "<div>\r\n";
         }
         for ($j = 0; $j < $col; $j++) {
             if ($row = $this->dsql->GetArray("al")) {
                 $GLOBALS['autoindex']++;
                 $ids[$row['id']] = $row['id'];
                 //处理一些特殊字段
                 $row['infos'] = cn_substr($row['description'], $infolen);
                 $row['id'] = $row['id'];
                 if ($cfg_digg_update > 0) {
                     $prefix = 'diggCache';
                     $key = 'aid-' . $row['id'];
                     $cacherow = GetCache($prefix, $key);
                     $row['goodpost'] = $cacherow['goodpost'];
                     $row['badpost'] = $cacherow['badpost'];
                     $row['scores'] = $cacherow['scores'];
                 }
                 if ($row['corank'] > 0 && $row['arcrank'] == 0) {
                     $row['arcrank'] = $row['corank'];
                 }
                 $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                 $row['typeurl'] = GetTypeUrl($row['typeid'], MfTypedir($row['typedir']), $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                 if ($row['litpic'] == '-' || $row['litpic'] == '') {
                     $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                 }
                 if (!preg_match("/^http:\\/\\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                     $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                 }
                 $row['picname'] = $row['litpic'];
                 $row['stime'] = GetDateMK($row['pubdate']);
                 $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
                 $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . preg_replace("/['><]/", "", $row['title']) . "'>";
                 $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
                 $row['fulltitle'] = $row['title'];
                 $row['title'] = cn_substr($row['title'], $titlelen);
                 if ($row['color'] != '') {
                     $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
                 }
                 if (preg_match('/c/', $row['flag'])) {
                     $row['title'] = "<b>" . $row['title'] . "</b>";
                 }
                 $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
                 $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                 $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                 $row['templeturl'] = $GLOBALS['cfg_templeturl'];
开发者ID:cwcw,项目名称:cms,代码行数:67,代码来源:arc.listview.class.php

示例4: GetMemberName

 function GetMemberName($mid = 0)
 {
     global $dsql;
     $rs = GetCache('memberlogin', $mid);
     if (empty($rs)) {
         $rs = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$mid}' ");
         SetCache('memberlogin', $mid, $rs, 1800);
     }
     return $rs['uname'];
 }
开发者ID:cwcw,项目名称:cms,代码行数:10,代码来源:config.php

示例5: Getincludefun

<?php

if ($actionhtml = GetCache($action)) {
    include_once $actionhtml;
    include_once Getincludefun("html");
    $smarty->assign('cache_config', $cache_config);
}
if ($option == 'index') {
    $smarty->assign('config', array('title' => "{$cache_config['subject']}", 'keywords' => $config['keywords'] . "_{$cache_config['subject']}", 'description' => $config['description'] . "_{$cache_config['subject']}"));
    $nCount = $cache_config['numser'] ? $cache_config['numser'] : "20";
    $cParameter = "action={$action}&option={$option}&id={$id}&Industry={$Industry}&Keyword={$Keyword}";
    include_once Getincludefun("page");
    if ($Keyword) {
        fgetposttoupdatd($Keyword, $ODBC['charset']);
        $where = "`hot_subject` LIKE '%{$Keyword}%' AND `hot_pass`='1'";
    } else {
        $where = "`hot_pass`='1'";
    }
    $nNums = $GETSQL->fNumrows("SELECT hot_id FROM `{$ODBC['tablepre']}hotel` WHERE {$where}");
    if ($nNums > 0) {
        $sql_hotel = $GETSQL->fSql("hot_id,hot_subject,hot_logo,hot_info", "`{$ODBC['tablepre']}hotel`", "{$where}", "ORDER BY `hot_sp` DESC,`hot_date` DESC,`hot_id` DESC", $nPage * $nCount, $nCount);
        foreach ($sql_hotel as $key => $value) {
            $sql_hotel[$key]['hot_info'] = fconurt($value['hot_info']);
        }
        if ($nNums > $nCount) {
            $fpageup = fPages($nNums, $nPage, $nCount, $cParameter, 1);
            $smarty->assign('fpageup', $fpageup);
        }
    }
    $smarty->assign('sql_hotel', $sql_hotel);
    $smarty->assign('rentime', fmicrotime());
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:hotel.php

示例6: SetCache

<?php

/***********************************************
DAVE PHP API
https://github.com/evantahler/PHP-DAVE-API
Evan Tahler | 2011

I am a way to test that cahce functions are working
I'll store and return a user provided variable
***********************************************/
// I'll use HASH as the variable to log by IP address;
if ($ERROR == 100) {
    if ($CONFIG['CacheType'] == "") {
        $ERROR = "The cache is not configured on this server";
    }
}
if ($ERROR == 100) {
    if (strlen($PARAMS["Hash"]) == 0) {
        $ERROR = "You need to provide a Hash";
    } else {
        $CacheKey = $IP . "_CacheTest";
        SetCache($CacheKey, $PARAMS["Hash"]);
        $result = GetCache($CacheKey);
        $OUTPUT['CacheKey'] = $CacheKey;
        $OUTPUT['CachedResult'] = $result;
    }
}
开发者ID:simonfoxe,项目名称:PHP-DAVE-API,代码行数:27,代码来源:CacheTest.php

示例7: __construct

 function __construct($kptime = -1, $cache = FALSE)
 {
     global $dsql;
     if ($kptime == -1) {
         $this->M_KeepTime = 3600 * 24 * 7;
     } else {
         $this->M_KeepTime = $kptime;
     }
     $formcache = FALSE;
     $this->M_ID = $this->GetNum(GetCookie("DedeUserID"));
     $this->M_LoginTime = GetCookie("DedeLoginTime");
     $this->fields = array();
     $this->isAdmin = FALSE;
     if (empty($this->M_ID)) {
         $this->ResetUser();
     } else {
         $this->M_ID = intval($this->M_ID);
         if ($cache) {
             $this->fields = GetCache($this->memberCache, $this->M_ID);
             if (empty($this->fields)) {
                 $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' ");
             } else {
                 $formcache = TRUE;
             }
         } else {
             $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' ");
         }
         if (is_array($this->fields)) {
             #api{{
             if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) {
                 if ($data = uc_get_user($this->fields['userid'])) {
                     if (uc_check_avatar($data[0]) && !strstr($this->fields['face'], UC_API)) {
                         $this->fields['face'] = UC_API . '/avatar.php?uid=' . $data[0] . '&size=middle';
                         $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `face`='" . $this->fields['face'] . "' WHERE `mid`='{$this->M_ID}'");
                     }
                 }
             }
             #/aip}}
             //间隔一小时更新一次用户登录时间
             if (time() - $this->M_LoginTime > 3600) {
                 $dsql->ExecuteNoneQuery("update `#@__member` set logintime='" . time() . "',loginip='" . GetIP() . "' where mid='" . $this->fields['mid'] . "';");
                 PutCookie("DedeLoginTime", time(), $this->M_KeepTime);
             }
             $this->M_LoginID = $this->fields['userid'];
             $this->M_MbType = $this->fields['mtype'];
             $this->M_Money = $this->fields['money'];
             $this->M_UserName = FormatUsername($this->fields['uname']);
             $this->M_Scores = $this->fields['scores'];
             $this->M_Face = $this->fields['face'];
             $this->M_Rank = $this->fields['rank'];
             $this->M_Spacesta = $this->fields['spacesta'];
             $sql = "Select titles From #@__scores where integral<={$this->fields['scores']} order by integral desc";
             $scrow = $dsql->GetOne($sql);
             $this->fields['honor'] = $scrow['titles'];
             $this->M_Honor = $this->fields['honor'];
             if ($this->fields['matt'] == 10) {
                 $this->isAdmin = TRUE;
             }
             $this->M_UpTime = $this->fields['uptime'];
             $this->M_ExpTime = $this->fields['exptime'];
             $this->M_JoinTime = MyDate('Y-m-d', $this->fields['jointime']);
             if ($this->M_Rank > 10 && $this->M_UpTime > 0) {
                 $this->M_HasDay = $this->Judgemember();
             }
             if (!$formcache) {
                 SetCache($this->memberCache, $this->M_ID, $this->fields, 1800);
             }
         } else {
             $this->ResetUser();
         }
     }
 }
开发者ID:hensonvip,项目名称:ymroad,代码行数:72,代码来源:memberlogin.class.php

示例8: unset

}
unset($SquidNuditScanParams);
$filter = new ImageFilter();
$GLOBALS["HELPER"] = new externhelper();
while (!feof(STDIN)) {
    $url = trim(fgets(STDIN));
    if ($url == null) {
        continue;
    }
    $array = $GLOBALS["HELPER"]->parseURL($url);
    if ($GLOBALS["DEBUG_LEVEL"] > 1) {
        $GLOBALS["HELPER"]->WLOG($url . " str:" . strlen($url) . " LOGIN:{$array["LOGIN"]},IPADDR:{$array["IPADDR"]} MAC:{$array["MAC"]} HOST:{$array["HOST"]} URI:{$array["URI"]}");
    }
    $szMac = $array["MAC"];
    $szUrl = $array["URI"];
    $iScore = GetCache($szUrl);
    if ($iScore > 0) {
        if ($GLOBALS["DEBUG_LEVEL"] > 0) {
            $GLOBALS["HELPER"]->WLOG("Cached: {$iScore}% " . basename($szUrl));
        }
        if ($iScore > $iPicScanVal) {
            print "OK\n";
            continue;
        } else {
            print "ERR\n";
            continue;
        }
    }
    if (strlen($szUrl) < 3) {
        if ($GLOBALS["DEBUG_LEVEL"] > 1) {
            $GLOBALS["HELPER"]->WLOG("-> STOP no uri...");
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:picporn.php

示例9: implode

            $_POST['blog_tags'] = implode(",", $gametag);
            $sql_gametag = $GETSQL->fSql("tag_id,tag_subject", "`{$ODBC['tablepre']}travelyoutag`", "`tag_subject` IN ({$gametags})");
            foreach ($sql_gametag as $value) {
                foreach ($gametag as $key => $ver) {
                    if ($ver == $value['tag_subject']) {
                        unset($gametag[$key]);
                    }
                }
            }
            $GETSQL->fUpdate("`{$ODBC['tablepre']}travelyoutag`", "`tag_num`=`tag_num`+1", "`tag_subject` IN ({$gametags})");
            foreach ($gametag as $value) {
                $cQuery = array("`tag_subject`");
                $cData = array($value);
                $GETSQL->fInsert("`{$ODBC['tablepre']}travelyoutag`", $cQuery, $cData);
            }
        }
        $cQuery = array("`thr_id`", "`thr_hid`", "`thr_subject`", "`thr_tages`", "`thr_content`", "`thr_date`");
        $cData = array($nowtime, $id, $_POST['blog_title'], $_POST['blog_tags'], $_POST['blog_body'], fgetdate());
        $GETSQL->fInsert("`{$ODBC['tablepre']}travelyou`", $cQuery, $cData);
        if ($actionhtml = GetCache('travel')) {
            include_once $actionhtml;
            if ($cache_config['cache'] == '1') {
                P_unlink(R_P . "html/travel/travelyou_I_{$id}.htm");
                ffile("{$boardurl}index.php?action=travel&option=travelyou&id={$id}", '', "r");
            }
        }
        header("Location: update.php?action=add&title=" . urlencode("发表成功") . "&a=travel&p=travelyouthread&id={$id}&in={$nowtime}");
        exit;
    }
    $smarty->display("travelyouedit.htm");
}
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:member.php

示例10: lib_arclistDone


//.........这里部分代码省略.........
    if ($pagesize > 0) {
        $tagid = AttDef($tagid, 'tag' . $taghash);
    }
    if ($idlist != '' || $GLOBALS['_arclistEnv'] == 'index' || $cfg_index_cache == 0) {
        $needSaveCache = false;
    } else {
        $idlist = GetArclistCache($taghash);
        if ($idlist != '') {
            $needSaveCache = false;
        }
        //如果使用的是内容缓存,直接返回结果
        if ($cfg_cache_type == 'content' && $idlist != '') {
            $idlist = $idlist == 0 ? '' : $idlist;
            return $idlist;
        }
    }
    //指定了id或使用缓存中的id
    if ($idlist != '') {
        $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,\r\n            tp.moresite,tp.siteurl,tp.sitepath\r\n            {$addfieldsSql}\r\n             FROM `{$maintable}` arc left join `#@__arctype` tp on arc.typeid=tp.id\r\n             {$addfieldsSqlJoin}\r\n          WHERE arc.id in({$idlist}) {$ordersql} ";
    }
    // 好评差评缓存更新
    if ($cfg_digg_update > 0) {
        if ($orderby == 'goodpost' || $orderby == 'badpost') {
            $t1 = ExecTime();
            $postsql = "SELECT arc.id,arc.goodpost,arc.badpost,arc.scores\r\n\t\t\t\tFROM `{$maintable}` arc\r\n\t\t\t\t{$orwhere} {$ordersql} {$limitsql}";
            if ($idlist != '') {
                $postsql = "SELECT arc.id,arc.goodpost,arc.badpost,arc.scores\r\n\t\t\t\t\t FROM `{$maintable}` arc \r\n\t\t\t\t  WHERE arc.id in({$idlist}) {$ordersql} ";
            }
            $dsql->SetQuery($query);
            $dsql->Execute('lit');
            while ($row = $dsql->GetArray('lit')) {
                $prefix = 'diggCache';
                $key = 'aid-' . $row['id'];
                $cacherow = GetCache($prefix, $key);
                $setsql = array();
                if (!empty($cacherow['scores']) && $cacherow['scores'] != $row['scores']) {
                    $setsql[] = "scores = {$cacherow['scores']}";
                }
                if (!empty($cacherow['goodpost']) && $cacherow['goodpost'] != $row['goodpost']) {
                    $setsql[] = "goodpost = {$cacherow['goodpost']}";
                }
                if (!empty($cacherow['badpost']) && $cacherow['badpost'] != $row['badpost']) {
                    $setsql[] = "badpost = {$cacherow['badpost']}";
                }
                $setsql = implode(',', $setsql);
                $sql = "UPDATE `{$maintable}` SET {$setsql} WHERE id='{$row['id']}'";
                if (!empty($setsql)) {
                    $dsql->ExecuteNoneQuery($sql);
                }
            }
            //echo ExecTime()-$t1;
        }
    }
    $dsql->SetQuery($query);
    $dsql->Execute('al');
    //$row = $dsql->GetArray("al");
    $artlist = '';
    if ($pagesize > 0) {
        $artlist .= "    <div id='{$tagid}'>\r\n";
    }
    if ($col > 1) {
        $artlist = "<table width='{$tablewidth}' border='0' cellspacing='0' cellpadding='0'>\r\n";
    }
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadString($innertext);
开发者ID:iabing,项目名称:mzzyc,代码行数:67,代码来源:arclist.lib.php

示例11: lib_flink

function lib_flink(&$ctag, &$refObj)
{
    global $dsql, $cfg_soft_lang;
    $attlist = "type|textall,row|24,titlelen|24,linktype|1,typeid|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $totalrow = $row;
    $revalue = '';
    if (isset($GLOBALS['envs']['flinkid'])) {
        $typeid = $GLOBALS['envs']['flinkid'];
    }
    $wsql = " where ischeck >= '{$linktype}' ";
    if ($typeid == 0) {
        $wsql .= '';
    } else {
        if ($typeid == 999) {
            $prefix = 'flink';
            $key = '999';
            $row = GetCache($prefix, $key);
            if (!is_array($row)) {
                require DEDEDATA . '/admin/config_update.php';
                if (!class_exists('DedeHttpDown', false)) {
                    require_once DEDEINC . '/dedehttpdown.class.php';
                }
                $del = new DedeHttpDown();
                $del->OpenUrl($linkHost);
                $linkUrl = $del->GetHtml() . "flink.php?lang={$cfg_soft_lang}&site={$_SERVER['SERVER_NAME']}";
                $del->OpenUrl($linkUrl);
                $linkInfo = $del->GetHtml();
                if (!empty($linkInfo)) {
                    $dedelink = explode("\t", $linkInfo);
                    for ($i = 0; $i < count($dedelink); $i++) {
                        if ($i % 5 == 0 && $i != count($dedelink)) {
                            $revalue .= "<li><a href='http://" . @$dedelink[$i + 1] . "' target='_blank' title='" . @$dedelink[$i + 4] . "'>" . @$dedelink[$i] . "</a></li>";
                        }
                    }
                } else {
                    $revalue = <<<EOT
<li><a href='http://ad.dedecms.com' target='_blank' title='DedeCMS广告'>DedeCMS广告</a></li><li><a href='http://service.dedecms.com' target='_blank' title='织梦客户服务中心'>
织梦客户服务中心</a></li><li><a href='http://ask.dedecms.com' target='_blank' title='织梦问答'>
织梦问答</a></li><li><a href='http://tools.dedecms.com' target='_blank' title='站长工具'>
站长工具</a></li><li><a href='http://site.desdev.cn' target='_blank' title='DedeCMS建站中心'>
DedeCMS建站中心</a></li><li><a href='http://help.dedecms.com' target='_blank' title='织梦CMS帮助中心'>
织梦CMS帮助中心</a></li><li><a href='http://' target='_blank' title=''>
</a></li>
EOT;
                }
                $row['reval'] = $revalue;
                SetCache($prefix, $key, $row, 60 * 60 * 1);
            }
            return $row['reval'];
        } else {
            $wsql .= "And typeid = '{$typeid}'";
        }
    }
    if ($type == 'image') {
        $wsql .= " And logo<>'' ";
    } else {
        if ($type == 'text') {
            $wsql .= " And logo='' ";
        }
    }
    $equery = "SELECT * FROM #@__flink {$wsql} order by sortrank asc limit 0,{$totalrow}";
    if (trim($ctag->GetInnerText()) == '') {
        $innertext = "<li>[field:link /]</li>";
    } else {
        $innertext = $ctag->GetInnerText();
    }
    $dsql->SetQuery($equery);
    $dsql->Execute();
    while ($dbrow = $dsql->GetObject()) {
        if ($type == 'text' || $type == 'textall') {
            $link = "<a href='" . $dbrow->url . "' target='_blank'>" . cn_substr($dbrow->webname, $titlelen) . "</a> ";
        } else {
            if ($type == 'image') {
                $link = "<a href='" . $dbrow->url . "' target='_blank'><img src='" . $dbrow->logo . "' width='248' height='180' border='0'></a> ";
            } else {
                if ($dbrow->logo == '') {
                    $link = "<a href='" . $dbrow->url . "' target='_blank'>" . cn_substr($dbrow->webname, $titlelen) . "</a> ";
                } else {
                    $link = "<a href='" . $dbrow->url . "' target='_blank'><img src='" . $dbrow->logo . "' width='248' height='180' border='0'></a> ";
                }
            }
        }
        $rbtext = preg_replace("/\\[field:url([\\/\\s]{0,})\\]/isU", $row['url'], $innertext);
        $rbtext = preg_replace("/\\[field:webname([\\/\\s]{0,})\\]/isU", $row['webname'], $rbtext);
        $rbtext = preg_replace("/\\[field:logo([\\/\\s]{0,})\\]/isU", $row['logo'], $rbtext);
        $rbtext = preg_replace("/\\[field:link([\\/\\s]{0,})\\]/isU", $link, $rbtext);
        $revalue .= $rbtext;
    }
    return $revalue;
}
开发者ID:healen,项目名称:dsCMS,代码行数:92,代码来源:flink.lib.php

示例12: in

        $tinyQuerys[] = " arcrank > -2 ";
    }
    if (!empty($mid)) {
        $tinyQuerys[] = " mid='{$mid}' ";
    }
    if (!empty($cid)) {
        $tinyQuerys[] = " typeid in(" . GetSonIds($cid) . ") ";
    }
    if (count($tinyQuerys) > 0) {
        $tinyQuery = "WHERE " . join(' AND ', $tinyQuerys);
    }
    $tinyQuery = "WHERE mid={$adminid}";
    // 缓存处理
    $sql = "SELECT COUNT(*) AS dd FROM `#@__archives` {$tinyQuery} ";
    $cachekey = md5($sql);
    $arr = GetCache('listcache', $cachekey);
    if (empty($arr)) {
        $arr = $dsql->GetOne($sql);
        SetCache('listcache', $cachekey, $arr);
    }
    $totalresult = $arr['dd'];
}
if ($cid == 0) {
    if ($channelid == 0) {
        $positionname = '所有栏目&gt;';
    } else {
        $row = $tl->dsql->GetOne("SELECT id,typename,maintable FROM `#@__channeltype` WHERE id='{$channelid}'");
        $positionname = $row['typename'] . " &gt; ";
        $maintable = $row['maintable'];
        $channelid = $row['id'];
    }
开发者ID:puppylsy,项目名称:cms,代码行数:31,代码来源:content_list3.php

示例13: Getincludefun

<?php

if ($actionhtml = GetCache($action) && $_POST['update'] != 'update') {
    include_once $actionhtml;
    include_once Getincludefun("html");
    $smarty->assign('cache_config', $cache_config);
}
if ($option == 'index') {
    $smarty->assign('config', array('title' => "{$cache_config['subject']}", 'keywords' => $config['keywords'] . "_{$cache_config['subject']}", 'description' => $config['description'] . "_{$cache_config['subject']}"));
    if ($_POST['update'] == 'update') {
        fgetposttoupdatd($_POST, $ODBC['charset']);
        if ($_POST['addsubject'] != '' && $_POST['addurl'] != '') {
            $cQuery = array("`link_id`", "`link_subject`", "`link_url`", "`link_info`", "`link_logo`");
            $cData = array($nowtime, $_POST['addsubject'], $_POST['addurl'], $_POST['addinfo'], $_POST['addlogo']);
            $GETSQL->fInsert("`{$ODBC['tablepre']}link`", $cQuery, $cData);
            die(gb2utf8("友情连接申请成功等待管理员通过"));
        }
        die(gb2utf8("友情连接申请失败"));
    }
    $nCount = $cache_config['numser'] ? $cache_config['numser'] : "20";
    $cParameter = "action={$action}&option={$option}";
    $nNums = $GETSQL->fNumrows("SELECT link_id FROM `{$ODBC['tablepre']}link` WHERE `link_pass`>0");
    if ($nNums > 0) {
        $sql_link = $GETSQL->fSql("*", "`{$ODBC['tablepre']}link`", "`link_pass`>0", "ORDER BY `link_pass` DESC,`link_sp` DESC,`link_id` DESC", $nPage * $nCount, $nCount);
        if ($nNums > $nCount) {
            $fpageup = fPages($nNums, $nPage, $nCount, $cParameter, 1);
            $smarty->assign('fpageup', $fpageup);
        }
    }
    $smarty->assign('sql_link', $sql_link);
    $smarty->assign('rentime', fmicrotime());
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:link.php


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