- Timestamp:
- 10/06/08 10:52:31 (2 months ago)
- Location:
- events/phpframework/codeigniter/trunk/system/application
- Files:
-
- 13 modified
-
config/config.php (modified) (1 diff)
-
config/database.php (modified) (1 diff)
-
controllers/public_timeline.php (modified) (1 diff)
-
controllers/status.php (modified) (1 diff)
-
helpers/MY_url_helper.php (modified) (4 diffs)
-
models/status_model.php (modified) (3 diffs)
-
views/home/main.php (modified) (1 diff)
-
views/home/main_archive.php (modified) (1 diff)
-
views/home/main_reply.php (modified) (1 diff)
-
views/public_timeline/main.php (modified) (1 diff)
-
views/public_timeline/main_logged_in.php (modified) (1 diff)
-
views/user/main.php (modified) (1 diff)
-
views/user/main_comment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/config/config.php
r20831 r20833 174 174 | 175 175 */ 176 $config['log_threshold'] = 4;176 $config['log_threshold'] = 1; 177 177 178 178 /* -
events/phpframework/codeigniter/trunk/system/application/config/database.php
r20831 r20833 47 47 $db['default']['db_debug'] = TRUE; 48 48 $db['default']['cache_on'] = FALSE; 49 $db['default']['cachedir'] = BASEPATH . "cache/";49 $db['default']['cachedir'] = ""; 50 50 $db['default']['char_set'] = "utf8"; 51 51 $db['default']['dbcollat'] = "utf8_general_ci"; -
events/phpframework/codeigniter/trunk/system/application/controllers/public_timeline.php
r20831 r20833 11 11 function index() 12 12 { 13 $this->output->enable_profiler(TRUE);14 15 13 $this->load->helper('url'); 16 14 $this->load->model('Status_model', '', TRUE); 17 15 18 $this->db->cache_on(); 16 19 17 $data->list = $this->Status_model->get_public_timeline(); 20 $this->db->cache_off();21 22 18 $data->title = 'Phwittr'; 23 19 -
events/phpframework/codeigniter/trunk/system/application/controllers/status.php
r20831 r20833 66 66 $data->image = $this->session->userdata('image'); 67 67 68 $comment = auto_link(h($comment), 'url');68 $comment = h($comment); 69 69 if ($reply_username) { 70 70 $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 1 1 <?php 2 2 3 /* 本来は HTML helper かな */4 3 function h($string) 5 4 { 6 return htmlspecialchars($string, ENT_QUOTES);5 return htmlspecialchars($string, ENT_QUOTES); 7 6 } 8 7 9 /* 本来は HTML helper かな */10 8 function picture($username, $image, $size, $class) 11 9 { … … 69 67 } 70 68 71 /* 本来は HTML helper かな */72 69 function my_pict($size) 73 70 { … … 78 75 } 79 76 80 /* 本来は HTML helper かな */81 77 function js($js = 'default', $timestamp = TRUE) 82 78 { … … 127 123 return $str; 128 124 } 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 6 6 { 7 7 parent::Model(); 8 $this->load->helper('date'); 8 9 } 9 10 … … 23 24 $statuses->reply_user_id = ''; 24 25 } 25 26 $this->load->helper('date');27 26 $statuses->comment = $comment; 28 27 $statuses->created_at = mdate('%Y-%m-%d %H:%i:%s'); 29 28 30 if ($this->db->insert('statuses', $statuses)) 31 { 32 $this->db->cache_delete('public_timeline', 'index'); 33 } 29 $this->db->insert('statuses', $statuses); 34 30 $id = $this->db->insert_id(); 35 31 … … 64 60 $statuses['user_id'] = $user_id; 65 61 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)); 72 63 } 73 64 -
events/phpframework/codeigniter/trunk/system/application/views/home/main.php
r20831 r20833 34 34 <p class="murmur"> 35 35 <?=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); 38 38 if ($row->reply_username) { 39 39 $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 34 34 <td> 35 35 <p class="murmur"> 36 <?php 37 $row->comment = auto_link(h($row->comment), 'url');36 <?php 37 $row->comment = h($row->comment); 38 38 if ($row->reply_username) { 39 39 $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 35 35 <p class="murmur"> 36 36 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 37 <?= auto_link(h($row->comment), 'url')?>37 <?=h($row->comment)?> 38 38 <?=anchor(site_url('user/statuses/' . $row->username . '/' . $row->id), posted_time($row->created_at))?> 39 39 </p> -
events/phpframework/codeigniter/trunk/system/application/views/public_timeline/main.php
r20831 r20833 12 12 <p class="murmur"> 13 13 <?=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); 16 16 if ($row->reply_username) { 17 17 $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 34 34 <p class="murmur"> 35 35 <?=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); 38 38 if ($row->reply_username) { 39 39 $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 71 71 <td> 72 72 <p class="murmur"> 73 <?php 74 $row->comment = auto_link(h($row->comment), 'url');73 <?php 74 $row->comment = h($row->comment); 75 75 if ($row->reply_username) { 76 76 $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 5 5 <?php foreach($list as $row):?> 6 6 <p> 7 <?php 8 $row->comment = auto_link(h($row->comment), 'url');7 <?php 8 $row->comment = h($row->comment); 9 9 if ($row->reply_username) { 10 10 $row->comment = preg_replace('/^@(\w+)\s/', '@' . anchor(site_url('user/index/' . $row->reply_username), $row->reply_username) . ' ', $row->comment);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)