1 paulo Apr 01, 2008 17:14
3 paulo Apr 02, 2008 08:48
Thanks!
After reading and some trial and error, I kinda figured it out
$MainList->date_if_changed( array(
'before' => ' ',
'after' => ' ',
'date_format' => 'F jS Y',
) );
Is there anyway of having the date show on every post instead on only when it changes?
4 afwas Apr 02, 2008 12:47
Hi Paulo,
$Item->issue_date( array(
'before' => '',
'after' => '',
'date_format' => 'Y-m-d',
)
);
This is a link to the manual for PHPs date() function: http://php.net/date with more information on how the change the output.
Good luck
5 paulo Apr 02, 2008 16:48
I changed the code to this
$MainList->issue_date( array(
'before' => ' ',
'after' => ' ',
'date_format' => 'F jS Y',
) );
Now I get this on my site
Fatal error: Call to undefined function: issue_date() in .../index.main.php
6 afwas Apr 02, 2008 16:51
Hi paulo,
Do you run B2evo version 2.4?
Good luck
7 edb Apr 02, 2008 17:04
date_if_changed() is a function that $MainList knows what to do with. It will put a date on the page IF the next post is from a day different than the previous post. issue_date() is a function that $Item knows what to do with. It will put the date an Item was published on the page.
$MainList doesn't know what $Item knows, so when you took $Item's issue_date() and stuck it on $MainList you made $MainList cry.
Make sense? both of those functions understand what the php.net/date page talks about, but those functions can't go wherever you put them because the thing their called by has to know what the function does. So put your 'F jS Y' in "issue_date" on an $Item or "date_if_changed" on a $MainList - not "issue_date" on a $MainList.
8 afwas Apr 02, 2008 17:07
$Item->issue_date( array(
'before' => '',
'after' => '',
'date_format' => 'F jS Y',
)
);
I missed that one. Thanks EdB.
9 edb Apr 02, 2008 17:10
Or
$MainList->date_if_changed( array(
'before' => '',
'after' => '',
'date_format' => 'F jS Y',
)
);
Just don't put issue_date on $MainList because, as you've seen, it won't work.
10 paulo Apr 02, 2008 17:59
Thank you for everyone's response.
I think I am up and running now.
$Item->issue_date( array(
'before' => ' ',
'after' => ' ',
'date_format' => 'F jS Y',
) );
Hi Paulo,
This is well described here: http://manual.b2evolution.net/Tag_item_issue_date
If you have subsequent questions, please report back.
Good luck