1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Closes #4702 - Added news_modified field.

This commit is contained in:
Cameron
2022-03-14 14:03:34 -07:00
parent 6257a2a716
commit 057cc8e35b
4 changed files with 8 additions and 3 deletions

View File

@@ -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);

View File

@@ -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',

View File

@@ -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
];

View File

@@ -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']);