matt-d-rat/MF-Timeline — Issue #14: show the author's avatar on a 'timeline story'
Author: joblammers
Created: 2012-03-03 19:52:41+00:00
State: open

Hi I've added a the option show the Avatar of the writer of the timeline story on the timeline story. I'm not sure weather this is the right place to post this suggestion/solution (if not, sorry)

To make this work the SQL statement in the function ```get_content_stories()``` be changed
**from (line 808):**
```$sql = "SELECT story_id AS id, story_title AS title, story_content AS content, timeline_date AS date, featured FROM {$this->table_mf_timeline_stories}";
```
**to (line 808):**
```$sql = "SELECT story_id AS id, story_title AS title, story_content AS content, timeline_date AS date, story_author AS author, featured FROM {$this->table_mf_timeline_stories}";
```
The switch() in the function ```get_timeline()``` has to be changed as well.

On **line 952** I've added the following line to show the avatar before the timeline title
```$html .= get_avatar($event['author'], 50 );```

The ```case``` looks now as follows:
```
case 'timeline_stories' :
$class = ( $event['featured'] == 1 ) ? ' featured' : null;
$html .= '
';
$html .= '

';
$html .= '

';
$html .= '

';
$html .= get_avatar($event['author'], 50 );
$html .= '

' . stripslashes($event['title'] ) . '

';

$html .= '';
$html .= $this->format_date( $event['date'] );
$html .= '';
$html .= '

';

$html .= '

';
$html .= apply_filters( 'the_content', $this->format_text( stripslashes( $event['content'] ) ) );
$html .= '

';
$html .= '

';
$html .= '
';
break;
```