Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Dec 2008, 03:27
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Real-time Logo Graphic Changes in vB 3.7.4 ?

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

... and here's the PHP code to actually display the header graphic:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(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?
Reply With Quote
  #2  
Old 28 Dec 2008, 10:29
Attitude5ire's Avatar
Attitude5ire Attitude5ire is offline
 
Join Date: Feb 2006
I would recommend to use a Flash option and this solution is much easier in fancier with Flash.
__________________
New Style Satinacious Released
DigitalVB.com
simply beautiful! vBulletin designs
Join us on Facebook

Reply With Quote
  #3  
Old 28 Dec 2008, 17:34
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Will Flash detect the time of day from the server and automatically adjust the logo as appropriate?

What I'm trying to accomplish is for the forum to appear normal until one minute before midnight on January 1, but these images (or a single Flash animation) to appear during the one-minute countdown.

Once New Year's Day has arrived, I don't mind the finished screen with "Happy New Year!" staying for a few hours or until I revert back to default style. (I am currently using a clone of the default style for this project.)

The intent is to free me up so that I don't actually have to be on the forum to swap the style just before midnight. We have computers that can adjust things based on date and time of day, I want to be able to do that.
Reply With Quote
  #4  
Old 28 Dec 2008, 21:19
Attitude5ire's Avatar
Attitude5ire Attitude5ire is offline
 
Join Date: Feb 2006
You can have UTC universal timezone. So it acts whatever you what to do during that time.. If you go by local pc time which is not favourable as there might be different timezone people in your board. Just go with universal timezone it should be easy to do.
__________________
New Style Satinacious Released
DigitalVB.com
simply beautiful! vBulletin designs
Join us on Facebook

Reply With Quote
  #5  
Old 28 Dec 2008, 23:04
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
I ended up putting it in an IFRAME, and adding a META REFRESH. For anyone else who wants to do something similar, here's the new code:

Header Template Within vBulletin: (Red is the part to review or change to suit your needs.)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Revised PHP code (countdown.php):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Using the above code:

- Set the mktime function to the end of countdown (hours, minutes, seconds, month, day, year). You may need to adjust this for your server's timezone. If you want to display New Year's in Denver but your server is on New York time, set the mktime function for (2, 0, 0, 1, 1, 2009), which would instead trigger for 2am New York, which is Midnight in Denver.

- The "if $seconds < 90" starts refreshing the IFRAME, and displaying a countdown, roughly 30 seconds before the custom New Year logo graphics start appearing. I didn't want to go through all this work and nobody notice them. Adding the countdown seemed to be a quick way to get viewers' attention.

- The "if $seconds > 0" bit of code stops the refresh once we hit end of countdown, and also stops displaying the "__ seconds til New Year" line below the logo graphic.

My forum sees about a thousand uniques per day, and I only expect to see 20 people or so when this would be active, so the timing works for my server. If you have a busy forum, you might need to adjust the $difference calculation in the PHP code to account for lag time.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:24.

Layout Options | Width: Wide Color: