diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 2dacb3b61..55d1aeb55 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -472,6 +472,8 @@ class news_admin_ui extends e_admin_ui 'news_render_type' => array('title' => LAN_LOCATION, 'type' => 'dropdown', 'data'=>'safestr', 'tab'=>2, 'inline'=>true, 'readParms'=>array('type'=>'checkboxes'), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true), 'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'data'=>'int', 'tab'=>2, 'width' => 'auto', 'thclass' => 'center', 'inline'=>true, 'class' => 'center', 'nosort' => false, 'batch'=>true, 'filter'=>true), + 'news_modified' => array('title' => LAN_LAST_UPDATED, 'type' => 'datestamp', 'readonly'=>true, 'noedit'=>true, 'data'=>'int', 'tab'=>2, 'width' => 'auto', 'thclass' => 'center', 'inline'=>false, 'class' => 'center', 'nosort' => false, 'batch'=>false, 'filter'=>true), + 'news_allow_comments' => array('title' => LAN_COMMENTS, 'type' => 'boolean', 'data'=>'int', 'tab'=>2, 'writeParms'=>'inverse=1', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false,'batch'=>true, 'filter'=>true,'readParms'=>'reverse=1'), 'news_comment_total' => array('title' => LAN_NEWS_60, 'type' => 'number', 'data'=>'int', 'tab'=>2, 'noedit'=>true, 'width' => '10%', 'thclass' => '', 'class' => null, 'nosort' => false), // admin_news_notify @@ -523,7 +525,7 @@ class news_admin_ui extends e_admin_ui $new_data['news_datestamp'] = time(); } - + $new_data['news_modified'] = time(); $new_data['news_sef'] = empty($new_data['news_sef']) ? eHelper::title2sef($new_data['news_title']) : eHelper::secureSef($new_data['news_sef']); @@ -587,6 +589,7 @@ class news_admin_ui extends e_admin_ui $new_data['news_sef'] = eHelper::title2sef($new_data['news_title']); } + $new_data['news_modified'] = time(); $this->checkSEFSimilarity($new_data); diff --git a/e107_core/sql/core_sql.php b/e107_core/sql/core_sql.php index 487b5ba8c..19ec75d32 100755 --- a/e107_core/sql/core_sql.php +++ b/e107_core/sql/core_sql.php @@ -309,6 +309,7 @@ CREATE TABLE news ( news_meta_description text NOT NULL, news_meta_robots varchar(255) default '', news_datestamp int(10) unsigned NOT NULL default '0', + news_modified int(10) unsigned NOT NULL default '0', news_author int(10) unsigned NOT NULL default '0', news_category tinyint(3) unsigned NOT NULL default '0', news_allow_comments tinyint(3) unsigned NOT NULL default '0', diff --git a/e107_plugins/news/e_gsitemap.php b/e107_plugins/news/e_gsitemap.php index 5ac9e55b4..578f92f58 100644 --- a/e107_plugins/news/e_gsitemap.php +++ b/e107_plugins/news/e_gsitemap.php @@ -107,7 +107,7 @@ class news_gsitemap { $ret[] = [ 'url' => $this->url('news', $row), - 'lastmod' => (int) $row['news_datestamp'], + 'lastmod' => !empty($row['news_modified']) ? $row['news_modified'] : (int) $row['news_datestamp'], 'freq' => 'hourly', 'priority' => 0.5 ]; diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index dab10cffb..3852ac296 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -718,7 +718,8 @@ class news_front $c++; } - $modifiedTime = strtotime('30 minutes ago'); + $modifiedTime = !empty($news['news_modified']) ? (int) $news['news_modified'] : (int) $news['news_datestamp']; + e107::meta('og:updated_time', $modifiedTime); e107::meta('article:section', $news['category_name']);