Permalink
Browse files

Fixed undefined var on contributor profile page

  • Loading branch information...
1 parent d6f5ce2 commit d12ff5807b69867a42e0917bf3b3a8d0cd955582 @katzgrau committed Dec 10, 2011
Showing with 7 additions and 2 deletions.
  1. +6 −1 application/models/contributor.php
  2. +1 −1 application/views/packages/_list.php
@@ -84,7 +84,12 @@ public function getContributions()
{
$CI = &get_instance();
$CI->load->model('spark');
- return $CI->db->get_where('sparks', array('contributor_id' => $this->id))->result('Spark');
+ $CI->db->select("s.*, s.created, MAX(v.created) AS 'last_push'");
+ $CI->db->join('versions v', 'v.spark_id = s.id');
+ $CI->db->group_by('s.id');
+ $CI->db->order_by('s.created DESC, v.created DESC');
+
+ return $CI->db->get_where('sparks s', array('contributor_id' => $this->id))->result('Spark');
}
/**
@@ -19,7 +19,7 @@
<td><a href="<?php echo base_url(); ?>packages/<?php echo $spark->name; ?>/versions/HEAD/show"><?php echo $spark->name; ?></a></td>
<td><?php echo $spark->summary; ?></td>
<td>High</td>
- <td><?php echo $spark->last_push; ?></td>
+ <td><?php echo date('F j, Y', strtotime($spark->last_push)); ?></td>
</tr>
<?php endforeach; ?>
</tbody>

0 comments on commit d12ff58

Please sign in to comment.