- Timestamp:
- 10/01/08 07:41:06 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/plain_php/trunk/model/phwittr/TimelineService.php
r20036 r20338 3 3 class TimelineService 4 4 { 5 protected $pdo, $ context;6 function __construct(PDO $pdo, ApplicationContext $context)5 protected $pdo, $baseUrl; 6 function __construct(PDO $pdo, $base_url) 7 7 { 8 8 $this->pdo = $pdo; 9 $this-> context = $context;9 $this->baseUrl = $base_url; 10 10 } 11 11 function fetchPublicTimeline($offset, $limit) … … 55 55 { 56 56 $smt = $this->pdo->prepare(' 57 select statuses.* from statuses57 select statuses.*, users.user_name, users.image from statuses 58 58 left join users on users.id = statuses.user_id where users.id = :user_id 59 59 order by statuses.created_at desc … … 92 92 select count(users.id) 93 93 from statuses left join users on users.id = statuses.user_id 94 left join followers f1 on f1.user_id = users.id95 96 where users.delete_flag = 0 and f1. follow_id = :user_id97 or users.id = :user_id ');94 left join (select * from followers where user_id = :user_id) f1 on f1.follow_id = users.id 95 96 where users.delete_flag = 0 and f1.user_id = :user_id 97 or users.id = :user_id '); 98 98 99 99 $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); … … 105 105 select users.user_name, users.image, statuses.* 106 106 from statuses left join users on users.id = statuses.user_id 107 left join followers f1 on f1.user_id = users.id107 left join (select * from followers where user_id = :user_id) f1 on f1.follow_id = users.id 108 108 109 where users.delete_flag = 0 and f1. follow_id = :user_id109 where users.delete_flag = 0 and f1.user_id = :user_id 110 110 or users.id = :user_id 111 111 … … 138 138 $status['comment'] = preg_replace('#(https?://[[:alnum:]+$;?.%,!\#~*/:@&=_-]+)#', '<a href="$1">$1</a>' , h($status['comment'])); 139 139 $status['comment'] = preg_replace('#@([[:word:]]{1,30})#', 140 '@<a href="' . $this-> context->baseUrl . '/$1">$1</a>',140 '@<a href="' . $this->baseUrl . '/$1">$1</a>', 141 141 $status['comment']); 142 142 return $status;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)