r56780 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56779‎ | r56780 | r56781 >
Date:18:26, 22 September 2009
Author:thomasv
Status:ok
Tags:
Comment:
removing inefficient sql request
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.i18n.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php
@@ -65,7 +65,6 @@
6666 <td align=center class='quality2' width=\"$3\"></td>
6767 <td align=center class='quality1' width=\"$2\"></td>
6868 <td align=center class='quality0' width=\"$1\"></td>
69 -<td ><span id=pr_index style=\"visibility:hidden;\">$7</span></td>
7069 </tr></table>",
7170 'proofreadpage_pages' => "{{PLURAL:$1|page|pages}}",
7271 );
Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -646,6 +646,7 @@
647647 }
648648
649649 $return = "";
 650+
650651 $name = $imageTitle->getDBkey();
651652 $count = $image->pageCount();
652653
@@ -712,7 +713,8 @@
713714 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_nosuch_index' ) . '</strong>';
714715 }
715716
716 - $out = '';
 717+ $out = '<span id="pr_index" class="hiddenStructure"><a href="'.$index_title->escapeFullUrl().'">'.$pr_index_namespace.'</a> </span>';
 718+
717719 list( $text_links, $links, $params, $attributes ) = pr_parse_index( $index_title );
718720
719721 if( $links==null ) {
@@ -1288,19 +1290,7 @@
12891291 # quality1 is the default value
12901292 $n1 = $n - $n0 - $n2 - $n3 - $n4;
12911293
1292 - # find the index page
1293 - $indexquery = "SELECT DISTINCT p2.page_title AS title FROM $templatelinks LEFT JOIN $page AS p1 ON page_title=tl_title LEFT JOIN $pagelinks ON pl_title=page_title LEFT JOIN $page AS p2 ON p2.page_id=pl_from WHERE tl_from=$id AND tl_namespace=$page_ns_index AND pl_title=p1.page_title AND p2.page_namespace=$index_ns_index";
1294 - $res = $dbr->query( $indexquery , __METHOD__ );
1295 - if( $res && $dbr->numRows( $res ) > 0 ) {
1296 - $row = $dbr->fetchObject( $res );
1297 - $title = $row->title;
1298 - $dbr->freeResult( $res );
1299 - $sk = $wgUser->getSkin();
1300 - $indexlink = $sk->makeKnownLink( "$index_namespace:$title", "[index]" );
1301 - } else {
1302 - $indexlink="";
1303 - }
1304 - $output = wfMsgForContent( 'proofreadpage_quality_message', $n0*100/$n, $n1*100/$n, $n2*100/$n, $n3*100/$n, $n4*100/$n, $n, $indexlink );
 1294+ $output = wfMsgForContent( 'proofreadpage_quality_message', $n0*100/$n, $n1*100/$n, $n2*100/$n, $n3*100/$n, $n4*100/$n, $n );
13051295 $out->setSubtitle($output);
13061296 return true;
13071297 };

Status & tagging log