use DB_DataObject join
darcs-hash:20080707070545-84dde-581f5b8d356b5b7d27a9b0b331a0e40ddab28cbe.gz
This commit is contained in:
parent
b6e482c16a
commit
b9eedf6195
|
@ -68,14 +68,13 @@ class RepliesAction extends StreamAction {
|
||||||
function show_replies($profile) {
|
function show_replies($profile) {
|
||||||
|
|
||||||
$reply = new Reply();
|
$reply = new Reply();
|
||||||
|
$notice = new Notice();
|
||||||
|
|
||||||
$reply->profile_id = $profile->id;
|
$reply->profile_id = $profile->id;
|
||||||
|
|
||||||
$reply->orderBy('modified DESC');
|
$reply->orderBy('modified DESC');
|
||||||
|
|
||||||
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
|
||||||
$reply->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
|
$reply->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
|
||||||
|
$reply->joinAdd($notice, 'INNER', NULL, 'notice_id');
|
||||||
|
|
||||||
$cnt = $reply->find();
|
$cnt = $reply->find();
|
||||||
|
|
||||||
|
@ -83,12 +82,6 @@ class RepliesAction extends StreamAction {
|
||||||
common_element_start('ul', array('id' => 'notices'));
|
common_element_start('ul', array('id' => 'notices'));
|
||||||
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
|
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
|
||||||
if ($reply->fetch()) {
|
if ($reply->fetch()) {
|
||||||
$notice = new Notice();
|
|
||||||
$notice->id = $reply->notice_id;
|
|
||||||
$result = $notice->find(true);
|
|
||||||
if (!$result) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$this->show_notice($notice, $reply->replied_id);
|
$this->show_notice($notice, $reply->replied_id);
|
||||||
} else {
|
} else {
|
||||||
// shouldn't happen!
|
// shouldn't happen!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user