New blog at Rickety Me

Blog Makeover

July 12, 2008 by rickety  
Filed under Code

Yesterday I made the switch from my old rickety blog to a new location and a new theme. I took the blog out of www.rickety.us and exported my posts to a new database. To redirect I wrote the following code in the index.php:

<?php
header( 'Location: http://www.rickety.us' ) ;
?>

Of course I began to alter the theme immediately. I made 24 new banners and used the rotator script to randomly change the banner. If you refresh the page the banner will often change. Once I have seven more banners I can change to displaying a different banner for every day of the month. I can do this by changing the code from:

mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along
header('Location: '.$folder.$files[$rand]); // Voila!

to this:

// A different banner for each day. Make sure you have 31 banners.
$when=getdate(date("U"));
header('Location: '.$folder.$files[$when[mday]]); // Yeah!

To test this I added seven more geese banners and that is why when I switch from daily banners to random banners you will more often get geese on a refresh.

This new theme is fluid and handles widgets better than the old theme. A link to where I got it from is in the footer. Tell me what you think of the new theme. Do you like it better than the old one?

Bookmark and Share

Related posts (auto generated)

  1. Rickety Review #1 I am using five widgets on my left sidebar. The...
  2. How to Create An Index For Your Wordpress Blog Enhance your WordPress blog by creating multiple, three-level alphabetical indexes...
  3. Rickety Blog Statistics Looking at the most popular posts you can see that...

Comments

4 Responses to “Blog Makeover”
  1. Anonymous says:

    Could I get that in English, er, American English?
    Max

  2. rickety says:

    In American English it reads, “You get a different photograph displayed each time.”

  3. Marc Chen says:

    Dear Rickety:

    Am just wondering if it’s possible to modify the script so that images could be randomly rotated after certain period of time (e.g. 5 sec) w/o refreshing the webpage? Thanks.

  4. rickety says:

    That is a good question. I don’t know the answer. At first I ran the script so the page would change each day but that involved a refresh also. What you want to do is a great idea, especially if the user could set a switch to do it. You probably already know but the banners are itemized on two blog posts: A Banner Story and A Banner Story Continued. I show almost all the banners and the photograph they were cropped from and also give a little background. Thanks for your comment and enjoy your day.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

CommentLuv Enabled