Jump to content
House Price Crash Forum

Archived

This topic is now archived and is closed to further replies.

hedgefunded

And Php Coders About

Recommended Posts

Does anyone have 5 minutes to modifiy a bit of code for me please. It really will be 5 minutes for anyone who knows their PHP onions.

Cheers

My PHP's okay, so I may be able to help out.

Share this post


Link to post
Share on other sites

My PHP's okay, so I may be able to help out.

Thanks. I doubt I'll be able to post directly so I'll just go and comment what I want in a text file and attach it to my next posting.

Cheers

Share this post


Link to post
Share on other sites
// Don't echo it Thursday 9:00 -21:00 and echo the video html instead

You can put your html in an if clause:

<?phpif(condition){?><!--HTML GOES HERE--><?php}?>

Just make the condition 'not Thursday'

You can also stick an else clause afterwards using the same principle

Share this post


Link to post
Share on other sites

OK, I've attached my bit of code. It for a pub website.

We show a daily advert most of the time, but Thursday 9:00 to 21:00 is a video instead.

The code is commented to explain.

Cheers

It's already been answered really, but because I offered to help... :)

<?php// Is it Thursday between 0900 and 2100?if ($d == 4 && $h >= 9 && $h < 21){?><div style="margin-left: 50px">{flv}ploughvideo{/flv}</div><div class="youtube">Using an iPhone or having trouble with the video?<a target="_blank" href="http://www.youtube.com/watch?v=zr6cGF9LZUs">Click here to watch on Youtube</a></div><?php}else{?><div class='dailyimage'><img src="http://www.theploughharborne.co.uk/images/stories/dailyadverts/<?php echo $img; ?>"><?php}?>

As you might expect, I've not actually tested this -- but the principle is sound, and it'll probably work as is (or more or less as is).

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • 284 Brexit, House prices and Summer 2020

    1. 1. Including the effects Brexit, where do you think average UK house prices will be relative to now in June 2020?


      • down 5% +
      • down 2.5%
      • Even
      • up 2.5%
      • up 5%



×
×
  • 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.