r24818 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24817‎ | r24818 | r24819 >
Date:13:35, 15 August 2007
Author:yaron
Status:old
Tags:
Comment:
Replaced SQL queries to get attribute and relation names with much better ones
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php
@@ -29,16 +29,16 @@
3030 $dbr =& wfGetDB( DB_SLAVE );
3131 $all_properties = array();
3232
33 - $res = $dbr->query("SELECT distinct attribute_title FROM " .
34 - $dbr->tableName('smw_attributes'));
 33+ $res = $dbr->query("SELECT page_title FROM " . $dbr->tableName('page') .
 34+ " WHERE page_namespace = " . SMW_NS_ATTRIBUTE);
3535 while ($row = $dbr->fetchRow($res)) {
3636 $attribute_name = str_replace('_', ' ', $row[0]);
3737 $all_properties[$attribute_name . ":="] = $attribute_name;
3838 }
3939 $dbr->freeResult($res);
4040
41 - $res = $dbr->query("SELECT distinct relation_title FROM " .
42 - $dbr->tableName('smw_relations'));
 41+ $res = $dbr->query("SELECT page_title FROM " . $dbr->tableName('page') .
 42+ " WHERE page_namespace = " . SMW_NS_RELATION);
4343 while ($row = $dbr->fetchRow($res)) {
4444 $relation_name = str_replace('_', ' ', $row[0]);
4545 $all_properties[$relation_name . "::"] = $relation_name;

Status & tagging log