Revert back the date_format

We will change the date format in one go later.
This commit is contained in:
danpros 2020-05-04 10:16:56 +07:00
commit 0fc0d127da
8 changed files with 21 additions and 9 deletions

View file

@ -673,7 +673,6 @@ function get_feed($feed_url, $credit)
// Get recent posts by user
function get_user_posts()
{
global $date_format;
if (isset($_SESSION[config("site.url")]['user'])) {
$posts = get_profile_posts($_SESSION[config("site.url")]['user'], 1, 5);
@ -696,7 +695,7 @@ function get_user_posts()
$i++;
echo '<tr class="' . $class . '">';
echo '<td><a target="_blank" href="' . $p->url . '">' . $p->title . '</a></td>';
echo '<td>' . strftime($date_format, $p->date) . '</td>';
echo '<td>' . date('d F Y', $p->date) . '</td>';
if (config("views.counter") == "true")
echo '<td>' . $p->views . '</td>';
echo '<td>' . $p->tag . '</td>';

View file

@ -24,7 +24,7 @@
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo strftime($date_format, $p->date) ?></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><a target="_blank" href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></td>

View file

@ -24,7 +24,7 @@
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo strftime($date_format, $p->date) ?></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><a target="_blank" href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></td>

View file

@ -22,7 +22,7 @@
?>
<tr class="<?php echo $class ?>">
<td><?php echo $p->title ?></td>
<td><?php echo strftime($date_format, $p->date) ?></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<td><?php echo strip_tags($p->tag) ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/draft"><?php echo i18n('Edit');?></a> <a href="<?php echo $p->url ?>/delete?destination=admin/draft"><?php echo i18n('Delete');?></a></td>
</tr>

View file

@ -3215,7 +3215,7 @@ function get_language()
setlocale(LC_ALL, 'en_US'); // Change time format to English
} else {
if (file_exists($langFile)) {
i18n('source', 'lang/' . $langID . '.ini');
i18n('source', $langFile);
setlocale(LC_ALL, $local);
} else {
i18n('source', 'lang/en.ini'); // Load the English language file
@ -3224,3 +3224,16 @@ function get_language()
}
}
function format_date($date)
{
$date_format = config('date.format');
if (!isset($date_format) || empty($date_format)) {
return date('d F Y', $date);
} else {
return date($date_format, $date);
}
}