Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | protected $title; |
130 | 130 | protected $request; |
131 | 131 | |
132 | | - protected $headerLevel = 1; /* h1, h2, h3, etc. */ |
| 132 | + protected $headerLevel = 2; /* h1, h2, h3, etc. */ |
133 | 133 | protected $user_colors; |
134 | 134 | protected $user_color_index; |
135 | 135 | const number_of_user_colors = 6; |
— | — | @@ -222,10 +222,10 @@ |
223 | 223 | return self::permalinkUrlWithQuery( $changed_thread, array('diff'=>$curr_rev_id, 'oldid'=>$prev_rev->getId()) ); |
224 | 224 | } |
225 | 225 | |
226 | | - static function talkpageUrl( $title, $method = null, $operand = null ) { |
| 226 | + static function talkpageUrl( $title, $method = null, $operand = null, $includeFragment = true ) { |
227 | 227 | $query = $method ? "lqt_method=$method" : ""; |
228 | 228 | $query = $operand ? "$query&lqt_operand={$operand->id()}" : $query; |
229 | | - return $title->getFullURL( $query ); |
| 229 | + return $title->getFullURL( $query ) . ($operand && $includeFragment ? "#lqt_thread_{$operand->id()}" : ""); |
230 | 230 | } |
231 | 231 | |
232 | 232 | /************************************************************* |
— | — | @@ -311,13 +311,6 @@ |
312 | 312 | // $wgOut->setArticleRelated( false ); |
313 | 313 | $this->output->setArticleFlag( false ); |
314 | 314 | |
315 | | - // I have lost track of where the redirect happens, so I can't set a flag there until I find it. |
316 | | - // In the meantime, just check if somewhere somebody redirected. I'm afraid this might have |
317 | | - // unwanted side-effects. |
318 | | - if ( $this->output->getRedirect() != '' ) { |
319 | | - $this->output->redirect( $this->title->getFullURL() ); |
320 | | - } |
321 | | - |
322 | 315 | // For replies and new posts, insert the associated thread object into the DB. |
323 | 316 | if ($edit_type != 'editExisting' && $edit_type != 'summarize' && $e->didSave) { |
324 | 317 | if ( $edit_type == 'reply' ) { |
— | — | @@ -344,6 +337,13 @@ |
345 | 338 | $thread->setRootRevision( Revision::newFromTitle($thread->root()->getTitle()) ); |
346 | 339 | $thread->commitRevision( Threads::CHANGE_EDITED_ROOT, $thread, $e->summary ); |
347 | 340 | } |
| 341 | + |
| 342 | + // I have lost track of where the redirect happens, so I can't set a flag there until I find it. |
| 343 | + // In the meantime, just check if somewhere somebody redirected. I'm afraid this might have |
| 344 | + // unwanted side-effects. |
| 345 | + if ( $this->output->getRedirect() != '' ) { |
| 346 | + $this->output->redirect( $this->title->getFullURL() . '#' . 'lqt_thread_' . $thread->id() ); |
| 347 | + } |
348 | 348 | } |
349 | 349 | |
350 | 350 | function renameThread($t,$s,$reason) { |
— | — | @@ -544,6 +544,8 @@ |
545 | 545 | $is_changed_thread = $thread->isHistorical() && $thread->changeObject() == $thread->id(); |
546 | 546 | |
547 | 547 | $this->showThreadHeading( $thread ); |
| 548 | + |
| 549 | + $this->output->addHTML( "<a name=\"lqt_thread_{$thread->id()}\" ></a>" ); |
548 | 550 | |
549 | 551 | if ($thread->type() == Threads::TYPE_MOVED) { |
550 | 552 | $revision = Revision::newFromTitle( $thread->title() ); |