|
|
|
|
@ -1092,23 +1092,7 @@ class Information extends CI_Controller
|
|
|
|
|
$data_H1 = array();
|
|
|
|
|
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
|
|
|
|
|
$data_H1['author'] = ''; //获取作者信息
|
|
|
|
|
|
|
|
|
|
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
|
|
|
|
|
// 六个月以前的文章不显示发布时间
|
|
|
|
|
if (empty($meta_news_createdate) || !strtotime($meta_news_createdate)) {
|
|
|
|
|
$data_H1['meta_news_createdate'] = NULL;
|
|
|
|
|
} else {
|
|
|
|
|
$publish_date = new DateTime($meta_news_createdate, new DateTimeZone('UTC'));
|
|
|
|
|
$current_date = new DateTime('now', new DateTimeZone('UTC'));
|
|
|
|
|
$interval = $current_date->diff($publish_date);
|
|
|
|
|
|
|
|
|
|
if ($interval->y > 0 || ($interval->m > 6) || ($interval->m == 6 && $interval->d > 0)) {
|
|
|
|
|
$data_H1['meta_news_createdate'] = NULL;
|
|
|
|
|
} else {
|
|
|
|
|
$data_H1['meta_news_createdate'] = $meta_news_createdate;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$data_H1['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
|
|
|
|
|
|
|
|
|
|
$author = $this->Operator_model->get_author_nikename($information->ic_author);
|
|
|
|
|
if (!empty($author)) {
|
|
|
|
|
@ -1499,6 +1483,26 @@ class Information extends CI_Controller
|
|
|
|
|
file_put_contents($html_path, $template, LOCK_EX);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 六个月以前的文章不显示发布时间
|
|
|
|
|
private function get_publish_date_in_6_month($information)
|
|
|
|
|
{
|
|
|
|
|
$publish_date_in_6_month = NULL;
|
|
|
|
|
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
|
|
|
|
|
if (!empty($meta_news_createdate) && strtotime($meta_news_createdate)) {
|
|
|
|
|
$publish_date = new DateTime($meta_news_createdate, new DateTimeZone('UTC'));
|
|
|
|
|
$current_date = new DateTime('now', new DateTimeZone('UTC'));
|
|
|
|
|
$interval = $current_date->diff($publish_date);
|
|
|
|
|
$total_months = $interval->y * 12 + $interval->m;
|
|
|
|
|
|
|
|
|
|
if ($total_months < 6) {
|
|
|
|
|
$publish_date_in_6_month = $meta_news_createdate;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $publish_date_in_6_month;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function test_recommand()
|
|
|
|
|
{
|
|
|
|
|
$information = $this->Information_model->Detail($this->input->get('is_id'));
|
|
|
|
|
|