Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -153,12 +153,14 @@ |
154 | 154 | array($article_clause, |
155 | 155 | 'instr(thread.thread_path, ".")' => '0', |
156 | 156 | '(thread.thread_timestamp >= ' . $startdate->text() . |
157 | | - ' OR thread.thread_summary_page is NULL)'), |
| 157 | + ' OR (thread.thread_summary_page is NULL' . |
| 158 | + ' AND thread.thread_type='.Threads::TYPE_NORMAL.'))'), |
158 | 159 | array('ORDER BY thread.thread_timestamp DESC')); |
159 | 160 | $g->addQuery('archived', |
160 | 161 | array($article_clause, |
161 | 162 | 'instr(thread.thread_path, ".")' => '0', |
162 | | - 'thread.thread_summary_page is not null', |
| 163 | + '(thread.thread_summary_page is not null' . |
| 164 | + ' OR thread.thread_type='.Threads::TYPE_NORMAL.')', |
163 | 165 | 'thread.thread_timestamp < ' . $startdate->text()), |
164 | 166 | array('ORDER BY thread.thread_timestamp DESC')); |
165 | 167 | $g->extendQuery('archived', 'recently-archived', |
— | — | @@ -716,8 +718,12 @@ |
717 | 719 | <td><a href="{$this->permalinkUrl($t)}">{$t->subjectWithoutIncrement()}</a></td> |
718 | 720 | <td> |
719 | 721 | HTML |
720 | | -); $this->showPostBody($t->summary()); |
721 | | - $this->output->addHTML(<<<HTML |
| 722 | +); if( $t->hasSummary() ) { |
| 723 | + $this->showPostBody($t->summary()); |
| 724 | + } else if ( $t->type() == Threads::TYPE_MOVED ) { |
| 725 | + $this->output->addHTML("<i>Placeholder left when the thread was moved to another page.</i>"); |
| 726 | + } |
| 727 | + $this->output->addHTML(<<<HTML |
722 | 728 | </td> |
723 | 729 | </tr> |
724 | 730 | HTML |
— | — | @@ -729,7 +735,8 @@ |
730 | 736 | $startdate = Date::now()->nDaysAgo($this->archive_start_days)->midnight(); |
731 | 737 | $where = array('thread.thread_article' => $this->article->getID(), |
732 | 738 | 'instr(thread.thread_path, ".")' => '0', |
733 | | - 'thread.thread_summary_page is not null', |
| 739 | + '(thread.thread_summary_page is not null' . |
| 740 | + ' OR thread.thread_type = '.Threads::TYPE_MOVED.')', |
734 | 741 | 'thread.thread_timestamp < ' . $startdate->text()); |
735 | 742 | $options = array('ORDER BY thread.thread_timestamp DESC'); |
736 | 743 | |
— | — | @@ -749,13 +756,13 @@ |
750 | 757 | if ($s && ctype_digit($s) && strlen($s) == 6 && !$ignore_dates) { |
751 | 758 | $this->selstart = new Date( "{$s}01000000" ); |
752 | 759 | $this->starti = array_search($s, $months); |
753 | | - $where[] = 'thread_timestamp >= ' . $this->selstart->text(); |
| 760 | + $where[] = 'thread.thread_timestamp >= ' . $this->selstart->text(); |
754 | 761 | } |
755 | 762 | $e = $r->getVal('lqt_archive_end'); |
756 | 763 | if ($e && ctype_digit($e) && strlen($e) == 6 && !$ignore_dates) { |
757 | 764 | $this->selend = new Date("{$e}01000000"); |
758 | 765 | $this->endi = array_search($e, $months); |
759 | | - $where[] = 'thread_timestamp < ' . $this->selend->nextMonth()->text(); |
| 766 | + $where[] = 'thread.thread_timestamp < ' . $this->selend->nextMonth()->text(); |
760 | 767 | } |
761 | 768 | if ( isset($this->selstart) && isset($this->selend) ) { |
762 | 769 | |
Index: branches/liquidthreads/extensions/LqtModel.php |
— | — | @@ -449,6 +449,10 @@ |
450 | 450 | return $this->summary; |
451 | 451 | } |
452 | 452 | |
| 453 | + function hasSummary() { |
| 454 | + return $this->summaryId != null; |
| 455 | + } |
| 456 | + |
453 | 457 | function setSummary( $post ) { |
454 | 458 | $this->summary = null; |
455 | 459 | $this->summaryId = $post->getID(); |