2 afwas Apr 01, 2008 17:59

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?
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
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
Hi paulo,
Do you run B2evo version 2.4?
Good luck
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.
$Item->issue_date( array(
'before' => '',
'after' => '',
'date_format' => 'F jS Y',
)
);
I missed that one. Thanks EdB.
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.
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