r34432 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34431‎ | r34432 | r34433 >
Date:13:33, 8 May 2008
Author:yaron
Status:old
Tags:
Comment:
Drilldown results are sorted by "sortkey" instead of title
Modified paths:
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -724,14 +724,15 @@
725725 // so return page_title as title.
726726 $sql = "SELECT DISTINCT p.page_title AS title,
727727 p.page_title AS value,
728 - p.page_namespace AS namespace ";
 728+ p.page_namespace AS namespace,
 729+ c.cl_sortkey AS sortkey ";
729730 $sql .= $this->getSQLFromClause($this->category, $this->subcategory, $this->all_subcategories, $this->applied_filters);
730731 return $sql;
731732 }
732733
733 - function sortDescending() {
734 - return false;
735 - }
 734+ function getOrder() {
 735+ return ' ORDER BY sortkey ';
 736+ }
736737
737738 function formatResult($skin, $result) {
738739 $title = Title::makeTitle( $result->namespace, $result->value );
@@ -768,7 +769,7 @@
769770 for ($i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++) {
770771 $line = $this->formatResult( $skin, $row );
771772 if ($line) {
772 - $cur_first_char = $row->value{0};
 773+ $cur_first_char = $row->sortkey{0};
773774 if ($i % $rows_per_column == 0) {
774775 $html[] = "<div style=\"float: left; width: $column_width%;\">\n";
775776 if ($cur_first_char == $prev_first_char)

Status & tagging log