ITT #4: Plugin Giveaway - FlickrScrollr

UPDATE: I've posted a new entry explaining FlickrScrollr. Please refer to that article for better implementation instructions, as well as a breakdown of how the code works.

In an effort to squeak in this week's Instant Tip Tuesday before midnight, I'm going to give away a PHP+jQuery plugin to create an animated Flickr module on your site. I call it FlickrScrollr.

View the Demo | Download the Files

What Is FlickrScrollr?

FlickrScrollr is a combination of PHP5, jQuery, and CSS. It utilizes PHP's SimpleXML extension to parse a user's Flickr RSS feed, then uses jQuery to add animation to the generated display of thumbnails, finally topping off the fun with Leandro Vieira Pinho's jQuery Lightbox plugin.

How Do I Use FlickrScrollr?

To implement FlickrScrollr... read more

ITT #3: Protecting Non-Public Files

If you've ever built a web app, you're probably familiar with the idea of breaking your code up into smaller pieces, then including those files using include_once or require_once. This practice can speed up your application, help you organize your code better, and increase the portability of code in future projects. Another benefit that file inclusion offers that's often overlooked, however, is enhanced security.

For example, nearly every app that I write reads to or writes from a database. To speed up the connection process, I've written a database class that I simply include in new projects, allowing me to easily open the connection and just keep on coding.

The information used in the included database file is sensitive data that could be troublesome in the wrong hands (i.e. the username and password for my database), and while... read more

ITT #2: Automate Your Copyright Years

If you've built blogs for clients before, or created a site based on a content management system, then you know keeping copyright information up-to-date can be a pain.

It used to be that every year, I'd have to pull up every single client's site and edit the year, which would eat up a full day of my time. It was a terrible way to start the new year, and after a couple years of tedium, I decided to deal with it once and for all.

View the Demo | Download Source

Automatically Update the Year

My first instinct was to simply use PHP's handy date() and time() functions to automatically find the year. To get the current year, you can use this snippet of code:

<?php echo... read more

Instant Tip Tuesday #1

In this series, I'd like to tackle a number of quick mini-tutorials to cover some useful tricks in PHP, CSS/XHTML, JavaScript, or whatever I happen to be working with at the time.

For our first installment, I'd like to go over a quick function I use to create a preview of text from an entry. When I was first starting to program, this was a sticking point, so I'd like to share how I solved the issue.

Create a Text Preview with PHP

Sometimes showing a title just isn't enough to grab a user's attention. You need to give them a taste of the article to get them to click through and read your content. Generating a text preview is actually fairly simple; below, we'll go through one method of displaying the first few words of... read more