Blog Post date format

Permalink Browser Info Environment
I'm a first time user of your CD5K Blog addon, and have only been using Concrete5 for the last few months, so please forgive me if I've asked a question that has been covered somewhere already.

Referencing the attachment, I'd like to change the timestamp format to read 'Month day, year' (i.e. September 26, 2017) instead of 'year-month-day hour-minute-second' (i.e. 2017-09-06 19:33:27) for all blog posts. Is this possible?

Thank you for your help.
- Heath Griffin

1 Attachment

Type: Ticket
Status: Archived
heathgriffin
View Replies:
C5DK replied on at Permalink Reply 1 Attachment
C5DK
Hi,

This is one of those things where I need you to understand a little about php programming and concrete5.

You have to make a template for the "c5dk_blog_header" block. Then you have to add this code to the new template:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<div class="c5dk_headline">
    <?php echo t('Posted by'); echo ' <i class="fa fa-user"></i> ' . ($C5dkUser->fullName? $C5dkUser->fullName : t('(Not set)')) . ' - <i class="fa fa-clock-o"></i> ' . $C5dkBlog->getCollectionDatePublicObject()->format('F j, Y'); ?>
</div>
<style type="text/css">
.c5dk_headline {
    color: <?= $C5dkConfig->blog_headline_color; ?>
    font-size: <?= $C5dkConfig->blog_headline_size; ?>px;
    margin: <?= $C5dkConfig->blog_headline_margin; ?>;
}
.c5dk_headline i {
    color: <?= $C5dkConfig->blog_headline_icon_color; ?>;
}
</style>


The only change from the default is:
$C5dkBlog->getCollectionDatePublicObject()->format('F j, Y');


By this you can change it according to the settings described here:
http://php.net/manual/en/function.date.php...

I have attached a zip file containing the actually template. You should simply drop the content of the zip file to the folder: /packages/c5dk_blog/blocks/c5dk_blog_header

Hope this helps out...
heathgriffin replied on at Permalink Reply
heathgriffin
Once again, you nail it! I know I've been needy with support, but I greatly appreciate all your help!

- Heath
admin replied on at Permalink Reply
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.

To re-open this issue, reply to this message.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.1.0
Version Installed - 8.1.0
Database Version - 20170123000000

# concrete5 Packages
C5DK Blog (8.0.6.7)

# concrete5 Overrides
languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, themes/sinusandnasal/conditions-page.php, themes/sinusandnasal/default.php, themes/sinusandnasal/description.txt, themes/sinusandnasal/education-page.php, themes/sinusandnasal/full.php, themes/sinusandnasal/interior-page.php, themes/sinusandnasal/page_theme.php, themes/sinusandnasal/resources-page.php, themes/sinusandnasal/thumbnail.png, themes/sinusandnasal/css/conditions-style.css, themes/sinusandnasal/css/index-style.css, themes/sinusandnasal/css/interior-style.css, themes/sinusandnasal/css/media-queries.css, themes/sinusandnasal/css/mobile.css, themes/sinusandnasal/css/style.css, themes/sinusandnasal/css, themes/sinusandnasal/elements/footer-scripts.php, themes/sinusandnasal/elements/conditions-header-bottom.php, themes/sinusandnasal/elements/footer.php, themes/sinusandnasal/elements/full-header-bottom.php, themes/sinusandnasal/elements/full-header-top.php, themes/sinusandnasal/elements/interior-header-bottom.php, themes/sinusandnasal/elements/subfooter.php, themes/sinusandnasal/elements, themes/sinusandnasal/images/close-menu.png, themes/sinusandnasal/images/dark-blue-bkgd.png, themes/sinusandnasal/images/dr-barham.png, themes/sinusandnasal/images/dr-hall.png, themes/sinusandnasal/images/facebook-icon-hover.png, themes/sinusandnasal/images/facebook-icon.png, themes/sinusandnasal/images/home-masthead.jpg, themes/sinusandnasal/images/light-blue-bkgd.png, themes/sinusandnasal/images/logo-small.png, themes/sinusandnasal/images/logo.png, themes/sinusandnasal/images/payment-arrow-hover.png, themes/sinusandnasal/images/payment-arrow.png, themes/sinusandnasal/images/show-menu.png, themes/sinusandnasal/images/very-light-blue-bkgd.png, themes/sinusandnasal/images/education/nasal-irrigation.jpg, themes/sinusandnasal/images/education/steroid.jpg, themes/sinusandnasal/images/education, themes/sinusandnasal/images, themes/sinusandnasal/blog.php, themes/sinusandnasal, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, themes/sinusandnasal/conditions-page.php, themes/sinusandnasal/default.php, themes/sinusandnasal/description.txt, themes/sinusandnasal/education-page.php, themes/sinusandnasal/full.php, themes/sinusandnasal/interior-page.php, themes/sinusandnasal/page_theme.php, themes/sinusandnasal/resources-page.php, themes/sinusandnasal/thumbnail.png, themes/sinusandnasal/css/conditions-style.css, themes/sinusandnasal/css/index-style.css, themes/sinusandnasal/css/interior-style.css, themes/sinusandnasal/css/media-queries.css, themes/sinusandnasal/css/mobile.css, themes/sinusandnasal/css/style.css, themes/sinusandnasal/css, themes/sinusandnasal/elements/footer-scripts.php, themes/sinusandnasal/elements/conditions-header-bottom.php, themes/sinusandnasal/elements/footer.php, themes/sinusandnasal/elements/full-header-bottom.php, themes/sinusandnasal/elements/full-header-top.php, themes/sinusandnasal/elements/interior-header-bottom.php, themes/sinusandnasal/elements/subfooter.php, themes/sinusandnasal/elements, themes/sinusandnasal/images/close-menu.png, themes/sinusandnasal/images/dark-blue-bkgd.png, themes/sinusandnasal/images/dr-barham.png, themes/sinusandnasal/images/dr-hall.png, themes/sinusandnasal/images/facebook-icon-hover.png, themes/sinusandnasal/images/facebook-icon.png, themes/sinusandnasal/images/home-masthead.jpg, themes/sinusandnasal/images/light-blue-bkgd.png, themes/sinusandnasal/images/logo-small.png, themes/sinusandnasal/images/logo.png, themes/sinusandnasal/images/payment-arrow-hover.png, themes/sinusandnasal/images/payment-arrow.png, themes/sinusandnasal/images/show-menu.png, themes/sinusandnasal/images/very-light-blue-bkgd.png, themes/sinusandnasal/images/education/nasal-irrigation.jpg, themes/sinusandnasal/images/education/steroid.jpg, themes/sinusandnasal/images/education, themes/sinusandnasal/images, themes/sinusandnasal/blog.php, themes/sinusandnasal

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
litespeed

# PHP Version
5.5.38

# PHP Extensions
bcmath, bz2, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, ionCube Loader, json, ldap, libxml, litespeed, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, odbc, openssl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, Reflection, session, shmop, SimpleXML, soap, sockets, SourceGuardian, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 300
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 300
max_input_vars - 10000
memory_limit - 128M
post_max_size - 64M
sql.safe_mode - Off
upload_max_filesize - 64M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5
zend_optimizerplus.max_accelerated_files - 2000
zend_optimizerplus.max_file_size - 0
zend_optimizerplus.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.