Hi I have the following script:
<?php
$table = 'web_site_content';
$tableVars = 'web_site_tmplvar_contentvalues';
$id = $modx->documentObject['id'];
$sql = "Select * from $tableVars where contentid = $id and tmplvarid = 2";
$result = $modx->db->query($sql);
if($row = $modx->db->getRow($result))
{
?>
<div id="banner">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="746" height="235">
<param name="movie" value="<?php echo $row["value"]; ?>" />
<param name="quality" value="high" />
<embed src="<?php echo $row["value"]; ?>" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="746" height="235"></embed>
</object>
</div>
<?php
}
else
{
$sql = "Select * from $tableVars where contentid = $id and tmplvarid = 1";
$result = $modx->db->query($sql);
if($row = $modx->db->getRow($result))
{
echo'<div id="banner"><img src="'.$row["value"].'" width="746" height="235" /></div>';
}
}
?>
Basically it checks whether there is a flash banner uploaded and loads it into a div. If there isn't a flash banner uploaded then it loads the image.
The image loads without a problem when there isn't a flash item, but when there is a flash item, instead of the flash item, it loads the following error message:
" /> " quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="746" height="235">
Any suggestions?