Location: PHPKode > projects > MJGUEST > mjguest/avatar.jpg.php
<?php

	/*
	+---------------------------------------------------------------
	|
	|	MJGUEST
	|	============================================================
	|	Copyright (c) 2002-2008 Giacomo "mdsjack" Menni
	|	Terms of agreement and support at www.mdsjack.bo.it
	|
	+---------------------------------------------------------------
	|	[ INTERFACE MODULE ]
	|	Avatar viewer
	+---------------------------------------------------------------
	*/
	
	define('mjguest_basedir', false);
	
	require ('mjguest.core.php');
	
	$mjguest = new guestbook(false);
	
	$mjguest->db_start();
	
	$mjguest->db->ask('get_avatar', null, $_GET['id']);
	
	$data = base64_decode($mjguest->db->get_field());
	
	ob_start();
	
	header('Accept-Ranges: bytes');
	header('Content-Length: '.strlen($data));
	header('Content-Type: image/jpeg');
	header('Content-Disposition: inline; filename="mjguest_avatar-'.$_GET['id'].'.jpg";');
	echo $data;
	
	ob_end_flush();
	
	unset($data, $mjguest);
	
	exit;

?>
Return current item: MJGUEST