- Timestamp:
- 09/30/08 21:04:49 (2 months ago)
- Location:
- events/phpframework/codeigniter/trunk/system/application
- Files:
-
- 2 modified
-
models/status_model.php (modified) (2 diffs)
-
views/user/main_comment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/models/status_model.php
r20302 r20309 154 154 function get_last_comment($id) 155 155 { 156 $this->db->select('SQL_CALC_FOUND_ROWS statuses.comment ');156 $this->db->select('SQL_CALC_FOUND_ROWS statuses.comment, username AS reply_username'); 157 157 $this->db->from('statuses'); 158 $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 158 159 $this->db->where('user_id', $id); 159 $this->db->order_by(' created_at', 'DESC');160 $this->db->order_by('statuses.created_at', 'DESC'); 160 161 $this->db->limit(1, 0); 161 162 $query = $this->db->get(); … … 180 181 function get_comment($id) 181 182 { 182 $this->db->select(' statuses.id, username, comment, UNIX_TIMESTAMP(statuses.created_at) AS created_at,image');183 $this->db->select('SQL_CALC_FOUND_ROWS statuses.id, u1.username AS username, comment, u2.username AS reply_username, UNIX_TIMESTAMP(statuses.created_at) AS created_at, u1.image AS image'); 183 184 $this->db->from('statuses'); 184 $this->db->join('users', 'statuses.user_id = users.id', 'left'); 185 $this->db->join('users AS u1', 'statuses.user_id = u1.id', 'left'); 186 $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 185 187 $this->db->where('statuses.id', $id); 186 188 $this->db->limit(1, 0); -
events/phpframework/codeigniter/trunk/system/application/views/user/main_comment.php
r19981 r20309 5 5 <?php foreach($list as $row):?> 6 6 <p> 7 <?=h($row->comment)?> 7 <?php 8 $row->comment = h($row->comment); 9 if ($row->reply_username) { 10 $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 11 } 12 ?> 13 <?=$row->comment?> 8 14 <?=posted_time($row->created_at)?> 9 15 </p>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)