Jump to content

Recommended Posts

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>
Link to comment
https://forums.phpfreaks.com/topic/296759-help-newbie-at-work/
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/296759-help-newbie-at-work/#findComment-1513684
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.