FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Article dates not showing up - fresh install

Feed 6 posts, 2 voices

Avatar
12 posts

Hi there,

I’m new to FrogCMS, and so far I’m loving it.
I do however have a small, yet annoying problem, which seems to be an issue when I search the forum..
No article dates show up on my page, even though they are registered in the metadata.
In my code (below) I’m using an article listing and last article. Neither displays dates.

This is my code:

       			<div id="cmenu3">
<?php $page_article = $this->find('/articles/'); ?>
<span class="title3"><strong>Recent blog posts</strong></span><br /><br />
<?php foreach ($page_article->children(array('limit' => 7, 'offset' => 1, 'order' => 'page.created_on DESC')) as $article): ?>
<strong><?php echo $article->date(); ?> &#183;</strong> <?php echo $article->link(); ?><br />
<?php endforeach; ?>
       			</div>
       			<div id="cmenu4">
<?php $last_article = $page_article->children(array('limit' => 1, 'order' => 'page.created_on DESC')); ?>
<span class="title3"><strong>Latest post</strong></span><br />
<?php echo $last_article->link(); ?><br />
<br />
<?php echo $last_article->content(); ?>
<?php if ($last_article->hasContent('extended')) echo $last_article->link('&nbsp;&nbsp; More'); ?>
<?php echo $last_article->date(); ?>
       			</div>
 
Avatar
12 posts

anyone? :/

Here’s the page on my new website: http://www.dobson.be/files/work/dobson/coded/?home

 
Avatar
76 posts

Hi uggi, I think you need to use this instead of date():

$article->created_on;
 
Avatar
12 posts

Thanks Craig, that works perfectly. Do you also know how to customize the formats?
I’ve been trying <?php echo $article->created_on('%A, %e %B %Y'); ?> but that doesn’t seem to work.

 
Avatar
12 posts

Hmm.. this doesnt seem to be a very active forum :)

 
Avatar
76 posts

Just use the PHP date function. Like this:

date('j F Y', strtotime($article->created_on));

The forum is what the community make of it. Frog does not employ anyone to constantly monitor the forum for posts, so it relies on the free time of its members; who may or may not have jobs and families etc :)

 
Avatar
12 posts

Just what I needed. Thanks alot :)