Moderator: ds
$wordings['enUS']['requires_level'] = '/Requires level ([\d]+)/';
$wordings['deDE']['requires_level'] = '/Benötigtes Level ([\d]+)/';
$wordings['frFR']['requires_level'] = '/Niveau ([\d]+) requis/';
foreach(array_keys($item) as $recipe_name)
{
$recipeDetails = $item[$recipe_name];
$recipe = $this->make_recipe( $recipeDetails, $memberId, $skill_name, $recipe_type, $recipe_name );
$this->insert_recipe( $recipe );
}
foreach(array_keys($item) as $recipe_name)
{
$recipeDetails = $item[$recipe_name];
$recipe = $this->make_recipe( $recipeDetails, $memberId, $skill_name, $recipe_type, $recipe_name );
$this->insert_recipe( $recipe,$data['Locale'] );
}
function insert_recipe( $recipe,$locale )
{
global $wordings;
$this->reset_values();
$this->add_value('member_id', $recipe['member_id'] );
$this->add_value('recipe_name', $recipe['recipe_name'] );
$this->add_value('recipe_type', $recipe['recipe_type'] );
$this->add_value('skill_name', $recipe['skill_name'] );
$this->add_value('difficulty', $recipe['difficulty'] );
$this->add_value('item_color', $recipe['item_color'] );
$this->add_value('reagents', $recipe['reagents'] );
$this->add_value('recipe_texture', $recipe['recipe_texture'] );
$this->add_value('recipe_tooltip', $recipe['recipe_tooltip'] );
if( preg_match($wordings[$locale]['requires_level'],$recipe['recipe_tooltip'],$level))
$this->add_value('level',$level[1]);
$querystr = "INSERT INTO `".ROSTER_RECIPESTABLE."` SET ".$this->assignstr;
$result = $this->query($querystr);
if( !$result )
{
$this->setError('Recipe ['.$recipe['recipe_name'].'] could not be inserted',$this->error());
}
}
Users browsing this forum: No registered users and 0 guests