コード例 #1
0
ファイル: view.php プロジェクト: baiyunping333/seo-marketing
 * User: ori
 * Date: 12-8-13
 * Time: 下午7:50
 * To change this template use File | Settings | File Templates.
 */
header("Content-type:text/html; charset=utf-8");
error_reporting(E_ALL & ~E_NOTICE);
ini_set("magic_quotes_runtime", 0);
include_once './class/mysql_db.php';
include_once './config.php';
include_once './class/baidu.php';
include_once './class/main.php';
include_once './function/function.php';
$cfg = new config();
$db = new dbQuery($cfg->dbHost, $cfg->dbUser, $cfg->dbPassword, $cfg->dbName);
$indexCache = new indexContent();
$viewID = InStr('view-', '.html', $_SERVER["REQUEST_URI"]);
//当前百度问答采集页面ID。范围从1-10。对应baidu1-baidu10
//--------------------从数据库中读取-------------------------------------
$sqlSelect = 'SELECT `cid`,`title`,`key`,`keys`,`adkey`,`index`,`baidu' . $viewID . '` FROM `' . $indexCache->dbPrefix . "cat` WHERE `epath`='" . $indexCache->epath . "';";
$result = $db->query($sqlSelect);
$arrResult = $db->fetch_array($result);
//--------------------初始化数据--------------------------------------------
$indexCache->AnalysisData($arrResult, (array) $viewID);
//将viewid转换成数组
$indexCache->AnalysisCache();
$arrResult = null;
unset($arrResult);
$baidu = new baidu();
$baidu->AnalysisCache($indexCache->conBaidu[$viewID]);
$baidu->SetKey($indexCache->key);
コード例 #2
0
ファイル: read.php プロジェクト: baiyunping333/seo-marketing
 * User: ori
 * Date: 12-8-14
 * Time: 上午12:11
 * To change this template use File | Settings | File Templates.
 */
header("Content-type:text/html; charset=utf-8");
error_reporting(E_ALL & ~E_NOTICE);
ini_set("magic_quotes_runtime", 0);
include_once './class/mysql_db.php';
include_once './config.php';
include_once './class/randArticle.php';
include_once './class/main.php';
include_once './function/function.php';
$cfg = new config();
$db = new dbQuery($cfg->dbHost, $cfg->dbUser, $cfg->dbPassword, $cfg->dbName);
$indexCache = new indexContent();
$viewID = InStr('read-', '.html', $_SERVER["REQUEST_URI"]);
//当前百度问答采集页面ID。范围从1-10。对应baidu1-baidu10
//--------------------从数据库中读取-------------------------------------
$sqlSelect = 'SELECT `cid`,`title`,`key`,`keys`,`adkey`,`index` FROM `' . $indexCache->dbPrefix . "cat` WHERE `epath`='" . $indexCache->epath . "';";
$result = $db->query($sqlSelect);
$arrResult = $db->fetch_array($result);
//--------------------初始化数据--------------------------------------------
$indexCache->AnalysisData($arrResult);
//将viewid转换成数组
$indexCache->AnalysisCache();
$arrResult = null;
unset($arrResult);
//--------------------获取createTime-------------------------------------
$content = '';
if ($cfg->isMemcached) {
コード例 #3
0
ファイル: index.php プロジェクト: baiyunping333/seo-marketing
 * Date: 12-8-12
 * Time: 下午2:24
 * To change this template use File | Settings | File Templates.
 */
header("Content-type:text/html; charset=utf-8");
error_reporting(E_ALL & ~E_NOTICE);
ini_set("magic_quotes_runtime", 0);
include_once './class/mysql_db.php';
include_once './config.php';
include_once './class/baidu.php';
include_once './class/randArticle.php';
include_once './class/main.php';
include_once './function/function.php';
$cfg = new config();
$db = new dbQuery($cfg->dbHost, $cfg->dbUser, $cfg->dbPassword, $cfg->dbName);
$indexContent = new indexContent();
//--------------------获取maxid-------------------------------------
$content = '';
if ($cfg->isMemcached) {
    $memcached = new Memcached();
    $memcached->addServer('127.0.0.1', '11211');
    $content = $memcached->get($indexContent->mainDomain);
}
if ($content == '' && file_exists('./cfg')) {
    $content = file_get_contents('./cfg');
}
if ($content == '') {
    $sqlSelect = 'SELECT MAX(cid) as maxcid FROM `' . $indexContent->dbPrefix . 'cat`;';
    $result = $db->query($sqlSelect);
    $arrResult = $db->fetch_array($result);
    $maxID = $arrResult['maxcid'];