Changeset 20833 for events

Show
Ignore:
Timestamp:
10/06/08 10:52:31 (2 months ago)
Author:
kenji
Message:

Revert to r20829

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

Legend:

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

    r20831 r20833  
    174174| 
    175175*/ 
    176 $config['log_threshold'] = 4; 
     176$config['log_threshold'] = 1; 
    177177 
    178178/* 
  • events/phpframework/codeigniter/trunk/system/application/config/database.php

    r20831 r20833  
    4747$db['default']['db_debug'] = TRUE; 
    4848$db['default']['cache_on'] = FALSE; 
    49 $db['default']['cachedir'] = BASEPATH . "cache/"; 
     49$db['default']['cachedir'] = ""; 
    5050$db['default']['char_set'] = "utf8"; 
    5151$db['default']['dbcollat'] = "utf8_general_ci"; 
  • events/phpframework/codeigniter/trunk/system/application/controllers/public_timeline.php

    r20831 r20833  
    1111        function index() 
    1212        { 
    13                 $this->output->enable_profiler(TRUE); 
    14  
    1513                $this->load->helper('url'); 
    1614                $this->load->model('Status_model', '', TRUE); 
    1715 
    18 $this->db->cache_on(); 
     16 
    1917                $data->list   = $this->Status_model->get_public_timeline(); 
    20 $this->db->cache_off(); 
    21  
    2218                $data->title  = 'Phwittr'; 
    2319 
  • events/phpframework/codeigniter/trunk/system/application/controllers/status.php

    r20831 r20833  
    6666                        $data->image    = $this->session->userdata('image'); 
    6767                         
    68                         $comment = auto_link(h($comment), 'url'); 
     68                        $comment = h($comment); 
    6969                        if ($reply_username) { 
    7070                                $comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $reply_username), $reply_username) . ' ', $comment); 
  • events/phpframework/codeigniter/trunk/system/application/helpers/MY_url_helper.php

    r20831 r20833  
    11<?php 
    22 
    3 /* 本来は HTML helper かな */ 
    43function h($string) 
    54{ 
    6         return htmlspecialchars($string, ENT_QUOTES); 
     5    return htmlspecialchars($string, ENT_QUOTES); 
    76} 
    87 
    9 /* 本来は HTML helper かな */ 
    108function picture($username, $image, $size, $class) 
    119{ 
     
    6967} 
    7068 
    71 /* 本来は HTML helper かな */ 
    7269function my_pict($size) 
    7370{ 
     
    7875} 
    7976 
    80 /* 本来は HTML helper かな */ 
    8177function js($js = 'default', $timestamp = TRUE) 
    8278{ 
     
    127123        return $str; 
    128124} 
    129  
    130 /* auto_link() を一部修正 */ 
    131 if ( ! function_exists('auto_link')) 
    132 { 
    133         function auto_link($str, $type = 'both', $popup = FALSE) 
    134         { 
    135                 if ($type != 'email') 
    136                 {                
    137                         if (preg_match_all("#((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) 
    138                         { 
    139                                 $pop = ($popup == TRUE) ? " target=\"_blank\" " : ""; 
    140  
    141                                 for ($i = 0; $i < sizeof($matches['0']); $i++) 
    142                                 { 
    143                                         $period = ''; 
    144                                         if (preg_match("|\.$|", $matches['5'][$i])) 
    145                                         { 
    146                                                 $period = '.'; 
    147                                                 $matches['5'][$i] = substr($matches['5'][$i], 0, -1); 
    148                                         } 
    149  
    150                                         $str = str_replace($matches['0'][$i], 
    151                                                                                 '<a href="http'. 
    152                                                                                 $matches['3'][$i].'://'. 
    153                                                                                 $matches['4'][$i]. 
    154                                                                                 $matches['5'][$i].'"'.$pop.'>http'. 
    155                                                                                 $matches['3'][$i].'://'. 
    156                                                                                 $matches['4'][$i]. 
    157                                                                                 $matches['5'][$i].'</a>'. 
    158                                                                                 $period, $str); 
    159                                 } 
    160                         } 
    161                 } 
    162  
    163                 if ($type != 'url') 
    164                 {        
    165                         if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) 
    166                         { 
    167                                 for ($i = 0; $i < sizeof($matches['0']); $i++) 
    168                                 { 
    169                                         $period = ''; 
    170                                         if (preg_match("|\.$|", $matches['3'][$i])) 
    171                                         { 
    172                                                 $period = '.'; 
    173                                                 $matches['3'][$i] = substr($matches['3'][$i], 0, -1); 
    174                                         } 
    175  
    176                                         $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); 
    177                                 } 
    178  
    179                         } 
    180                 } 
    181                 return $str; 
    182         } 
    183 } 
  • events/phpframework/codeigniter/trunk/system/application/models/status_model.php

    r20831 r20833  
    66        { 
    77                parent::Model(); 
     8                $this->load->helper('date'); 
    89        } 
    910 
     
    2324                        $statuses->reply_user_id = ''; 
    2425                } 
    25  
    26                 $this->load->helper('date'); 
    2726                $statuses->comment       = $comment; 
    2827                $statuses->created_at    = mdate('%Y-%m-%d %H:%i:%s'); 
    2928 
    30                 if ($this->db->insert('statuses', $statuses)) 
    31                 { 
    32                         $this->db->cache_delete('public_timeline', 'index'); 
    33                 } 
     29                $this->db->insert('statuses', $statuses); 
    3430                $id = $this->db->insert_id(); 
    3531 
     
    6460                $statuses['user_id'] = $user_id; 
    6561 
    66                 if ($ret = $this->db->delete('statuses', $statuses)) 
    67                 { 
    68                         $this->db->cache_delete('public_timeline', 'index'); 
    69                 } 
    70  
    71                 return $ret; 
     62                return($this->db->delete('statuses', $statuses)); 
    7263        } 
    7364 
  • events/phpframework/codeigniter/trunk/system/application/views/home/main.php

    r20831 r20833  
    3434                                <p class="murmur"> 
    3535                                <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 
    36                                 <?php 
    37                                         $row->comment = auto_link(h($row->comment), 'url'); 
     36                                <?php  
     37                                        $row->comment = h($row->comment); 
    3838                                        if ($row->reply_username) { 
    3939                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
  • events/phpframework/codeigniter/trunk/system/application/views/home/main_archive.php

    r20831 r20833  
    3434                        <td> 
    3535                                <p class="murmur"> 
    36                                 <?php 
    37                                         $row->comment = auto_link(h($row->comment), 'url'); 
     36                                <?php  
     37                                        $row->comment = h($row->comment); 
    3838                                        if ($row->reply_username) { 
    3939                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
  • events/phpframework/codeigniter/trunk/system/application/views/home/main_reply.php

    r20831 r20833  
    3535                                <p class="murmur"> 
    3636                                <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 
    37                                 <?=auto_link(h($row->comment), 'url')?> 
     37                                <?=h($row->comment)?> 
    3838                                <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 
    3939                                </p> 
  • events/phpframework/codeigniter/trunk/system/application/views/public_timeline/main.php

    r20831 r20833  
    1212                                <p class="murmur"> 
    1313                                <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 
    14                                 <?php 
    15                                         $row->comment = auto_link(h($row->comment), 'url'); 
     14                                <?php  
     15                                        $row->comment = h($row->comment); 
    1616                                        if ($row->reply_username) { 
    1717                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
  • events/phpframework/codeigniter/trunk/system/application/views/public_timeline/main_logged_in.php

    r20831 r20833  
    3434                                <p class="murmur"> 
    3535                                <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 
    36                                 <?php 
    37                                         $row->comment = auto_link(h($row->comment), 'url'); 
     36                                <?php  
     37                                        $row->comment = h($row->comment); 
    3838                                        if ($row->reply_username) { 
    3939                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
  • events/phpframework/codeigniter/trunk/system/application/views/user/main.php

    r20831 r20833  
    7171                        <td> 
    7272                                <p class="murmur"> 
    73                                 <?php 
    74                                         $row->comment = auto_link(h($row->comment), 'url'); 
     73                                <?php  
     74                                        $row->comment = h($row->comment); 
    7575                                        if ($row->reply_username) { 
    7676                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment); 
  • events/phpframework/codeigniter/trunk/system/application/views/user/main_comment.php

    r20831 r20833  
    55                <?php foreach($list as $row):?> 
    66                                <p> 
    7                                 <?php 
    8                                         $row->comment = auto_link(h($row->comment), 'url'); 
     7                                <?php  
     8                                        $row->comment = h($row->comment); 
    99                                        if ($row->reply_username) { 
    1010                                                $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment);