- Timestamp:
- 10/01/08 07:41:06 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/plain_php/trunk/model/phwittr/StatusService.php
r20036 r20338 4 4 { 5 5 protected $pdo; 6 function __construct(PDO $pdo )6 function __construct(PDO $pdo, $base_url) 7 7 { 8 8 $this->pdo = $pdo; 9 $this->baseUrl = $base_url; 9 10 } 10 11 function reply($user_id, $comment, $reply_user_id) … … 48 49 $smt->execute(); 49 50 50 return $smt->fetch(PDO::FETCH_ASSOC); 51 $s = $smt->fetch(PDO::FETCH_ASSOC); 52 53 if ($s) $s = $this->processStatus($s); 54 return $s; 51 55 } 52 56 protected function processStatus($status) 57 { 58 $status['title_comment'] = h($status['comment']); 59 $status['comment'] = preg_replace('#(https?://[[:alnum:]+$;?.%,!\#~*/:@&=_-]+)#', '<a href="$1">$1</a>' , h($status['comment'])); 60 $status['comment'] = preg_replace('#@([[:word:]]{1,30})#', 61 '@<a href="' . $this->baseUrl . '/$1">$1</a>', 62 $status['comment']); 63 return $status; 64 } 53 65 } 54 66
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)