Localised version breakthrough!... I think.

Quick and easy way to see what recipes your character is missing

Moderators: zeryl, Teta68

Localised version breakthrough!... I think.

Postby Averen » Sun Sep 03, 2006 4:18 am

You can get different language lists of the trade skills from Allakhazam so it is possble to localise.

http://wow.allakhazam.com/db/skill.html?line=202 by default is english

But

http://wow.allakhazam.com/db/skill.html?line=202&locale=deDE
is german

and

http://wow.allakhazam.com/db/skill.html?line=202&locale=frFR
is french.

I apologise if this was already known and just me being an idiot. :P
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Localised version breakthrough!... I think.

Postby zeryl » Sun Sep 03, 2006 9:31 am

This definetly was NOT known.

Let me do some testing, and see if I can't get this to work.

If you use deDE or frFR, you can open missing.php and test it for me *grin*.

Since I don't use deDE or frFR, i'll have to rely on someone to help me with seeing if it works.

Thanks for the pointer btw!
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Re: Localised version breakthrough!... I think.

Postby zeryl » Sun Sep 03, 2006 9:44 am

It looks like it will work, but I can't be sure until someone tests it for me. I'll be releasing a POTENTIAL localized version tomorrow.

I will re-post in here if you would be so kind to test it for me.
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Re: Localised version breakthrough!... I think.

Postby wowodo » Mon Sep 04, 2006 3:47 am

Hello,
i've tested this "patch" and i've an error :

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /lsdln/roster/addons/missingrecipe/missing.php on line 63

Please help me ^^

edit:
my modifications:
Code: Select all
   switch($skill)
   {
      case 'Alchemy':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=171&locale=frFR';
         break;
      case 'Blacksmithing':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=164&locale=frFR';
         break;
      case 'Cooking':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=185&locale=frFR';
         break;
      case 'Enchanting':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=333&locale=frFR';
         break;
      case 'Engineering':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=202&locale=frFR';
         break;
      case 'Firstaid':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=129&locale=frFR';
         $skill = 'First Aid';
         break;
      case 'Leatherworking':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=165&locale=frFR';
         break;
      case 'Tailoring':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=197&locale=frFR';
         break;
      default:
         $url ='';
         break;
   }
Last edited by wowodo on Mon Sep 04, 2006 3:49 am, edited 2 times in total.
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Localised version breakthrough!... I think.

Postby Averen » Mon Sep 04, 2006 12:57 pm

Thats not a problem with the localisation, that's because you can't use cURL. I thought zeryl made a workaround though?
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Localised version breakthrough!... I think.

Postby wowodo » Mon Sep 04, 2006 11:21 pm

I've update my missing.php file with this modifications http://www.wowroster.net/Forums/viewtopic/p=4661.html#4661
but I've always an error for all players recipes
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Re: Localised version breakthrough!... I think.

Postby zeryl » Tue Sep 05, 2006 12:51 am

The reason it isn't failing over is because you CAN use cURL, but you can't set the specific option for cURL (follow redirection in this case). I am 99% sure you can remove that from the file, and it will work. I will have to add in some sort of protection for this too. Lol
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Re: Localised version breakthrough!... I think.

Postby sturmy » Thu Sep 07, 2006 2:11 pm

Blind question, but would modifying the URLs to something like:

Code: Select all
$url 'http://wow.allakhazam.com/db/skill.html?line=171&locale='.$roster_conf['roster_lang']; 


do the trick?

I'll give it a try tonight.
sturmy
WR.net Expert
WR.net Expert
 
Posts: 160
Joined: Wed Aug 16, 2006 9:07 pm

Re: Localised version breakthrough!... I think.

Postby zeryl » Thu Sep 07, 2006 8:08 pm

Yep, and that's the way I will do it once I have someone tell me if it works correctly or not.
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Re: Localised version breakthrough!... I think.

Postby wowodo » Thu Sep 07, 2006 11:00 pm

This is my file and it doesn't make great results, I have the CURL error and no recipes too ^^ :
watch here : http://lsdln.free.fr/roster/addon.php?roster_addon_name=missingrecipe&skill=Blacksmithing&cnameadd=Agathe

Code: Select all
<?php
/******************************
 * WoWRoster.net  Roster
 * Copyright 2002-2006
 * Licensed under the Creative Commons
 * "Attribution-NonCommercial-ShareAlike 2.5" license
 *
 * Short summary
 *  http://creativecommons.org/licenses/by-nc-sa/2.5/
 *
 * Full license information
 *  http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
 * -----------------------------
 *
 * $Id: wowdb.php 63 2006-06-14 22:30:35Z mathos $
 *
 ******************************/
