############################################################## 
## MOD Title: FAP Hotlink Prevention Image
## MOD Author: PaulW < paulw@corsa-b.co.uk > (Paul Wollaston) http://www.corsa-b.co.uk
## MOD Description: This mod allows you to use a pre-defined image which will display on
##		    other websites instead of a Red-X.  You must create the Image yourself,
##		    in which you can put any message you want.  That way, if hotlinking IS
##		    disabled from within your album, this 'replacement' image will be sent instead.
##		    Requires FAP 1.2.0 RC1 or Later
##
## MOD Version: 0.2
## 
## Installation Level: (Easy) 
## Installation Time: 5 Minutes 
## Files To Edit: 4
##      \album_pic.php,
##      \album_picm.php,
##      \album_pic_nuffed.php,
##      \album_thumbsnail.php,
##
## Included Files: 1
##	\album_mod\no_hotlink.jpg, 
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## 
############################################################## 
## MOD History: 
## 
##   2004-01-20 - Version 0.1 
##      - First Private Test version
##
##   2005-12-20 - Version 0.2
##	- MOD file created
##	- Solved problem of Image not always loading (was a Pathing error)
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ COPY ]------------------------------------------------
#
# Use BINARY mode for image files (*.jpg, *.gif) when transfering via FTP

copy album_mod/no_hotlink.jpg to album_mod/no_hotlink.jpg

#*/
#
#-----[ DIY INSTRUCTIONS ]------------------------------------
#
You may want to make your own no_hotlink.jpg Image, which will contain your own site address & other info.

# 
#-----[ OPEN ]------------------------------------------ 
#
# 
album_pic.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	if( $errored )
	{
		message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
	}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
//-- Hotlink Image Mod START
//	if( $errored )
//	{
//		message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
//	}
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
if( $errored )
{
	//We have Hotlink Prevention here...
	//Display the Hotlink Prevent Image & then die...
	header('Content-type: image/jpeg');
	header("Content-Disposition: filename=" . ereg_replace("[^A-Za-z0-9]", "_", $pic_title) . $pic_filetype);
	readfile($album_root_path . 'no_hotlink.jpg');
}
else
{
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
// +-------------------------------------------------------------+
// |  Powered by Photo Album 2.x.x (c) 2002-2003 Smartor         |
// |  with Volodymyr (CLowN) Skoryk's Service Pack 1  2003-2004 |
// +-------------------------------------------------------------+

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
}
//-- Hotlink Image Mod END

# 
#-----[ OPEN ]------------------------------------------ 
#
album_picm.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	if ($errored)
	{
		die($lang['Not_Authorised']);
	}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
//-- Hotlink Image Mod START
//	if ($errored)
//	{
//		die($lang['Not_Authorised']);
//	}
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
if( $errored )
{
	//We have Hotlink Prevention here...
	//Display the Hotlink Prevent Image & then die...
	header('Content-type: image/jpeg');
	header("Content-Disposition: filename=" . ereg_replace("[^A-Za-z0-9]", "_", $pic_title) . $pic_filetype);
	readfile($album_root_path . 'no_hotlink.jpg');
}
else
{
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
// +-------------------------------------------------------------+
// |  Powered by Photo Album 2.x.x (c) 2002-2003 Smartor         |
// |  with Volodymyr (CLowN) Skoryk's Service Pack 1  2003-2004 |
// +-------------------------------------------------------------+

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
}
//-- Hotlink Image Mod END

# 
#-----[ OPEN ]------------------------------------------ 
#
album_pic_nuffed.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	if( $errored )
	{
		message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
	}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
//-- Hotlink Image Mod START
//	if( $errored )
//	{
//		message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
//	}
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
$nuff_http = nuff_http_vars();

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
if( $errored )
{
	//We have Hotlink Prevention here...
	//Display the Hotlink Prevent Image & then die...
	header('Content-type: image/jpeg');
	header("Content-Disposition: filename=" . ereg_replace("[^A-Za-z0-9]", "_", $pic_title) . $pic_filetype);
	readfile($album_root_path . 'no_hotlink.jpg');
}
else
{
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
$Image->SendToBrowser($pic_title, $pic_filetype, '', '_nuffed', $nuff_http['nuff_recompress_r']);
$Image->Destroy(); //Destroy whole class including GD image in memory.

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
}
//-- Hotlink Image Mod END

# 
#-----[ OPEN ]------------------------------------------ 
#
# 
album_thumbnail.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	if ($errored)
	{
		message_die(GENERAL_ERROR, $lang['Not_Authorised']);
	}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
//-- Hotlink Image Mod START
//	if ($errored)
//	{
//		message_die(GENERAL_ERROR, $lang['Not_Authorised']);
//	}
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
if( $errored )
{
	//We have Hotlink Prevention here...
	//Display the Hotlink Prevent Image & then die...
	header('Content-type: image/jpeg');
	header("Content-Disposition: filename=" . ereg_replace("[^A-Za-z0-9]", "_", $pic_title) . $pic_filetype);
	readfile($album_root_path . 'no_hotlink.jpg');
}
else
{
//-- Hotlink Image Mod END

# 
#-----[ FIND ]------------------------------------------ 
#
// +------------------------------------------------------+
// |  Powered by Photo Album 2.x.x (c) 2002-2003 Smartor  |
// +------------------------------------------------------+

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- Hotlink Image Mod START
}
//-- Hotlink Image Mod END

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM