• Skip to main content
  • Skip to primary sidebar

Playing with Technology

Any sufficiently advanced technology is indistinguishable from magic. ~Arthur C. Clarke

Creating template based websites

November 25, 2005 by Jon

I’ve been trying to develop a template based website design for the College the past couple of days. There are two problems to overcome: the current server does not support server-side-includes and the personal pages server doesn’t allow PHP. The natural way to create a template based site is to create headers, footers, and other common elements and include them with an include statement, this requires server-side-includes. The requirement for server-side-includes can be overcome by using PHP and require() statements, but of course this requires PHP to be enabled. So the bottom line is that I have a template for sites residing on the main web server, but there is no workaround I can see for sites living on the personal pages server.

In the process of trying to overcome the limitations of the configurations of the servers, I came across a solution to another problem. I like to have my web pages show the date and time of last modification. On my test server this was an easy echo in PHP of some server variable, but safe mode or some other restriction on the Netware Apache renders this inoperable. So I have found that the following will work instead:

*****************
**Get environment variables.
******************
$full_path = getenv("REQUEST_URI");
*****************
** Evaluate base path's existence,
** get filename and compensate for
** hidden index.html file then return
** date and time of last modification.
*****************
$dot_pos = strpos($full_path, ".");
if ($dot_pos == false) {
$base = $full_path;
$page_file = "index.php";
} else {
$base = dirname($full_path);
$page_file = basename($full_path);
}
echo "Last modified: " .date('F d, Y ', filemtime($page_file));
echo "at " .date('h:i:s A.',filemtime($page_file));

Make sure to enclose this in a PHP environment and that pages including this code fragment end in .php. Enjoy.

Share this:

  • Tweet

Filed Under: Geek

About me

Avatar of Jon Breitenbucher Sometimes I'm an Instructional Technologist and sometimes I'm a Mathematician, but I'm crazy all the time.

Inbound Marketing Certification Badge

Subscribe through an RSS feed reader

News Feed Comments Feed

Or one of the options below:

Subscribe

Genesis Framework for WordPress

Blogroll

  • Blogical Construction
  • Bootstrap Analysis
  • D’Arcy Norman
  • Infocult
  • jill/txt
  • Jim Groom
  • Liberal Education Today
  • Mark Pearson
  • Thoughts and Experiments
  • webbedENVIRONMENTS
  • WPMUtutorials

Interesting sites

  • 9 Rules
  • Inksmith

it blogs

  • instructional technology
  • Matt Gardzina

My Sites

  • Jon Breitenbucher
  • My static site
  • Orthogonal Creations
  • Voices
  • WoW Ravings

Software

  • Textpattern
  • Wordpress
  • WordPress Planet
  • Wordpress.com

Teaching

  • Extreme Teaching

Typography

  • baseline 50
  • disdributed proofreaders
  • fontzone
  • PRINT
  • Project Gutenberg
  • The Terminal

Web design

  • 960 grid
  • A List Apart
  • Blueprint
  • CSS Zen Garden
  • Typogridphy
  • W3 Schools

site cloud

Classroom Conferences Educause Futurism Gaming Geek General Hardware Instructional Technology Interesting sites Multimedia NMC Personal Policy Presentations Site Social Software Software Teaching Typography Web design woodle

Now Playing:

Recently Played:

pages

  • About
  • MU Admin Bar

categories

  • Classroom (rss)
  • Conferences (rss)
  • Educause (rss)
  • Futurism (rss)
  • Gaming (rss)
  • Geek (rss)
  • General (rss)
  • Hardware (rss)
  • Instructional Technology (rss)
  • Interesting sites (rss)
  • Multimedia (rss)
  • NMC (rss)
  • Personal (rss)
  • Policy (rss)
  • Presentations (rss)
  • Site (rss)
  • Social Software (rss)
  • Software (rss)
  • Teaching (rss)
  • Typography (rss)
  • Web design (rss)
  • woodle (rss)

archives

Social network

  • Facebook
  • Linked in
  • Flickr

feed me

  • RSS
  • Atom
  • Comments RSS

Counter

  • 1 currently online
  • 12 maximum concurrent
  • 913179 total visitors

| home |

return to top of page

inspired by a not (that) ugly design modified by jon breitenbucher to use the genesis theme framework by StudioPress and powered by WordPress | Log in |
diigo My Diigo Tags
Green Web Hosting! This site hosted by DreamHost. Use OpenDNS Creative Commons License