MyBB Community Forums

Full Version: wowdata
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the WoWdata plugin.

http://mods.mybb.com/view/wow-data

And when i use

[item] incorrectly spelled item [/item]

It gives back this error:

[Image: error.jpg]

The lines of code this is about:

//	close cURL resource, and free up system resources
	curl_close($ch);
	$ret = json_decode($curl_req);
	$items = array();
	foreach($ret[7] as $index => $match) {
		if($match[0] == 3) {
			$name = preg_replace('/\s+\([^\)]+\)$/', "", $match[1][$index]);
			$items_index = count($items);
			$items[$items_index]['type'] = $match[0];
			$items[$items_index]['item_id'] = $match[1];
			$items[$items_index]['icon'] = $match[2];
			$items[$items_index]['quality'] = $match[3];
			$blizzard_url = "http://us.battle.net/api/wow/item/".$match[1];
			$blizzard_data = json_decode(wowdata_getdata_blizzard($blizzard_url), true);
			$cache_data = array(
				"wowdata_id" => "null",
				"code" => "item",
				"text_key" => $blizzard_data['name'],
				"attribute_keys" => "ilevel=".$blizzard_data['itemLevel']."&requiredLevel=".$blizzard_data['requiredLevel']."&itemClass=".$blizzard_data['itemClass'],
				"external_id" => $match[1],
				"url" => $blizzard_url,
				"data" => $blizzard_data
			);
			wowdata_cachedata($cache_data);
		}
	}

And this is line 618 (620 tried something with an if statement error message didnt change): foreach($ret[7] as $index => $match) {
Now is my question how do i catch this error/ disable it from displaying to not give the terrible error message on the top of the page.