Jump to content

TBD


Xtremer360

Recommended Posts

I have this function and trying to figure out how I can have it be if there's no champion or contenders then it shows TBD.

 

function champions($fedid,$dirpath,$folder,$iframe,$titlebelts,$championheadshot)

{

print "<div id='champions'>\n";

print "<h1 class=backstage>KOW Champions</h1>\n";

print "<table cellspacing='0px' cellpadding='5px' style='border: 0px;'><tr>";



$query = "SELECT title.name AS title, title.shortname AS shortname, title.champ_id AS championid, title.con1_id AS con1id, title.con2_id AS con2id, title.con3_id AS con3id, title.con4_id AS con4id, title.con5_id AS con5id, biochamp.posername AS posername, biochamp.username AS championusername, biochamp.charactername AS champion, biocon1.username AS con1username, biocon1.charactername AS con1, biocon2.username AS con2username, biocon2.charactername AS con2, biocon3.username AS con3username, biocon3.charactername AS con3, biocon4.username AS con4username, biocon4.charactername AS con4, biocon5.username AS con5username, biocon5.charactername AS con5 FROM `efed_list_titles` AS title LEFT JOIN `efed_bio` AS biochamp ON title.champ_id = biochamp.id LEFT JOIN `efed_bio` AS biocon1 ON title.con1_id = biocon1.id LEFT JOIN `efed_bio` AS biocon2 ON title.con2_id = biocon2.id LEFT JOIN `efed_bio` AS biocon3 ON title.con3_id = biocon3.id LEFT JOIN `efed_bio` AS biocon4 ON title.con4_id = biocon4.id LEFT JOIN `efed_bio` AS biocon5 ON title.con5_id = biocon5.id WHERE title.status_id = '1' ORDER BY title.sortorder"; 

if(!$result = mysql_query ($query)){ debug($query);  }

while ($row = mysql_fetch_assoc($result))

{

	$fieldarray=array('title','shortname','championid','championusername','champion','con1id','con1','con1username','con2id','con2','con2username','con3id','con3','con3username','con4id','con4','con4username','con5id','con5','con5username','posername');

	foreach ($fieldarray as $fieldlabel)

	{

		if (isset($row[$fieldlabel])) 

		{ 

			$$fieldlabel=$row[$fieldlabel];

			$$fieldlabel=cleanquerydata($$fieldlabel);

		}

	}



	print "<td><span class='large'>".$title."</span>\n";

	if (file_exists($dirpath.'/images/titles/'.$posername.'.jpg'))
	{
		print "<img style='width: 240px; height: 75px;' class='champion' src='/backstage/images/headshots/".$shortname.".jpg'></img>\n";
	}
	else{
		print "<img style='width: 240px; height: 75px;' class='champion' src='/backstage/images/headshots/default.jpg'></img>\n";
	}

	print "<span class='medium'><a href='bio.php?username=".$championusername."'>".$champion."</a></span>\n";

	print "<span class='contender'>Contenders</span><ol>\n";

	print "<li><a href='backstage/bio.php?username=".$con1username."'>".$con1."</a></li>\n";

	print "<li><a href='backstage/bio.php?username=".$con2username."'>".$con2."</a></li>\n";

	print "<li><a href='backstage/bio.php?username=".$con3username."'>".$con3."</a></li>\n";

	print "<li><a href='backstage/bio.php?username=".$con4username."'>".$con4."</a></li>\n";

	print "<li><a href='backstage/bio.php?username=".$con5username."'>".$con5."</a></li>\n";

	print "</ol></td>\n";



	unset ($champion);

	unset ($championusername);

	unset ($con1);

	unset ($con1username);

	unset ($con2);

	unset ($con2username);

	unset ($con3);

	unset ($con3username);

	unset ($con4);

	unset ($con4username);

	unset ($con5);

	unset ($con5username);

}

print "</tr></table>";

}

Link to comment
https://forums.phpfreaks.com/topic/194734-tbd/
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.