模板使用了额外的 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);
|