Beispiel #1
0
}
//--------------------生成外链--------------------------------------------
//暂时不生成链轮。只生成到上层的返回链接,锚文本插入文章内容中的
//具体生成导出链接待定。这里先将外链置空(必须保留空成员,不然加入链接后文章会变样)
$arrOutLink = array();
$arrOutLink[] = '<a href="http://' . $indexCache->baseUrl . '">' . $indexCache->key . '</a>';
//上层链接
$arrOutLink[] = '1';
$arrOutLink[] = '2';
$arrOutLink[] = '3';
$arrOutLink[] = '';
$outLink = implode('|', $arrOutLink);
$db->close();
//--------------------生成外链完毕--------------------------------------------
$randArticle = new randArticle($cfg->isMemcached);
$randArticle->SetKey($indexCache->key);
$randArticle->SetKeys($indexCache->keys);
$randArticle->SetStroyPath($cfg->storyPath);
$randArticle->SetOutLink($outLink);
$randArticle->InitFeature($indexCache->baseUrl . $viewID);
$randArticle->GenerateTitle();
$randArticle->GenerateBody();
//--------------------生成上下页--------------------------------------------
$dayAfterCreate = (int) ((time() - $createTime) / 86400) + 1;
$maxRandArticleId = $dayAfterCreate + 3;
$nextLink = '<p><a href="./read-' . ($viewID + 1) . '.html">下一篇</a></p>';
$lastLink = '<p><a href="./read-' . ($viewID - 1) . '.html">上一篇</a></p>';
if ($viewID >= $maxRandArticleId) {
    $nextLink = '';
}
if ($viewID <= 1) {
Beispiel #2
0
    $baidu->CrawlList();
    $baiduLinks = $baidu->links;
    $indexContent->SetBaidu($v, $baidu->title, $baidu->description);
    if ($baidu->isUp) {
        $sqlUpBaidu .= ',`baidu' . $v . "`='" . addslashes($baidu->GetSerializeCache()) . "' ";
    }
    $baidu = NULL;
    unset($baidu);
}
//--------------------更新随机文章-----------------------------------------
$dayAfterCreate = (int) ((time() - $indexContent->createTime) / 86400);
$arrRandArticleViewId = array($dayAfterCreate + 1, $dayAfterCreate + 2, $dayAfterCreate + 3);
$indexContent->CleanRandArticleArray();
foreach ($arrRandArticleViewId as $v) {
    $randArticle = new randArticle($cfg->isMemcached);
    $randArticle->SetKey($indexContent->key);
    $randArticle->SetKeys($indexContent->keys);
    $randArticle->SetStroyPath($cfg->storyPath);
    $randArticle->InitFeature($indexContent->baseUrl . $v);
    $randArticle->GenerateTitle();
    $randArticle->GenerateDescription();
    $indexContent->SetRandArticle($v, $randArticle->title, $randArticle->descriptions);
    $randArticle = NULL;
    unset($randArticle);
}
//--------------------更新TAG----------------------------------------------
$indexContent->UpDateTagKey($db);
//--------------------更新数据库-------------------------------------------
$sqlUpdate = 'UPDATE `' . $indexContent->dbPrefix . "cat` SET `index`='" . addslashes($indexContent->GetSerializeCache()) . "' ";
$sqlUpdate .= $sqlUpBaidu;
$sqlUpdate .= ' WHERE `cid`=' . $indexContent->cid;