View Single Post
  #109  
Old 02-19-2009, 04:46 AM
setishock setishock is offline
 
Join Date: Feb 2008
Location: Houma, La.
Posts: 1,177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had asked about something to flip through a set of background images. So...

Tip of the hat to my little buddy Neko :3. It came up that it would be nice if the header changed when you refreshed the browser or when you jumped from page to page. It was his idea so I asked him to go find something that would do the job. The first thing he came back with was a coding nightmare.
But this one is so simple and elegant, That I had to come share it with you guys and gals.

http://forum.tufat.com/showthread.php?t=53769

Only thing I did different is I didn't replace any of the header code but instead I placed this line>

Code:
<img src="/path/to/new/folder/rotate.php">
which was changed to the correct directory path, just before any mention of the header image and commented out the code that has the directory path for the stationary image I had been using. Put this at the start of the original code statement <!--
Then this at the end -->
Winds up looking like this <!-- A line of code goes here --> Anything in between gets ignored. Saves whacking up your code.

It's intent was to change the header, which it does rather well. BUT it dawned on me if the img src statement was altered to CSS code it could be used to rotate the background image for this theme. So...
Change this>
Code:
<img src="/path/to/new/folder/rotate.php">
to this>
Code:
background: url(http://the/ complete/ path/ to/ your/ picture/ folder/rotate.php) fixed;
and park it in the Extra CSS Attributes in the Body controls in the CSS page. Fixed at the end keeps the background pinned down so it doesn't move when you scroll through the forum.

I have to admit, it works rather well. At my place right now, it's pointed at the header folder which has this php file and the header images. So if you come by to look it's repeating like crazy because the images are so small. Just click the browser to get a different image in the background. Check the anime planet theme to see how it works as a header changer. I'll be changing the background images as time permits. This link takes you directly in to the transparencity theme> http://animeappeal.com/forums/index.php?styleid=36
But it works!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01007 seconds
  • Memory Usage 1,769KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete