Archive for the 'php' Category

Flickr Photo Gallery Release - “Cruiser”

16May06 | geek, php | No Comments »

I have decided to release my photo gallery code, in hopes to have the public improve upon the code/gallery. I am by no means a php expert, and would appreciate any help possible. Feel free to check out the code, and the gallery itself. I dubbed the gallery with the name “Cruiser” as in Cruising your flickr photos, and also it’s the nickname of my dog lol. Feel free to download the gallery over at the Cruiser project page. Thanks!

Now Playing Plugin - Update

17Jan06 | geek, php, wordpress | No Comments »

I have released version 0.2 of my Now Playing Wordpress plugin. Go to the project page for the download.

Evolution of brettdriscoll.com

14Dec05 | design, geek, php, wordpress | No Comments »

I finally have decided on a base theme for wordpress. The winner is binarybonsai’s k2 theme. It seems to have everything that I wanted including asides. From wikipedia Asides are:

In drama language asides are parts of speech that are spoken away from other characters. The character either speaks aside to himself, secretively to other character or to the audience (ad spectatores).

I’m basically going to use asides for sharing things that don’t necessarily warrant their own post. Right now its displaying all the entries from the category “Friends and Colleagues”, but in the future the category “asides” will be displayed. The now playing section will be moved to the about page, which I will be completely redoing shortly.

Using php to change active link class

09Oct05 | design, geek, php | No Comments »

I ran into a problem on my last project where I was using a php include for my navigation bar, No big deal right? But I also wanted to be able to change the class of my active page/link on each page so the button/link looked like it was pressed down. View my index page to see what I mean, the link for blog will apear different than the other links. This is no sweat if you have your nav code on each page, you would just set the class to “active” like this :
[code lang="html"]
link1
[/code]
But what happens if you are including your navbar into each page? I wrote this little script to basically check what page I am on, and then set the class active for that page. I now have a php include navbar that knows what page you are currently on and changes the link class accordingly. I am not going to get into the css side of this. I will save that for another time lol.

This is the code for the navbar.php include

[code lang="php"]
< ?php
echo '

    ‘;
    echo ($PHP_SELF == ‘/page1.php’) ?
  • Page One
  • ‘ :

  • Page One
  • ‘;
    echo ($PHP_SELF == ‘/page2.php’) ?

  • Page Two
  • ‘ :

  • Page Two
  • ‘;
    echo ($PHP_SELF == ‘/page3.php’) ?

  • Page Three
  • ‘ :

  • Page Three
  • ‘;
    echo ($PHP_SELF == ‘/page4.php’) ?

  • Page Four
  • ‘ :

  • Page Four
  • ‘;
    echo ”;
    ?>
    [/code]

    Now copy and paste the following code into each page you want your navbar to be on (in the proper location of course). I placed the navbar.php file in the includes directory, if you do not do the same make sure you change the path in the following code.
    [code lang="php"]
    < ?php
    include '/includes/navbar.php';
    ?>
    [/code]

Unique Visiter Counter

05Jun05 | geek, php | No Comments »

Well I added a unique visitor counter to the site. The counter on the bottom doesn’t care who you are or how many times you have been here…….it will always count you. The counter I added above the right side bar will only count you once. It checks your ip address against a database I set up and if your ip address is already there it won’t count you. If your ip address is not there, then the script adds you to the database and counts you. This is a fairly simple script but is one I can say I pretty much wrote on my own ;-) If you are nice and ask I can hook you up with it.