July 2008
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
About Me!
  • Name:Kasey
  • Location:An insane asylum called California
Categories
Daily Blog Reads
Archives
Extras
Credits
Visit ASPCA.org
Recent Comments
Jennie: It did make me run right out and get one ... [more]
Bonnie: I read several articles and actually was ... [more]
Bruce: Some interesting stuff there. Some I do, ... [more]
Kasey: Judy, I believe you're making a false as ... [more]
Judy: With S.S. many more people are paying in ... [more]
Kasey: I understand what you're saying complete ... [more]
Bruce: Well, I don't know what to comment on th ... [more]
Bonnie: Merry Christmas to you and your DH too, ... [more]
Bruce: Well, I for one did get a gadget gift. M ... [more]
Kristi: Hey Kasey! Merry Christmas to you, too! ... [more]
Kasey: Thank you, Bruce, for the well-wishes. F ... [more]
Bruce: Merry Christmas Kasey and Travis. Hope y ... [more]
Immigration
The Bear Flag League
Friday Night Fun  « «   Home   » »  Why Buy the Cow?

Browse inside category "Miscellaneous":
Using PHP Includes   » »  Modifying the MT Login Screen
 

June 09, 2004

Using PHP Includes

My apologies for the lack of posts lately. I'm sure I could have posted some inane dribble about this or that, but I'd much rather post when I've got something at least slightly more interesting that dryer lint to talk about!

So, you may be wondering, "Why the absence?" Well, over the past several days, I've been doing some minor tweaking of The Doggy Diaries to make it easier for me to administer. I hope it's also a bit more user-friendly now. One of the major changes to this site is that most pages, with the intentional, notable exception of the comment preview, trackback, and individual posting pages, have a consistent look and feel. All pages now proudly display the "Pudgy Puppy ... gone to the dogs" graphic header and sport a left-side navigation column. In addition to the benefit of having a site that is visually consistent from one page to the next, thereby making it easier for the user to learn his/her away around, it also provides the value-added benefit of having all home page navigation and accesskeys embedded in each page. The "search" bar is also available on all pages except those noted above. So if at any point while browsing the site, you decide you want to jump to a different part of the site -- say from my posts for the month of August to those from the month of June -- you can easily do so without having to first return to the home page.

How was this accomplished? I could have taken the labor-intensive approach and hand-coded the navigation menu, search bar, and header graphic on each page. That would be a newbie's approach because they wouldn't have enough exposure or experience to know of a better way. It's also the most error-prone method because you can easily change something to common code on one page and forget to make the same changes on all other pages.

I could also have used the native "Template Module" features of Movable Type to create each piece as its own separate module and included them into each page with <MTInclude module="name_of_module"> statements. This, too, would have proven a bit too much work because I would have had to use the Movable Type system to rebuild each Template Module every time I updated it.

The method finally settled on was my favorite -- PHP includes. The method is similar to the "Template Module" method offered by Movable Type, with one very important exception ... I do not have to rebuild the template each time I make a change to it. By using PHP includes, I create the code one time, insert it into my page with a short piece of code such as

<?php include('name_of_file.inc'); ?>

and enjoy the results. No rebuilding is required! It's sort of like a plug-n-play device. I just plug it in, and without any/much configuration, it works like magic!

Speaking of "magic," I think I'm off to play my Sims now. (If you're wondering what I'm talking about or think I just brought in something out of left field, check out The Sims website. You'll see that the latest expansion pack is called Makin' Magic.) It's been several months since I've taken any time to play with my little characters, and they must be missing me something awful! ;-)

Before I go, however, let me add that if you see anything amiss while browsing the site, please drop me a line using my new contact form and let me know where you've located a problem.

With that, I bid you "good evening" and "good night."

Posted by Kasey on June 9, 2004 07:11 PM | Filed Under: Miscellaneous
Comments

That's right, my friend, leave the inane dribble to me. I'm an expert! And dryer lint is my life! hehe!
Seriously though, I love what you have done with your site. I prefer uniformity and continuity. Your missive on php with regards to MT is very informative and I shall do some trial and error with MT when I get the chance. I have only puttered with it so far. I am familiar with php, I use php, but my knowledge on the subject is minimal. I admire what you have learned and what you have done.
I was wondering if you were able to enjoy some quality "Travis time" last weekend. Also, how are Harry and Sally doing?

Posted by: Bunni on June 10, 2004 05:04 AM