r57173 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57172‎ | r57173 | r57174 >
Date:23:16, 30 September 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r57115, r57123 "search capability"
Tied to MySQL search backend's raw database tables, would be useless on Wikimedia sites.
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.i18n.php (modified) (history)
  • /trunk/extensions/ProofreadPage/SpecialProofreadPages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php
@@ -67,9 +67,7 @@
6868 <td align=center class='quality0' width=\"$1\"></td>
6969 <td ><span id=pr_index style=\"visibility:hidden;\">$7</span></td>
7070 </tr></table>",
71 - 'proofreadpage_pages' => '{{PLURAL:$1|page|pages}}',
72 - 'proofreadpage_specialpage_text' => '',
73 - 'proofreadpage_specialpage_legend' => 'Search index pages',
 71+ 'proofreadpage_pages' => "{{PLURAL:$1|page|pages}}",
7472 );
7573
7674 /** Message documentation (Message documentation)
Index: trunk/extensions/ProofreadPage/SpecialProofreadPages.php
@@ -17,29 +17,10 @@
1818 }
1919
2020 function execute( $parameters ) {
21 - global $wgOut, $wgRequest, $wgDisableTextSearch;
22 -
2321 $this->setHeaders();
2422 list( $limit, $offset ) = wfCheckLimits();
25 - $wgOut->addWikiText( wfMsgForContentNoTrans( 'proofreadpage_specialpage_text' ) );
2623
27 - if( $wgDisableTextSearch ) {
28 - $search = false;
29 - } else {
30 - $search = $wgRequest->getText( 'key' );
31 - $wgOut->addHTML(
32 - Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'IndexPages' )->getLocalUrl() ) ) .
33 - Xml::openElement( 'fieldset' ) .
34 - Xml::hidden( 'title', SpecialPage::getTitleFor( 'IndexPages' )->getPrefixedText() ) .
35 - Xml::element( 'legend', null, wfMsg( 'proofreadpage_specialpage_legend' ) ) .
36 - Xml::input( 'key', 20, $search ) . ' ' .
37 - Xml::submitButton( wfMsg( 'ilsubmit' ) ) .
38 - Xml::closeElement( 'fieldset' ) .
39 - Xml::closeElement( 'form' )
40 - );
41 - }
42 -
43 - $cnl = new ProofreadPagesQuery( $search );
 24+ $cnl = new ProofreadPagesQuery();
4425 $cnl->doQuery( $offset, $limit );
4526 }
4627 }
@@ -48,10 +29,6 @@
4930
5031 class ProofreadPagesQuery extends QueryPage {
5132
52 - function ProofreadPagesQuery( $search ) {
53 - $this->search = $search;
54 - }
55 -
5633 function getName() {
5734 return 'IndexPages';
5835 }
@@ -68,20 +45,18 @@
6946 $dbr = wfGetDB( DB_SLAVE );
7047 $page = $dbr->tableName( 'page' );
7148 $pr_index = $dbr->tableName( 'pr_index' );
72 - $searchindex = $dbr->tableName( 'searchindex' );
7349
74 - if($this->search) {
75 - $query = "SELECT page_title as title,
76 - pr_count,pr_q0,pr_q1,pr_q2,pr_q3,pr_q4
77 - FROM $pr_index LEFT JOIN $page ON page_id = pr_page_id
78 - LEFT JOIN $searchindex ON si_page = pr_page_id
79 - WHERE match (si_text) against ('". $dbr->strencode( $this->search ) ."')";
80 - } else {
81 - $query = "SELECT page_title as title,
82 - pr_count,pr_q0,pr_q1,pr_q2,pr_q3,pr_q4
83 - FROM $pr_index LEFT JOIN $page ON page_id = pr_page_id";
84 - }
85 - return $query;
 50+ return
 51+ "SELECT pr_page_id as title,
 52+ page_title as title,
 53+ pr_count,
 54+ pr_q0,
 55+ pr_q1,
 56+ pr_q2,
 57+ pr_q3,
 58+ pr_q4
 59+ FROM $pr_index
 60+ LEFT JOIN $page ON page_id = pr_page_id";
8661 }
8762
8863 function getOrder() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r57279search button using SearchEngine (follow up r57173)thomasv09:11, 2 October 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57115search capabilitythomasv16:19, 30 September 2009
r57123Follow-up r57115: Ignore new message for translatewiki...raymond17:54, 30 September 2009

Status & tagging log