Randomized Photo Headers

The header images are now randomized. At the moment you’ll get 1 of 26 possibilites on each page you visit. More will certainly come, I’ve barely dipped into my photo archive at this point. You can view all the headers (without refreshing a billion times) here (I’ll make this look nicer tonight).

Enjoy…

If you’re a Kubrick user and want to do this on your site, just copy this into your index.php file just above the <style> tag:

<?
// Gen random header img
// Images must be in [your blog url]/images/head/
// Images must be named 0001.jpg, 0002.jpg, etc.

$num_img=26; //number of images - change this!
$rnd_num=rand(1,$num_img);
$head_img=str_pad($rnd_num, 4, "0", STR_PAD_LEFT);
?>

Then replace this line:

#header { background: url("< ?php echo get_settings('siteurl'); ?>/images/kubrickheader.jpg") no-repeat bottom center; }

With this:

#header { background: url("< ?php echo get_settings('siteurl'); ?>/images/head/< ?php echo $head_img?>.jpg") no-repeat bottom center; }


5 Responses to “Randomized Photo Headers”

  • Kevin Says:

    Love the header images. Colorful, changing, bold. Very cool. It’s kind of like what I’m trying to do on the top of my blog, but yours is so much more colorful and inviting. Probably easier to add a new one, too.

    I would encourage you to add a page where you can see them all. That’s always fun to look at.

    My fav’s so far:
    wood grain
    stop sign
    shaft of wheat

  • Kevin Says:

    Ooh, ooh–add ‘close up of a rusty nail in a telephone pole’ to my list of favs. I’ve seen that pic before, but I love it.

  • Kevin Says:

    He listens! He actually listens!

    But seriously folks… nice pics, Nick. I enjoyed looking through all of them. I can tell in a couple spots you have very similiar images, and like me, I’d guess you just couldn’t decide which one to go with, so you went with both. Ah, the joy of the technology where we can have our cake and eat it too.

    On a dorky techie note, I’m a bit surprised at the file size of all your images. Seems like it makes the whole page a pretty large download. Any techie thoughts?

    And why am I the only one commenting on this? Are you people all asleep? Too captivated by the colorful pictures to think? Did the rapture happen? Do you have actual lives? Or am I just too distracted today?

  • Nick Says:

    Kevin, dude. Wow. Like that’s a lot of comments in a short amount of time.

    RE: Similarity
    Yeah, I couldn’t pick a fav, and since they are random and I want lots of them I figured why not?

    RE: File size
    They are saved a a quality of 60 in PhotoShop. That’s the default in the Kubrick template. Normally I don’t go that high, and I may reduce it to 50 or 40 (73k is a bit big) but they download after the page so it doesn’t make the page slower, but does make the user wait for it on new ones. They are also large (lots of pixels) so they’re gonna be big no matter what.

  • » Headers Kubrick Says:

    […] po Coordinaci√ɬ≥n y Apoyo a las 1:25 pm el Monday, September 26, 2005

    En esta pagina hay diferentes headers para su plantilla Kubrick, est’a en ingles, te […]

Leave a Reply