r14642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14641‎ | r14642 | r14643 >
Date:14:54, 7 June 2006
Author:proes
Status:old
Tags:
Comment:
Show defining expression for other defined meaning of a relation
Modified paths:
  • /trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZ.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZ.php
@@ -547,7 +547,7 @@
548548
549549 while($definedMeaningRelation = $dbr->fetchObject($queryResult))
550550 $relation->addTuple(array($this->getExpressionForMeaningId($definedMeaningRelation->relationtype_mid, 85),
551 - $this->getExpressionForMeaningId($definedMeaningRelation->meaning2_mid, 85)));
 551+ $this->getDefiningExpressionForDefinedMeaningId($definedMeaningRelation->meaning2_mid)));
552552
553553 return $relation;
554554 }
@@ -694,6 +694,16 @@
695695
696696 }
697697
 698+ function getDefiningExpressionForDefinedMeaningId($definedMeaningId) {
 699+ $dbr =& wfGetDB(DB_SLAVE);
 700+ $queryResult = $dbr->query("SELECT spelling from uw_defined_meaning, uw_expression_ns where uw_defined_meaning.defined_meaning_id=$definedMeaningId and uw_expression_ns.expression_id=uw_defined_meaning.expression_id and uw_defined_meaning.is_latest_ver=1 and uw_expression_ns.is_latest=1");
 701+
 702+ while ($spelling = $dbr->fetchObject($queryResult))
 703+ $result = $spelling->spelling;
 704+
 705+ return $result;
 706+ }
 707+
698708 function getExpressionForMeaningId($mid, $langcode) {
699709 // $dbr =& wfGetDB(DB_SLAVE);
700710 // $sql="SELECT spelling from uw_syntrans,uw_expression_ns where defined_meaning_id=".$mid." and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.language_id=".$langcode." limit 1";

Status & tagging log