if(isset($_GET['skill']))
{
   
   $skill = $_GET['skill'];
   
   $skill = mysql_real_escape_string($skill);
   switch($skill)
   {
      case 'Alchemy':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=171&locale='.$roster_conf['roster_lang'];
         break;
      case 'Blacksmithing':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=164&locale='.$roster_conf['roster_lang'];
         break;
      case 'Cooking':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=185&locale='.$roster_conf['roster_lang'];
         break;
      case 'Enchanting':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=333&locale='.$roster_conf['roster_lang'];
         break;
      case 'Engineering':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=202&locale='.$roster_conf['roster_lang'];
         break;
      case 'Firstaid':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=129&locale='.$roster_conf['roster_lang'];
         $skill = 'First Aid';
         break;
      case 'Leatherworking':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=165&locale='.$roster_conf['roster_lang'];
         break;
      case 'Tailoring':
         $url = 'http://wow.allakhazam.com/db/skill.html?line=197&locale='.$roster_conf['roster_lang'];
         break;
      default:
         $url ='';
         break;
   }
}

if (function_exists('curl_init'))
{
   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
   curl_setopt($ch, CURLOPT_TIMEOUT, 30);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   $contents = curl_exec($ch);
   curl_close($ch);
}
else
{
   if(ini_get('allow_url_fopen') == 1)
   {
      $contents = file_get_contents($url);
   }
   else {
      return $wordings[$roster_conf['roster_lang']]['mr_curlerror'];
   }
}

preg_match_all('/(?<=\<tr class=\"[dl]r\"\>)((.(?!\<\/tr))*)/si',$contents,$matches);
foreach ($matches[0] as $nr => $recipe)
...
...
...
Last edited by wowodo on Thu Sep 07, 2006 11:05 pm, edited 1 time in total.
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Re: Localised version breakthrough!... I think.

Postby wowodo » Thu Sep 07, 2006 11:03 pm

I've tested that:
Code: Select all
/*if (function_exists('curl_init'))
{
   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
   curl_setopt($ch, CURLOPT_TIMEOUT, 30);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   $contents = curl_exec($ch);
   curl_close($ch);
}
else
{*/
   if(ini_get('allow_url_fopen') == 1)
   {
      $contents = file_get_contents($url);
   }
   else {
      return $wordings[$roster_conf['roster_lang']]['mr_curlerror'];
   }
/*}*/

I have no error but no recipes too ^^.
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Re: Localised version breakthrough!... I think.

Postby sturmy » Fri Sep 08, 2006 7:55 am

yeah I gave it a shot as well, but I get character knows no recipe and the curl error due to my host.
Sorry I can't help further on this one.
sturmy
WR.net Expert
WR.net Expert
 
Posts: 160
Joined: Wed Aug 16, 2006 9:07 pm

Re: Localised version breakthrough!... I think.

Postby wowodo » Fri Sep 08, 2006 10:52 am

ok, thanks but another one would help me pleaze ^^
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Localised version breakthrough!... I think.

Postby Averen » Fri Sep 08, 2006 11:06 am

Wowodo do you use a different language of WoWRoster?

If you do replace this is missing.php

Code: Select all
        case 'Alchemy':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=171';
            break;
        case 
'Blacksmithing':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=164';
            break;
        case 
'Cooking':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=185';
            break;
        case 
'Enchanting':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=333';
            break;
        case 
'Engineering':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=202';
            break;
        case 
'Firstaid':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=129';
            
$skill 'First Aid';
            break;
        case 
'Leatherworking':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=165';
            break;
        case 
'Tailoring':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=197';
            break;
        default:
            
$url ='';
            break; 

With
Code: Select all
case 'Alchemy':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=171&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Blacksmithing':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=164&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Cooking':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=185&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Enchanting':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=333&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Engineering':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=202&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Firstaid':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=129&locale='.$roster_conf['roster_lang'];
            
$skill 'First Aid';
            break;
        case 
'Leatherworking':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=165&locale='.$roster_conf['roster_lang'];
            break;
        case 
'Tailoring':
            
$url 'http://wow.allakhazam.com/db/skill.html?line=197&locale='.$roster_conf['roster_lang'];
            break;
        default:
            
$url ='';
            break; 
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Localised version breakthrough!... I think.

Postby wowodo » Sat Sep 09, 2006 2:03 pm

yes, i'm french and i use roster addons when they've localization modified.
So in the roster config i've selected frFR for the roster language
Last edited by wowodo on Sat Sep 09, 2006 2:11 pm, edited 1 time in total.
User avatar
wowodo
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Fri Jul 07, 2006 6:47 pm

Next

Return to Missing Recipes

Who is online

Users browsing this forum: No registered users and 1 guest

cron