Widgetbox widgets

Date: 25th May 2009 at 1:49 am | Filed under: blog | Author: Sam Burdge

I have just created these two widgets for my plugins feed and Zap Gamez over at Widgetbox. This is the most basic type of widget called a Blidget. Widgets are cool, I will definitely make more!

Leave a Comment

Corporate Flash Animated Banner

Date: 23rd May 2009 at 12:13 pm | Filed under: flash, portfolio | Author: Sam Burdge | Tags: , , ,

Working with design agency Pollen London, I developed this simple, eyecatching flash banner for client Project Associates' website home page.

pollen-screen

The banner shows a constantly moving, rotating array of their team, each image linking to the specific person's profile on the site.

Check out their home page to see the banner in action:

www.projectassociatesltd.com

Leave a Comment

The Football Journalist - Blog Customisations

Date: 4th May 2009 at 1:00 pm | Filed under: portfolio | Author: Sam Burdge | Tags: , , ,

tfj-screen

The Football Journalist is a blog site aimed at people who want to become professional sports and football journalists. It features listings of sports journalism courses and jobs within the football industry.

I applied a few basic customisations to the theme, changing the background image and adding in the adsense blocks and job listings widgets. I also used a few of my favourite plugins to apply SEO to the site.

As the site is linked with FootballFanCast (one of the leading football blog and podcasting sites in the UK) I would highly recommend it for anyone who is working towards a carreer in football journalism.

Check it out: www.thefootballjournalist.com

Leave a Comment

Forcing a file to download using php headers

Date: 4th May 2009 at 11:57 am | Filed under: development, scripts | Author: Sam Burdge | Tags: , , ,

If you create a hyperlink to a media file that can be opened within the browser such as an mp3, mpg, jpg, pdf, etc. a single left click will open the file in the web browser instead of triggering a download. To download the file you need to right click (CTRL + click for mac) and choose 'Save File As...' from the dropdown.

If your intention is to create a link for the user to download the file rather than viewing it in their browser you can do so using a simple php script. Create a file called 'download.php' and copy in the following php:

<?php
$download_file = $_GET['file'];
$download_file_name = $_GET['name'];
$handle = fopen($download_file, "r");
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$download_file_name);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($download_file));
ob_clean();
flush();
readfile($download_file);
fclose($handle);
exit;
?>

You can then create your download links like so:

www.example.com/download.php?file=images/example.jpg&name=hello.jpg

The URL should include the path to the file to be downloaded, and the name you want to give the file. In the above example the file is 'images/example.jpg' but the name of the file downloaded by the user would be 'hello.jpg'

When using PHP headers it is important to note that the headers will only be executed if they are called before any text is output to the page. Any html, or php echo tags, before the headers will cause the headers to be ignored. A line break or space before the opening php tag will also prevent headers from working.

Leave a Comment