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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.