- Timestamp:
- 09/30/08 20:14:23 (2 months ago)
- Location:
- events/phpframework/codeigniter/trunk/system/application
- Files:
-
- 3 modified
-
controllers/home.php (modified) (1 diff)
-
models/status_model.php (modified) (2 diffs)
-
views/home/main.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/controllers/home.php
r20283 r20301 11 11 redirect('login'); 12 12 } 13 //$this->output->enable_profiler(TRUE);13 $this->output->enable_profiler(TRUE); 14 14 } 15 15 -
events/phpframework/codeigniter/trunk/system/application/models/status_model.php
r20283 r20301 34 34 $this->db->where('username', $username); 35 35 $query = $this->db->get('users'); 36 $row = $query->row(); 37 return $row->id; 36 37 if ($query->num_rows() > 0) 38 { 39 $row = $query->row(); 40 return $row->id; 41 } 42 else 43 { 44 return FALSE; 45 } 38 46 } 39 47 … … 111 119 } 112 120 113 $this->db->select('SQL_CALC_FOUND_ROWS statuses.id, u sername, comment, UNIX_TIMESTAMP(statuses.created_at) AS created_at,image');121 $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'); 114 122 $this->db->from('statuses'); 115 $this->db->join('users', 'statuses.user_id = users.id', 'left'); 123 $this->db->join('users AS u1', 'statuses.user_id = u1.id', 'left'); 124 $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 116 125 $this->db->where_in('statuses.user_id', $ids); 117 126 $this->db->order_by('created_at', 'DESC'); -
events/phpframework/codeigniter/trunk/system/application/views/home/main.php
r20297 r20301 34 34 <p class="murmur"> 35 35 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 36 <?=h($row->comment)?> 36 <?php 37 $row->comment = h($row->comment); 38 if ($row->reply_username) { 39 $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 40 } 41 ?> 42 <?=$row->comment?> 37 43 <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 38 44 </p>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)