farmerdon Posted March 16, 2009 Share Posted March 16, 2009 I am using a joomla component called Ezrealty. I'm unsuccessfully trying to modify the php code so that I can get a gif to show up at the frontend if a user has a link to a video in their listing. I contacted the EZrealty support and they gave me the following advice: it is possible to add a gif if you have a video listed - look at the viewdetails.ezrealty.php file in the templates directory and find the $row->vtour code. Look specifically at how the "if" statement is written before it allows the video code to show, and instead of video code you'd display a graphic on the listings page template. the code:- if ($row->vtour && $row->vtour != 'http://' ){ video gif html goes here } means if there is something stored in the field vtour and if what is stored in that field is NOT just http:// then you can display what's inbetween the curley brackets - and that means in people-speak that the field contains something indicative of a video so you'll want to show the video gif html code. see that is a curley bracket at the end of the line (I've left the php tags off because they will break this system), and curley brackets always come in pairs - one to open and one to close. I have come up with some bit of code that might work but it is still producing a slight error. I'd appreciate if a PHP whizz might be able to correct this code: <?php if ($row->vtour && $row->vtour != 'http://' ){ echo "<a href = " . $row->vtour . "> <img border="0" alt="" src="http://www.mywebsite.com/components/com_ezrealty/images/video.gif"></a>" };?> The error is: Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/farmingp/public_html/components/com_ezrealty/forms/templates/template10/viewdetails.ezrealty.php on line 567 Just to show the area of the code that I'm working on. In my file it is line 567. Near the following code: <?php } ?> </td></tr> <?php } ?> <tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_CATEGORY_CATNAME;?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><a href="<?php echo sefRelToAbs("index.php?option=com_ezrealty&Itemid=$myItemid&task=viewcategory&id=$row->cid");?>"><?php echo stripslashes($cat->name);?></a></td></tr> <tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_VIEWDET_LOCALITY;?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><?php if ($loc->ezcity_desc){?><a href="<?php echo $link17;?>" onmouseover="return overlib('<?php echo $loc->ezcity_desc;?>', CAPTION, '<?php echo $loc->ezcity; ?>');" onmouseout="return nd();"><?php } ?><?php echo stripslashes($loc->ezcity); ?><?php if ($loc->ezcity_desc){?></a><?php } ?></td></tr> <?php if ( $row->county ){ ?> <tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_DET_COUNTY;?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><?php echo stripslashes($row->county);?></td></tr> <?php } ?> <?php if ( !$er_usemap && $row->mapref ){ ?> <tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_VIEWDET_LOCATION;?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><a target="_blank" href="<?php echo $row->mapref;?>"><?php echo _EZREALTY_VIEWDET_MAP;?></a></td></tr> <?php } ?> <?php if ($row->vtour && $row->vtour != 'http://' ){ echo "<a href = " . $row->vtour . "> <img border="0" alt="" src="http://www.farmingpages.com/components/com_ezrealty/images/video.gif"></a>" };?> <tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_VIEWDET_TOUR;?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><a target="_blank" href="<?php echo $row->vtour;?>"><?php echo _EZREALTY_VIEWDET_VTOUR;?></a></td></tr> <?php } ?> <?php if ( $row->openhouse ){ ?> <?php if ($row->ohdate && $row->ohdate != '0000-00-00'){?><tr><td valign="top" align="<?php echo $er_textalign;?>" width="150"><img src="<?php echo $mosConfig_live_site;?>/components/com_ezrealty/images/bullet.gif" border="0" width="12" height="12" alt="" /> <?php echo _EZREALTY_OPENHOUSE_DETAILS; ?></td><td align="center" width="10" valign="top">:</td><td valign="top" align="<?php echo $er_textalign;?>"><?php echo _EZREALTY_OPENHOUSE_DATE;?>:- <?php Link to comment https://forums.phpfreaks.com/topic/149654-tring-to-have-a-gif-appear-if-video-included-in-listing/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.