Skip to content

Commit

Permalink
Revert back the date_format
Browse files Browse the repository at this point in the history
We will change the date format in one go later.
  • Loading branch information
danpros committed May 4, 2020
1 parent 73e103b commit 0fc0d12
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
3 changes: 1 addition & 2 deletions system/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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>';
Expand Down
2 changes: 1 addition & 1 deletion system/admin/views/popular-posts.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion system/admin/views/posts-list.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion system/admin/views/user-draft.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
15 changes: 14 additions & 1 deletion system/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

}
2 changes: 1 addition & 1 deletion themes/twentyfifteen/profile.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$i++; ?>
<li class="<?php echo $class; ?>">
<span><a href="<?php echo $p->url ?>"><?php echo $p->title ?></a></span> on
<span><?php echo strftime($date_format, $p->date) ?></span> - <?php echo i18n('Posted_in');?> <span><?php echo $p->tag ?></span>
<span><?php echo date('d F Y', $p->date) ?></span> - <?php echo i18n('Posted_in');?> <span><?php echo $p->tag ?></span>
</li>
<?php endforeach; ?>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion themes/twentysixteen/main.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<footer class="entry-footer">
<span class="byline"><span class="author vcard"><a href="<?php echo $p->authorUrl;?>"><img alt="<?php echo $p->author;?>" src="<?php echo site_url();?>themes/twentysixteen/img/avatar.png" class="avatar avatar-49 grav-hashed grav-hijack" height="49" width="49"></a><span class="screen-reader-text">Author </span> <a class="url fn n" href="<?php echo $p->authorUrl;?>"><?php echo $p->author;?></a></span></span>
<span class="posted-on"><span class="screen-reader-text"><?php echo i18n('Posted_on');?> </span><a href="<?php echo $p->url;?>" rel="bookmark"><time class="entry-date published"><?php global $date_format; echo strftime($date_format, $p->date) ?></time></a></span>
<span class="posted-on"><span class="screen-reader-text"><?php echo i18n('Posted_on');?> </span><a href="<?php echo $p->url;?>" rel="bookmark"><time class="entry-date published"><?php echo date('d F Y', $p->date) ?></time></a></span>
<span class="cat-links"><span class="screen-reader-text"><?php echo i18n('Category');?> </span><?php echo $p->category;?></span>
<span class="tags-links"><span class="screen-reader-text">Tags </span><?php echo $p->tag;?></span>
<?php if (disqus_count()) { ?>
Expand Down
2 changes: 1 addition & 1 deletion themes/twentysixteen/post.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<footer class="entry-footer">
<span class="byline"><span class="author vcard"><a href="<?php echo $p->authorUrl;?>"><img alt="<?php echo $p->author;?>" title="<?php echo $p->author;?>" src="<?php echo site_url();?>themes/twentysixteen/img/avatar.png" class="avatar avatar-49 grav-hashed grav-hijack" height="49" width="49"/></a><span class="screen-reader-text">Author </span> <a class="url fn n" href="<?php echo $p->authorUrl;?>"><?php echo $p->author;?></a></span></span>

<span class="posted-on"><span class="screen-reader-text">Posted on </span><a href="<?php echo $p->url;?>" rel="bookmark"><time class="entry-date published"><?php echo strftime($date_format, $p->date) ?></time></a></span>
<span class="posted-on"><span class="screen-reader-text">Posted on </span><a href="<?php echo $p->url;?>" rel="bookmark"><time class="entry-date published"><?php echo date('d F Y', $p->date) ?></time></a></span>

<span class="cat-links"><span class="screen-reader-text"><?php echo i18n('Category');?> </span><?php echo $p->category;?></span>

Expand Down

0 comments on commit 0fc0d12

Please sign in to comment.