JamesC70
12-28-2008, 01:27 AM
Okay.... for New Year's I want to display a dropping ball (similar to the New York City event) on my forum in place of the forum logo graphic.
I've already created 61 seperate logo images, with the appearance of the ball dropping down, and uploaded them to the server. I've also written a little PHP file that will display the files in order once we're one minute away from New Year 2009. (Logo 60 is the ball at full height, as we get closer to 0 the ball "drops", and Logo 0 is the ball completely down with the words "Happy New Year" above.)
However, I'm totally stuck on getting the PHP to work within the vB header template. It seems that no matter how I encapsulate the <if> conditionals, the logo variable isn't actually assigned. In addition, the line below that displays the number of seconds til 2009 displays code instead of the variable's value.
Here's the PHP code to determine which logo to display:
<?php
$target = mktime(0, 0, 0, 1, 1, 2009) ;
$today = time () ;
$difference =($target-$today) ;
$seconds =(int) ($difference) ;
if ($seconds < "0" ) { $seconds = "0"; }
if ($seconds < "60" ) { $logo = "http://(websitename).com/images/nye/mm-logo-ny$seconds.png"; }
else { $logo = "http://(websitename).com/forums/images/mm-logo-black-480x110.png"; }
?>
... and here's the PHP code to actually display the header graphic:
<!-- logo -->
<a name="top"></a>
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td align="center">
<?php
print "<img src=\"$logo\" border=\"0\" /><br />";
if ($seconds < 61)
{ if ($seconds > 0)
{ print "$seconds seconds remaining til New Year 2009!</td>"; }
else
{ print "</td>"; }
}
?></tr></table>
<!-- /logo -->
(And yes, I did try to use $stylevar[titleimage] instead of $logo when I was in the vB template.)
Any ideas? Is this even possible in vB 3.7.4? :confused:
I've already created 61 seperate logo images, with the appearance of the ball dropping down, and uploaded them to the server. I've also written a little PHP file that will display the files in order once we're one minute away from New Year 2009. (Logo 60 is the ball at full height, as we get closer to 0 the ball "drops", and Logo 0 is the ball completely down with the words "Happy New Year" above.)
However, I'm totally stuck on getting the PHP to work within the vB header template. It seems that no matter how I encapsulate the <if> conditionals, the logo variable isn't actually assigned. In addition, the line below that displays the number of seconds til 2009 displays code instead of the variable's value.
Here's the PHP code to determine which logo to display:
<?php
$target = mktime(0, 0, 0, 1, 1, 2009) ;
$today = time () ;
$difference =($target-$today) ;
$seconds =(int) ($difference) ;
if ($seconds < "0" ) { $seconds = "0"; }
if ($seconds < "60" ) { $logo = "http://(websitename).com/images/nye/mm-logo-ny$seconds.png"; }
else { $logo = "http://(websitename).com/forums/images/mm-logo-black-480x110.png"; }
?>
... and here's the PHP code to actually display the header graphic:
<!-- logo -->
<a name="top"></a>
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td align="center">
<?php
print "<img src=\"$logo\" border=\"0\" /><br />";
if ($seconds < 61)
{ if ($seconds > 0)
{ print "$seconds seconds remaining til New Year 2009!</td>"; }
else
{ print "</td>"; }
}
?></tr></table>
<!-- /logo -->
(And yes, I did try to use $stylevar[titleimage] instead of $logo when I was in the vB template.)
Any ideas? Is this even possible in vB 3.7.4? :confused: