HYBBS 官方博客模板

admin   ·   发表于 2016-7-21   ·   模板开发

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


3 条回复   |  直到 2017-4-15 | 6576 次浏览

john52
发表于 2016-7-21

QQ截图20160721221713.png


这个怎么解决

评论列表

  • 加载数据中...

编写评论内容

達也
发表于 2016-7-21

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

评论列表

  • 加载数据中...

编写评论内容

fghb1029
发表于 2017-4-15

官方博客用的是wordpress程序?


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

评论列表

  • 加载数据中...

编写评论内容
登录后才可发表内容