- Timestamp:
- 10/06/08 10:59:08 (2 months ago)
- Location:
- events/phpframework/codeigniter/trunk/system/application
- Files:
-
- 9 modified
-
controllers/status.php (modified) (2 diffs)
-
helpers/MY_url_helper.php (modified) (4 diffs)
-
views/home/main.php (modified) (2 diffs)
-
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) (2 diffs)
-
views/user/main_comment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/controllers/status.php
r20833 r20834 1 1 <?php 2 2 3 3 class Status extends Controller 4 4 { … … 66 66 $data->image = $this->session->userdata('image'); 67 67 68 $comment = h($comment);68 $comment = auto_link(h($comment), 'url'); 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
r20833 r20834 1 1 <?php 2 2 3 /* 本来は HTML helper かな */ 3 4 function h($string) 4 5 { 5 return htmlspecialchars($string, ENT_QUOTES);6 return htmlspecialchars($string, ENT_QUOTES); 6 7 } 7 8 9 /* 本来は HTML helper かな */ 8 10 function picture($username, $image, $size, $class) 9 11 { … … 67 69 } 68 70 71 /* 本来は HTML helper かな */ 69 72 function my_pict($size) 70 73 { … … 75 78 } 76 79 80 /* 本来は HTML helper かな */ 77 81 function js($js = 'default', $timestamp = TRUE) 78 82 { … … 123 127 return $str; 124 128 } 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/views/home/main.php
r20833 r20834 1 1 <?=js()?> 2 2 3 3 4 <form action="#" name="whatdoing"> … … 34 35 <p class="murmur"> 35 36 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 36 <?php 37 $row->comment = h($row->comment);37 <?php 38 $row->comment = auto_link(h($row->comment), 'url'); 38 39 if ($row->reply_username) { 39 40 $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
r20833 r20834 34 34 <td> 35 35 <p class="murmur"> 36 <?php 37 $row->comment = h($row->comment);36 <?php 37 $row->comment = auto_link(h($row->comment), 'url'); 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
r20833 r20834 35 35 <p class="murmur"> 36 36 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 37 <?= h($row->comment)?>37 <?=auto_link(h($row->comment), 'url')?> 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
r20833 r20834 12 12 <p class="murmur"> 13 13 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 14 <?php 15 $row->comment = h($row->comment);14 <?php 15 $row->comment = auto_link(h($row->comment), 'url'); 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
r20833 r20834 34 34 <p class="murmur"> 35 35 <?=anchor(site_url('user/index/' . $row->username), $row->username)?> 36 <?php 37 $row->comment = h($row->comment);36 <?php 37 $row->comment = auto_link(h($row->comment), 'url'); 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
r20833 r20834 19 19 alert(data.html); 20 20 } 21 }21 } 22 22 23 23 /* フォロー解除する */ … … 71 71 <td> 72 72 <p class="murmur"> 73 <?php 74 $row->comment = h($row->comment);73 <?php 74 $row->comment = auto_link(h($row->comment), 'url'); 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
r20833 r20834 5 5 <?php foreach($list as $row):?> 6 6 <p> 7 <?php 8 $row->comment = h($row->comment);7 <?php 8 $row->comment = auto_link(h($row->comment), 'url'); 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)