Jump to content

Not loading image


Xtremer360

Recommended Posts

When this function gets loaded it doesn't load the image just trying to figure out why.

 

function roleplay($fedid,$rp,$iframe,$dirpath,$folder,$headshot,$fullshot,$bioheadwidth,$bioheadheight)
{
print "<div id=\"roleplays\">\n";

$query = "SELECT
		rp.id as rpid,
		rp.title as rp_title,
		rp.rpdate as rp_date,
		rp.location as location,
		rp.roleplay as roleplay,
		bio.charactername as charactername,
		bio.username as username,
		bio.posername as posername
	FROM
		efed_content_roleplays as rp
	INNER JOIN
		efed_bio as bio
	ON
		(
			rp.bio_id = bio.id
		)
	WHERE
		rp.id = '$rp'
	ORDER BY
		rp.id desc";
$result = mysql_query ($query); 
while ($row = mysql_fetch_assoc($result))
{
	$fieldarray=array('rpid','rp_title','rp_date','location','roleplay','charactername','username','posername');
	foreach ($fieldarray as $fieldlabel)
	{
		if (isset($row[$fieldlabel])) 
		{ 
			$$fieldlabel=$row[$fieldlabel];
			$$fieldlabel=cleanquerydata($$fieldlabel);
		}
	}

	if (file_exists("$dirpath$headshot/$posername.jpg"))
	{
		if ($iframe == "yes")
		{
			print "<a href=$folder/roster.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=5></img></a>\n";
		}
		else
		{
			print "<a href=$folder/bio.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=0></img></a>\n";
		}
	}
	print "<font size=5> ".$rp_title."</font><br>\n";
	print "<b>Featuring:</b> <a target=_top href=".$folder."/bio.php?username=".$username.">".$charactername."</a><br>\n";
	if ($rp_date != "") { print "<b>Date:</b> ".$rp_date."<br>\n"; }
	if ($location != "") { print "<b>Location:</b> ".$location."<br>\n"; }
	print "<br><br><p style=\"margin-left:20px;margin-right:20px;\">\n";	

	print nl2br($roleplay)."<br>\n";
	print "</p><hr>\n";
	if ($iframe == "yes")
	{
		print "<center><a target=_top href=".$folder."/roster.php?username=".$username.">View ".$charactername."'s Biography</a></center>\n";
	}
	else
	{
		print "<center><a target=_top href=".$folder."/bio.php?username=".$username.">View ".$charactername."'s Biography</a></center><br>\n";
	}
}

print "</div>\n";
}

Link to comment
https://forums.phpfreaks.com/topic/187900-not-loading-image/
Share on other sites

try to add else part of your if statement

		if (file_exists("$dirpath$headshot/$posername.jpg"))
	{
		if ($iframe == "yes")
		{
			print "<a href=$folder/roster.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=5></img></a>\n";
		}
		else
		{
			print "<a href=$folder/bio.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=0></img></a>\n";
		}
	} else echo "<br />can't find file: $dirpath$headshot/$posername.jpg\<br />\n";

Link to comment
https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992243
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.