QQ截图20160721180300.jpg

QQ截图20160721180422.jpg

模板使用了额外的 hook 可以从中学习 如何调用额外的数据 输出到 模板的!

//<?

$lib_new_post_data = (array)$this->CacheObj->get('lib_new_post_data');
if(empty($lib_new_post_data) || DEBUG){
	$inc = get_plugin_inc('lib_new_post_data');
	$lib_new_post_data	 = M("Thread")->select('*',array("ORDER" => "btime DESC","LIMIT" => array(0, $inc['size'])));
	$this->CacheObj->set('lib_new_post_data',$lib_new_post_data);
}
$this->v('lib_new_post_data',$lib_new_post_data);

$lib_new_image_data = (array)$this->CacheObj->get('lib_new_image_data');

if(empty($lib_new_image_data) || DEBUG){
	$inc = get_plugin_inc('lib_new_image_data');
	$lib_new_image_data	 = M("Thread")->select('*',array('img[!]'=>'',"ORDER" => "id DESC","LIMIT" => array(0, $inc['size'])));
	$this->CacheObj->set('lib_new_image_data',$lib_new_image_data);
}
$this->v('lib_new_image_data',$lib_new_image_data);


$lib_top_post_data = (array)$this->CacheObj->get('lib_top_post_data');

if(empty($lib_top_post_data) || DEBUG){
	$inc = get_plugin_inc('lib_top_post_data');
	$lib_top_post_data	 = M("Thread")->select('*',array("ORDER" => "posts DESC","LIMIT" => array(0, $inc['size'])));
	$this->CacheObj->set('lib_top_post_data',$lib_top_post_data);
}
$this->v('lib_top_post_data',$lib_top_post_data);

QQ截图20160721180540.jpg


同樣,DEBUG模式開著正常,一關掉就顯示分類已被刪除。

官方博客用的是wordpress程序?


这个博客的模板在那里下载的?