Changeset 20302 for events

Show
Ignore:
Timestamp:
09/30/08 20:28:43 (2 months ago)
Author:
kenji
Message:

Add link to @username

Location:
events/phpframework/codeigniter/trunk/system/application
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/codeigniter/trunk/system/application/controllers/home.php

    r20301 r20302  
    1111                        redirect('login'); 
    1212                } 
    13                 $this->output->enable_profiler(TRUE); 
     13                //$this->output->enable_profiler(TRUE); 
    1414        } 
    1515 
     
    4545                                                                        $this->User_model->get_friends_list($id); 
    4646                $data->followers_count = $this->User_model->get_followers_count($id); 
    47                  
     47 
    4848                $data->title  = 'Phwittr'; 
    4949                $data->header = $this->load->view('home/header', '', TRUE); 
  • events/phpframework/codeigniter/trunk/system/application/models/status_model.php

    r20301 r20302  
    7878        function get_public_timeline($limit = 20, $offset = 0) 
    7979        { 
    80                 $this->db->select('statuses.id, username, comment, UNIX_TIMESTAMP(statuses.created_at) AS created_at, image'); 
     80                $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'); 
    8181                $this->db->from('statuses'); 
    82                 $this->db->join('users', 'statuses.user_id = users.id', 'left'); 
     82                $this->db->join('users AS u1', 'statuses.user_id = u1.id', 'left'); 
     83                $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 
    8384                $this->db->order_by('created_at', 'DESC'); 
    8485                $this->db->limit($limit, $offset); 
     
    8990        function get_archive_timeline($id, $limit = 20, $offset = 0) 
    9091        { 
    91                 $this->db->select('SQL_CALC_FOUND_ROWS statuses.id, username, comment, UNIX_TIMESTAMP(statuses.created_at) AS created_at, image'); 
     92                $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'); 
    9293                $this->db->from('statuses'); 
    93                 $this->db->join('users', 'statuses.user_id = users.id', 'left'); 
    94                 $this->db->where('users.id', $id); 
     94                $this->db->join('users AS u1', 'statuses.user_id = u1.id', 'left'); 
     95                $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 
     96                $this->db->where('u1.id', $id); 
    9597                $this->db->order_by('created_at', 'DESC'); 
    9698                $this->db->limit($limit, $offset); 
  • events/phpframework/codeigniter/trunk/system/application/views/home/main_archive.php

    r20297 r20302  
    3434                        <td> 
    3535                                <p class="murmur"> 
    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?> 
    3743                                <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 
    3844                                </p> 
  • events/phpframework/codeigniter/trunk/system/application/views/public_timeline/main.php

    r19981 r20302  
    1111                                <p class="murmur"> 
    1212                                <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 
    13                                 <?=h($row->comment)?> 
     13                                <?php  
     14                                        $row->comment = h($row->comment); 
     15                                        if ($row->reply_username) { 
     16                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
     17                                        } 
     18                                ?> 
     19                                <?=$row->comment?> 
    1420                                <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 
    1521                                </p> 
  • events/phpframework/codeigniter/trunk/system/application/views/public_timeline/main_logged_in.php

    r20297 r20302  
    3434                                <p class="murmur"> 
    3535                                <?=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?> 
    3743                                <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 
    3844                                </p>