PHP Thumbnails on the Fly

In the MegaGallery project, we used the EXIF library in PHP to extract the thumbnails from the image itself. However, what do we do if we do not have EXIF installed or available through our web server provider? One possibility is to use the GD library. The GD library will allow us to create a thumbnail using the image itself. Continue reading

PHP XTemplate: Import Files

In the previous two tutorials on XTemplate, I discussed the basics of tag assignment and dealing with dynamic blocks, but the real power of using a templating system comes when you are able to use the same basic layout template on more than one page while displaying different content. XTemplate allows us to import template files into an existing template, allowing us to maintain a site structure on each page, but the true power comes when we need to make changes to the layout. Edit one file and the changes go into effect for all the pages using that template. Continue reading

PHP XTemplate: Multiple Dynamic Blocks

In PHP XTemplate: The Basics, I covered the basics for using the XTemplate engine. In this tutorial, I will cover using dynamic blocks to fill in information from a data source. For this tutorial, I will use an XML file for my data source. For more information on using PHP to read XML files, see my tutorials on Reading XML files with PHP. I will use the XML file created in the first part of that series. Continue reading

PHP XTemplate: The Basics

I have used FastTemplates for my PHP templating engine for years now, but it seems it is no longer supported. I still like it. It works well with some projects, but I decided maybe it was time to move on to something new. In my search, I came across a post from Web Resources Depot listing 19 PHP template engines. Some of these I knew (like Smarty), and most seemed more complicated than I needed. Let’s face it, I want to create web sites and develop PHP packages not learn a whole new markup system. Continue reading

Reading XML with PHP, The XML Document

I have found many situations where being able to read the information in a XML/RSS file has come in handy. For example, putting a block on a page with the latest entries from a blog. Since XML files are basically structured flat databases, I use them sometimes for short collections that do not require security.

XML files are not difficult. You don’t need a fancy, expensive program to generate them, and PHP has functions built in to read and manipulate them. Continue reading