Skip Navagation

Full On Design

A Web Development & Technology Blog

 

Coding

Internet Statistics – April 2009 (and IE6 Death Date)

Overall April was quite an eventful month for the OS and Browser wars. On the OS front, Windows 7 (Win7) release candidate was made available to the public, which has received quite a positive response. Microsoft also started advertising how cost effective windows machines are in their “I’m a PC” advertisement campaign.

Browser wise, webmaster have been encouraged by Google to inform their IE6 users about the alternative browser available and the disadvantages of IE6. The effect this has had on IE6 users is debatable, but overall IE6 is slowly disappearing.

Read the rest of this entry »

The Google Chart API


This is a simple pie chart

Google offers Webmasters an easy solution to create simple or and quite complex graphs in the Google Chart API section of the Developers Guide. It is quite simple to use, if you want to create an image such as above, just link to the following image:

]http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Pie|Not%20Pie

Read the rest of this entry »

Making a simple Facebook Application

In this quick tutorial I’m going to show you how to make a simple “return all” application for facebook. Before you start take a look at the Facebook Developers page and the Facebook Developers Wiki as it’s full of useful stuff.

The Core Components

  • API – Lets you talk to the facebook servers. [put picture here explaining in detail]
  • FBML – Facebook markup language, it’s like a cute little html snippet which facebook turns into normal HTML.
  • XFBML – A javascript which lets you use FBML in iframes.
  • FQL – Lets you run SQL type query’s.
  • FBJS – This changes your javascript so you can only work within a close environment.
  • PHP Client Libraries – The PHP Facebook provides to communicate with their servers.

Read the rest of this entry »

Simple PHP Download Counter

Here is a really easy and lightweight way of logging the amount of downloads.

<?php # File created on 25th April 2009 by Mike Rogers (http://www.fullondesign.co.uk/). 

## Start defining constants ##
define(LOG_URL, '/home/user/download_logs/'); // Put the location of where you want to put the logs. Make sure this is absolute
# $_GET['ID'] - this is the ID of the file we want. It gets the value from the URL.

## Now set the data you wish to use - this can be moved to an include if you want ##
$file[0] = 'http://www.example.com/file.pdf';

## Define the functions required to update the file.
function update_file($filename, $value){
	if(is_writable($filename) && is_readable($filename)){
		if(file_put_contents($filename, $value)){
			return TRUE;
		}
	}
	return NULL;
}
function pull_file($filename){
	if(is_writable($filename) && is_readable($filename)){
		return file_get_contents($filename);
	}
	return NULL;
}
function rebuild_file($filename){
	if(is_writable($filename) && is_readable($filename)){
		file_put_contents($filename, '1');
	}
}

if(is_numeric($_GET['ID'])){ // Meaning the Data sent is safe.

	// Build log file URL
	$filename = LOG_URL.$_GET['ID'].'.log.txt';
	$value = pull_file($filename);

	header('location:'.$file[$_GET['ID']]);

	// Update logs
	if(is_numeric($value)){
		update_file($filename, ($value+1));
	} else { // Meaning the file does not exist or has been messed with.
		rebuild_file($filename);
	}
} else {
	echo 'Sorry, there was an error.';
}

/* If you want to see how many people have downloaded a file, run something like:
# pull_file(LOG_URL.numberishere.'.log.txt');
/*

You are free to share, modify and use this code for commercial uses. Please give a link back (to http://www.fullondesign.co.uk/ ) if you can, but you don't have you.

I claim no liability for this code, you use it at your own risk.

*/

?>

You can run this by changing the URL that accesses the file. For example:
file.php?ID=0

Feel free to edit and share this code.

IE8 now a high priority update

I said earlier this week that IE8 will soon be a high priority update; well today I noticed that IE8 has now reach high priority update status.

Essentially this means that IE8 is now available over windows automatic update and should slowly (over the next few weeks) start replacing most IE6 and IE7 installs.