r52643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52642‎ | r52643 | r52644 >
Date:19:36, 1 July 2009
Author:dale
Status:deferred
Tags:
Comment:
moved u800 replace to more logical place
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_Index.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_Index.php
@@ -158,8 +158,8 @@
159159 $ret_ary[$cat_row->cl_from]->category[] = $cat_row->cl_to;
160160 }
161161 }
162 - // slow especially for lots of query results but join Query is crazy complicated for SMW >= 1.2
163 - // (and I have not been able to construct it without hitting expensive number of rows in the EXPLIN)
 162+ // slow epecialy for lots of query results but join Query is crazy complicated for SMW >= 1.2
 163+ // (and I have not been able to construct it without hitting exessive number of rows in the EXPLIN)
164164 // @@todo these queries should be merged with semantic wiki Ask with some ~special~ keywords for fulltext search
165165 if ( $do_smw_lookup ) {
166166 $smwStore =& smwfGetStore();
@@ -627,6 +627,9 @@
628628 }
629629 }
630630 }
 631+ foreach($ret_ary as $k => $v){
 632+ $ret_ary[$k]->text = str_replace(array('u800','u82e'),'', $v->text);
 633+ }
631634
632635 return $ret_ary;
633636 }
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php
@@ -262,6 +262,7 @@
263263 global $wgRequest;
264264
265265 $this->results = $mvIndex->doUnifiedFiltersQuery( $this->filters );
 266+
266267 $this->num = $mvIndex->numResults();
267268 $this->numResultsFound = $mvIndex->numResultsFound();
268269 if ( isset ( $mvIndex->offset ) )
@@ -270,7 +271,9 @@
271272 $this->limit = $mvIndex->limit;
272273 if ( isset ( $mvIndex->order ) )
273274 $this->order = $mvIndex->order;
 275+ //fix replace text:
274276
 277+
275278 // do search digest (if global config, function req and num_results fit criteria)
276279 if ( $mvEnableSearchDigest &&
277280 $wgRequest->getVal( 'tl' ) != '1' &&
@@ -479,7 +482,6 @@
480483 $mvStreamTitle = Title :: MakeTitle( MV_NS_STREAM, $mvTitle->getNearStreamName( 0 ) );
481484 }
482485 // $mvTitle->getStreamName() .'/'.$mvTitle->getStartTime() .'/'. $mvTitle->getEndTime() );
483 - $mvd_text = str_replace(array('u800','u82e'),'', $mvd->text);
484486
485487 $o .= '<li class="result">
486488 <span class="vid_img" id="mvimg_' . htmlspecialchars( $mvd->id ) . '">
@@ -493,7 +495,7 @@
494496 $sk->makeKnownLinkObj( $mvStreamTitle, $mvTitle->getStreamNameText() .
495497 ' :: ' . $mvTitle->getTimeDesc() ) .
496498 '</h4>
497 - <p>Matching Phrase:' . $this->termHighlight( $mvd_text, implode( '|', $this->getTerms() ), 1, 100 ) . ' </p>
 499+ <p>Matching Phrase:' . $this->termHighlight( $mvd->text, implode( '|', $this->getTerms() ), 1, 100 ) . ' </p>
498500 <span class="by">' . $mvd_cnt_links . '</span>
499501 <span class="by">' . $mvd_cat_links . '</span>
500502 <span class="by">' . $mvd_bill_links . '</span>
@@ -1073,6 +1075,7 @@
10741076 $v = current(current($v)->getContent());
10751077 array_push( $results, $v->getXSDValue());
10761078 }
 1079+ //replace result text:
10771080 return $results;
10781081 }
10791082 function getPersonImageURL( $person_name ) {

Status & tagging log