$memcached = new Memcached(); $memcached->addServer('127.0.0.1', '11211'); $content = $memcached->get($indexCache->mainDomain); } if ($content == '' && file_exists('./cfg')) { $content = file_get_contents('./cfg'); } if ($content == '') { $sqlSelect = 'SELECT MAX(cid) as maxcid FROM `' . $indexCache->dbPrefix . 'cat`;'; $result = $db->query($sqlSelect); $arrResult = $db->fetch_array($result); $maxID = $arrResult['maxcid']; $createTime = time(); $arrCon = array('maxid' => $maxID, 'create' => $createTime); $content = serialize($arrCon); CachePutContents($content, './cfg'); } else { $arrResult = unserialize($content); $maxID = $arrResult['maxid']; $createTime = $arrResult['create']; } //--------------------生成外链-------------------------------------------- //暂时不生成链轮。只生成到上层的返回链接,锚文本插入文章内容中的 //具体生成导出链接待定。这里先将外链置空(必须保留空成员,不然加入链接后文章会变样) $arrOutLink = array(); $arrOutLink[] = '<a href="http://' . $indexCache->baseUrl . '">' . $indexCache->key . '</a>'; //上层链接 $arrOutLink[] = '1'; $arrOutLink[] = '2'; $arrOutLink[] = '3'; $arrOutLink[] = '';
$insertToDB_sql = str_replace(',xbakfffeeee', '', $insertToDB_sql . 'xbakfffeeee'); $insertToDB_sql = str_replace('xbakfffeeee', '', $insertToDB_sql) . ';'; $db->query($insertToDB_sql); echo "<br>解锁<br>"; $db->query('UNLOCK TABLES;'); //解锁 echo "<H1><font color='red'>Add keys done!({$x})</a></H1>"; $db->close(); $next_site = $cfg->nextDomain; if ($next_site != '') { echo "<meta http-equiv=refresh content='0; url=http://www." . $cfg->nextDomain . "/install/install.php'>"; } //将关键词数及生成日期写入 $arrCreate = array('maxid' => $x - 1, 'create' => time()); $con = serialize($arrCreate); CachePutContents($con, '../cfg'); unset($con); unset($arrCreate); } else { echo "Please input password."; } /** * 返回插入语句 * @param $key * @param $keys * @param $adKey * @return string */ function Insert($key, $keys, $adKey) { $epath = GetEPath($key);