rf2k Posted June 11, 2015 Share Posted June 11, 2015 Ok first things first, i am absolutely hopeless when it comes to PHP and you are all much smarter than me....hence why im here. I have an advertising website and when a user is not displaying an image with their link i want it to display a default one from Adhitz. Can this be done? I have a feeling this is the part of code that i need to edit but dont know how <div class="ad-title"> <span class="pointer" onclick="window.open('index.php?view=surfer&t={$ad.token}','_blank');">{$ad.title|stripslashes}</span> </div> {if $adcategory[c].hide_descr != 1} <div class="ad-content"> <table cellpadding="5" width="100%"> <tr> {if !empty($ad.img) && $ad.img != 'http://} <td valign="top" width="100"> <img src="{$ad.img}" style="max-height:100px; max-width:100px" /> </td> {/if} <td valign="top">{$ad.descr|stripslashes}</td> </tr> </table> </div> {/if} <div class="ad-footer"> Earn ${$ad.value} </div> And this is the code i want to put in when people arent using their own banner / image <script type="text/javascript" src="http://adhitzads.com/802215"></script> Quote Link to comment https://forums.phpfreaks.com/topic/296759-help-newbie-at-work/ Share on other sites More sharing options...
cyberRobot Posted June 11, 2015 Share Posted June 11, 2015 I would imagine that you would need to add an "else" component to the following: {if !empty($ad.img) && $ad.img != 'http://} <td valign="top" width="100"> <img src="{$ad.img}" style="max-height:100px; max-width:100px" /> </td> {/if} I'm not sure what that would look like since the above code isn't quite PHP. It's more like placeholder text that's converted into PHP. Quote Link to comment https://forums.phpfreaks.com/topic/296759-help-newbie-at-work/#findComment-1513684 Share on other sites More sharing options...
dalecosp Posted June 12, 2015 Share Posted June 12, 2015 (edited) Looks like a templating lingo, similar perhaps to Smarty .... Edited June 12, 2015 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/296759-help-newbie-at-work/#findComment-1513750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.