Page 1 of 1

portal.php debug fehler

Posted: 21. January 2012 21:11
by Balani
Hallo zusammen ich bekomme beim Portal folgende Fehlermeldung.

[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 665: Invalid argument supplied for foreach()

Code: Select all

function bbcode_second_pass_eftfitting($export)
	{

		global $db;
	
		$fitdetails = explode("\n",trim($export));
		
		foreach($fitdetails as $key=>$row){
			if($key == '0'){
				$titlebits = explode(',',preg_replace('/(\[|\])/','',$row));
				$shipType = $titlebits[0];
				$name = trim($titlebits[1]);
				continue;
			}
			$fitting_array[] = $row;
		}

		//Start fitting
		$fitting_output = '<div id="fittitle"><h3>'.$name.'</h3><h4>'.$shipType.'</h4></div>';
		$fitting_output .= '<div id="fitting_container">';
		$fitting_output .= '<div class="fitting_tabs"><ul class="fit-tabs"><li class="fit-tab" onclick="chooseTab(this,\'loadout\');">Loadout</li><li class="fit-tab" onclick="chooseTab(this,\'export\');">EFT Export</li></ul><div style="clear:both;"></div></div>';
		$fitting_output .= '<div id="fittext" style="display:none;">' .$export . '</div>';
		$fitting_output .= '<div title="fitting" id="fitting">';
		
		//Fitting window
		$fitting_output .= '<div id="fittingwindow"><img border="0" alt="" src="images/fitting/fitting2.png"></div>';
		
		
		$sql = 'SELECT * FROM EFTShips WHERE typeName="'.$shipType.'"';
		$result = $db->sql_query($sql);
		$shipdetails = $db->sql_fetchrow($result);
		$fitting_output .= '<div id="shipicon"><img border="0" alt="" title="'.$shipType.'" src="http://image.eveonline.com/InventoryType/'.$shipdetails['TypeID'].'_64.png"></div>';

		$sql = 'SELECT DISTINCT location FROM EFTmodules';
		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			$position[$row['location']] = 1;
		}
		
		//Produce fit display
		foreach($fitting_array as $itemname){
			
			//ignore blank lines
			if($itemname =='')
				continue;
			
			if(strpos($itemname,',')){
				$details = explode(',',$itemname);
				$itemname = $details[0];
			}
			
			//get the info about the module
			$sql = 'SELECT typeID, location FROM EFTmodules where TypeName = "' . $itemname . '"';
				
			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);

			$fitting_output .= '<div id="'.$row['location'].$position[$row['location']].'"><img border="0" title="'.$itemname.'" src="http://image.eveonline.com/InventoryType/'.$row['typeID'].'_32.png"></div>';
			
			if(!empty($details[1])){
				$charges[$row['location']][$position[$row['location']]] = trim($details[1]);
				unset($details);
			}
			
			//increment the position
			$position[$row['location']]++;
			
		}

		if(is_array($charges)){
			foreach($charges as $slot=>$positions){
				foreach($positions as $position=>$itemname){
					if(!empty($itemname))
					{
						$result = $db->sql_query('SELECT typeID FROM EFTCharges where TypeName = "' . $itemname . '"');
						$row = $db->sql_fetchrow($result);
						$fitting_output .= '<div id="'.$slot.'charge'.($position).'"><img border="0" title="'.$itemname.'" src="http://image.eveonline.com/InventoryType/'.$row['typeID'].'_32.png"></div>';
					}
				}
			}
		}
		
		$sql = 'SELECT DISTINCT location FROM EFTmodules';
		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			for($i = ($position[$row['location']]);$i < $shipDetails[$row['location']];$i++){
				$fitting_output .= '<div id="'.$row['location'].($i+1).'"><img border="0" title="Empty '.ucfirst($row['location']).' Slot" src="images/fitting/'.$row['location'].'.png"></div>';
			}
		}
		
		//End fitting
		$fitting_output .= '</div></div>';
		
		return($fitting_output);
	
	}
der fehler sitzt hier

foreach($fitting_array as $itemname){



Im normalen Forum läuft es fehlerfrei

hier ist mal der link zum portal http://www.elve-industries.de


Ich denke mal das es nur ne Kleinigkeit ist. Wäre nett wenn da mal nen Portal Profi was zu sagen könnte.

Re: portal.php debug fehler

Posted: 31. January 2012 13:41
by Marc
Das hat leider nichts mit dem Portal zu tun. Bitte kontaktiere den MOD Autor, der für diesen Code verantwortlich ist. ;)