r24570 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24569‎ | r24570 | r24571 >
Date:00:16, 4 August 2007
Author:david
Status:old
Tags:
Comment:
archive placeholders
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -153,12 +153,14 @@
154154 array($article_clause,
155155 'instr(thread.thread_path, ".")' => '0',
156156 '(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.'))'),
158159 array('ORDER BY thread.thread_timestamp DESC'));
159160 $g->addQuery('archived',
160161 array($article_clause,
161162 '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.')',
163165 'thread.thread_timestamp < ' . $startdate->text()),
164166 array('ORDER BY thread.thread_timestamp DESC'));
165167 $g->extendQuery('archived', 'recently-archived',
@@ -716,8 +718,12 @@
717719 <td><a href="{$this->permalinkUrl($t)}">{$t->subjectWithoutIncrement()}</a></td>
718720 <td>
719721 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
722728 </td>
723729 </tr>
724730 HTML
@@ -729,7 +735,8 @@
730736 $startdate = Date::now()->nDaysAgo($this->archive_start_days)->midnight();
731737 $where = array('thread.thread_article' => $this->article->getID(),
732738 '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.')',
734741 'thread.thread_timestamp < ' . $startdate->text());
735742 $options = array('ORDER BY thread.thread_timestamp DESC');
736743
@@ -749,13 +756,13 @@
750757 if ($s && ctype_digit($s) && strlen($s) == 6 && !$ignore_dates) {
751758 $this->selstart = new Date( "{$s}01000000" );
752759 $this->starti = array_search($s, $months);
753 - $where[] = 'thread_timestamp >= ' . $this->selstart->text();
 760+ $where[] = 'thread.thread_timestamp >= ' . $this->selstart->text();
754761 }
755762 $e = $r->getVal('lqt_archive_end');
756763 if ($e && ctype_digit($e) && strlen($e) == 6 && !$ignore_dates) {
757764 $this->selend = new Date("{$e}01000000");
758765 $this->endi = array_search($e, $months);
759 - $where[] = 'thread_timestamp < ' . $this->selend->nextMonth()->text();
 766+ $where[] = 'thread.thread_timestamp < ' . $this->selend->nextMonth()->text();
760767 }
761768 if ( isset($this->selstart) && isset($this->selend) ) {
762769
Index: branches/liquidthreads/extensions/LqtModel.php
@@ -449,6 +449,10 @@
450450 return $this->summary;
451451 }
452452
 453+ function hasSummary() {
 454+ return $this->summaryId != null;
 455+ }
 456+
453457 function setSummary( $post ) {
454458 $this->summary = null;
455459 $this->summaryId = $post->getID();

Status & tagging log