Recent Topics

1 May 14, 2008 03:51    

My b2evolution Version: 1.10.x

I wanted to see if there is a way to split the summary lists by year and by month so the posts would have automatically generated year like 2008 as a list item and the same with month. Right now it generates the the whole date but i want to break this into months and year for easier reading.

<li>year</li>
<li>current month</li>
<li>normal posts</li>
<li>etc..</li>

<li>last month</li>
<li>normal posts</li>
<li>etc..</li>

looked over the forums and looking at technical docs for hints.
http://doc.b2evolution.net/v-1-10/evocore/ItemList.html

looks like i might have to write a function that parses out the
<?php $Item->issue_date() ?>

but wanted to see if anybody else had other suggestions.

thanks!

2 May 14, 2008 12:54

if( empty( $curr_year ) || $curr_year != date( 'Y', mysql2timestamp( $Item->get( 'issue_date' ) ) ) )
{ // year change
  $curr_year = date( 'Y', mysql2timestamp( $Item->get( 'issue_date' ) ) ;
  echo 'Year : '.$curr_year;
}

if( empty( $curr_month ) || $curr_month != date( 'm', mysql2timestamp( $Item->get( 'issue_date' ) ) ) )
{ // month change
  $curr_month = date( 'm', mysql2timestamp( $Item->get( 'issue_date' ) ) ;
  echo 'Month : '.$curr_month;
}

¥


Form is loading...