Skip to content

Commit

Permalink
[447] Display some locale-related special symbols in search filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Jan 7, 2011
1 parent 34fde80 commit 7de14b3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
4 changes: 2 additions & 2 deletions includes/classes/class.search.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 443
* @revision 447
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -408,7 +408,7 @@ public function PerformAdvancedItemsSearch($count = false) {
$tmp_names_holder = Armory::$wDB->select("SELECT `entry`, `name_loc%d` AS `name` FROM `locales_item` WHERE `entry` IN (%s)", Armory::GetLoc(), $names_to_add);
foreach($tmp_names_holder as $name) {
if($name['name'] == null) {
$name['name'] = Items::GetItemName($name['id']);
$name['name'] = Items::GetItemName($name['entry']);
}
$names_holder[$name['entry']] = $name['name'];
}
Expand Down
2 changes: 1 addition & 1 deletion includes/revision_nr.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('ARMORY_REVISION', 446);
define('ARMORY_REVISION', 447);
define('DB_VERSION', 'armory_r434');
define('CONFIG_VERSION', '2812201001');
?>
36 changes: 28 additions & 8 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 440
* @revision 447
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -174,10 +174,15 @@
break;
}
if(is_string($filter_get_key) && is_string($filter_get_value)) {
$xml->XMLWriter()->startElement('filter');
$xml->XMLWriter()->writeAttribute('name', $filter_get_key);
$xml->XMLWriter()->writeAttribute('value', $filter_get_value);
$xml->XMLWriter()->endElement();
if(Utils::IsWriteRaw()) {
$xml->XMLWriter()->writeRaw('<filter name="' . $filter_get_key . '" value="' . $filter_get_value . '" />');
}
else {
$xml->XMLWriter()->startElement('filter');
$xml->XMLWriter()->writeAttribute('name', $filter_get_key);
$xml->XMLWriter()->writeAttribute('value', $filter_get_value);
$xml->XMLWriter()->endElement();
}
}
$filtersCount++;
}
Expand Down Expand Up @@ -245,11 +250,26 @@
$xml->XMLWriter()->writeAttribute($itemdata_key, $itemdata_value);
}
foreach($item['filters'] as $filter) {
$xml->XMLWriter()->startElement('filter');
if(Utils::IsWriteRaw()) {
$xml->XMLWriter()->writeRaw('<filter');
}
else {
$xml->XMLWriter()->startElement('filter');
}
foreach($filter as $filter_key => $filter_value) {
$xml->XMLWriter()->writeAttribute($filter_key, $filter_value);
if(Utils::IsWriteRaw()) {
$xml->XMLWriter()->writeRaw(' ' . $filter_key . '="' . $filter_value . '"');
}
else {
$xml->XMLWriter()->writeAttribute($filter_key, $filter_value);
}
}
if(Utils::IsWriteRaw()) {
$xml->XMLWriter()->writeRaw(' />'); //filter
}
else {
$xml->XMLWriter()->endElement(); //filter
}
$xml->XMLWriter()->endElement(); //filter
}
$xml->XMLWriter()->endElement(); //item
}
Expand Down

0 comments on commit 7de14b3

Please sign in to comment.