Fr version
Eternam - July 6, 2008 - 00:48
| Project: | Lootz Item Filter |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi, first thanks for the accomplished work :).
Well, I am working on a new website for the guild I am in. A french guild.
So, I am interested in using fr.wowdb.com.
I edited wowdb.inc with the previous url.
2 problems:
- the search function fails if the name of the item contains "é" for example, guess it is a problem with the item's name in the search url because of special chars,
- the link of the item rightly points to the correct french item (if I click on the link) but the tooltip displayed is still in english.
You can have a look here to see what I mean ^^.
http://www.guildephenix.fr/test/drupal/
With regards.

#1
Regarding the second issue, it looks like the problem is that it is still including the english js file. If you can find the place where it defines this url:
http://wowdb.com/js/extooltips.js?8
and replace it with
http://fr.wowdb.com/js/extooltips.js?8
that might fix it. I'll look into the second issue when I get a chance to work on the module again.
#2
Thanks a lots, you were right.
I edited wowdb.inc to use the "french" javascript and now the popup tooltip is in french :).
#3
For the second issue, I changed in the function _lootz_filter_process($text, $format):
if (preg_match_all('#\[item\]([0-9a-zA-Z ]+)\[/item\]#',$text, $links, PREG_SET_ORDER)) {
To
if (preg_match_all('#\[item\](.*)\[/item\]#',$text, $links, PREG_SET_ORDER)) { //
So now it is also working for names containing chars with accent like "é".
But it is still not working for names with quotes like "Quel'Serrar".
Not sure regex (.*) will allow a quote or the problem is when the quote is encoded in the search url.
I've got nearly no experience with both php and regular expression but I'll still be working on it :D.
For issue 1, it is indeed working fine for Firefox, but IE doesn't handle well UTF-8 in the tooltip :s.
#4
You might try replacing the (.*) with (.+) as this won't match on empty tags. Also, when tweaking filter matching, you'll need to clear Drupal's filter cache after every change, or it won't correctly parse the filter:
in mysql db:
TRUNCATE cache_filter;
TRUNCATE cache;
or, you can use the developer module to do this for you: http://drupal.org/project/developer