Welcome to Geeklog, Anonymous Thursday, April 25 2024 @ 02:49 pm EDT

Geeklog Forums

timed image block - showing up in header?


sgtpepper

Anonymous
The funtion that I have for a timed image block is this:


function phpblock_onair ()

{

$now = date("H i s");

if ($now > ("06 00 00")& $now {
//print "";
}
//elseif
//($now > ("12 00 00")& $now //{
//print""
//}
//elseif
//($now > ("17 00 00"))
//{print"";}
}
?>


It works...but the image shows up in the header....not in the right block as I thought.....any ideas?
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Perhaps you should forget the ?> tag at the end, but I'm no developer...
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
Don't use the "?>" like beewee sujests, use return instead of print, and use the code tags when pasting code in the forums or some potentially useful information will be stripped from your forum post.

So your code would look something like (of course this is just an example I can't try it without seeing your actual code):
Text Formatted Code

function phpblock_onair ()
{
$now = date("H i s");
if ($now > ("06 00 00")& $now {
$retval = "";
}
elseif
($now > ("12 00 00")& $now //{
$retval = "";
}
elseif
($now > ("17 00 00"))
$retval = "";
}
return $retval;
}

 

Yes I am mental.
 Quote

All times are EDT. The time is now 02:49 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content