diff -crbB attachmod238/admin/admin_attach_cp.php attachmod239/admin/admin_attach_cp.php
*** attachmod238/admin/admin_attach_cp.php	Thu Jun 19 19:20:17 2003
--- attachmod239/admin/admin_attach_cp.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *	copyright			: (C) 2002 Meik Sievertsen
   *	email				: acyd.burn@gmx.de
   *
!  *	$Id: admin_attach_cp.php,v 1.16 2003/03/07 17:48:23 acydburn Exp $
   *
   ***************************************************************************/
  
--- 6,12 ----
   *	copyright			: (C) 2002 Meik Sievertsen
   *	email				: acyd.burn@gmx.de
   *
!  *	$Id: admin_attach_cp.php,v 1.18 2003/08/30 15:47:39 acydburn Exp $
   *
   ***************************************************************************/
  
***************
*** 905,910 ****
--- 905,914 ----
  	);
  }
  
+ $template->assign_vars(array(
+ 	'ATTACH_VERSION' => sprintf($lang['Attachment_version'], $attach_config['attach_version']))
+ );
+ 
  $template->pparse('body');
  
  include('page_footer_admin.'.$phpEx);
diff -crbB attachmod238/admin/admin_attachments.php attachmod239/admin/admin_attachments.php
*** attachmod238/admin/admin_attachments.php	Thu Jun 19 19:20:17 2003
--- attachmod239/admin/admin_attachments.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: admin_attachments.php,v 1.46 2003/06/19 16:55:21 acydburn Exp $
   *
   ***************************************************************************/
  
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: admin_attachments.php,v 1.48 2003/08/30 15:47:39 acydburn Exp $
   *
   ***************************************************************************/
  
***************
*** 863,868 ****
--- 863,871 ----
  	$create_thumbnail_yes = ( $new_attach['img_create_thumbnail'] != '0' ) ? 'checked="checked"' : '';
  	$create_thumbnail_no = ( $new_attach['img_create_thumbnail'] == '0' ) ? 'checked="checked"' : '';
  
+ 	$use_gd2_yes = ( $new_attach['use_gd2'] != '0' ) ? 'checked="checked"' : '';
+ 	$use_gd2_no = ( $new_attach['use_gd2'] == '0' ) ? 'checked="checked"' : '';
+ 
  	//
  	// Check Thumbnail Support
  	//
***************
*** 902,907 ****
--- 905,912 ----
  		'L_NO' => $lang['No'],
  		'L_SUBMIT' => $lang['Submit'],
  		'L_RESET' => $lang['Reset'],
+ 		'L_USE_GD2' => $lang['Use_gd2'],
+ 		'L_USE_GD2_EXPLAIN' => $lang['Use_gd2_explain'],
  
  		'IMAGE_MAX_HEIGHT' => $new_attach['img_max_height'],
  		'IMAGE_MAX_WIDTH' => $new_attach['img_max_width'],
***************
*** 917,922 ****
--- 922,930 ----
  		'CREATE_THUMBNAIL_YES' => $create_thumbnail_yes,
  		'CREATE_THUMBNAIL_NO' => $create_thumbnail_no,
  
+ 		'USE_GD2_YES' => $use_gd2_yes,
+ 		'USE_GD2_NO' => $use_gd2_no,
+ 
  		'S_ASSIGNED_GROUP_IMAGES' => implode(', ', $s_assigned_group_images),
  		'S_ATTACH_ACTION' => append_sid('admin_attachments.' . $phpEx . '?mode=cats'))
  	);
***************
*** 1521,1526 ****
--- 1529,1538 ----
  	$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
  }
  
+ $template->assign_vars(array(
+ 	'ATTACH_VERSION' => sprintf($lang['Attachment_version'], $attach_config['attach_version']))
+ );
+ 
  $template->pparse('body');
  
  include('page_footer_admin.'.$phpEx);
diff -crbB attachmod238/admin/admin_extensions.php attachmod239/admin/admin_extensions.php
*** attachmod238/admin/admin_extensions.php	Thu Jun 19 19:20:17 2003
--- attachmod239/admin/admin_extensions.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: admin_extensions.php,v 1.21 2003/03/07 17:48:23 acydburn Exp $
   *
   ***************************************************************************/
  
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: admin_extensions.php,v 1.24 2003/08/30 15:47:39 acydburn Exp $
   *
   ***************************************************************************/
  
***************
*** 1016,1022 ****
  
  	$sql = "SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE auth_attachments < " . AUTH_ADMIN;
  
! 	if ( !($f_result = attach_sql_query($sql)) ) 
  	{ 
  		message_die(GENERAL_ERROR, 'Could not get Forums.', '', __LINE__, __FILE__, $sql); 
  	} 
--- 1016,1022 ----
  
  	$sql = "SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE auth_attachments < " . AUTH_ADMIN;
  
! 	if ( !($f_result = $db->sql_query($sql)) ) 
  	{ 
  		message_die(GENERAL_ERROR, 'Could not get Forums.', '', __LINE__, __FILE__, $sql); 
  	} 
***************
*** 1030,1036 ****
  		WHERE allow_group = 1 
  		ORDER BY group_name ASC";
  
! 		if ( !($result = attach_sql_query($sql)) ) 
  		{ 
  			message_die(GENERAL_ERROR, 'Could not query Extension Groups.', '', __LINE__, __FILE__, $sql); 
  		} 
--- 1030,1036 ----
  		WHERE allow_group = 1 
  		ORDER BY group_name ASC";
  
! 		if ( !($result = $db->sql_query($sql)) ) 
  		{ 
  			message_die(GENERAL_ERROR, 'Could not query Extension Groups.', '', __LINE__, __FILE__, $sql); 
  		} 
***************
*** 1091,1096 ****
--- 1091,1100 ----
  	$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
  }
  
+ $template->assign_vars(array(
+ 	'ATTACH_VERSION' => sprintf($lang['Attachment_version'], $attach_config['attach_version']))
+ );
+ 
  $template->pparse('body');
  
  include('page_footer_admin.'.$phpEx);
Only in attachmod238/attach_mod: attach_rules.php
diff -crbB attachmod238/attach_mod/attachment_mod.php attachmod239/attach_mod/attachment_mod.php
*** attachmod238/attach_mod/attachment_mod.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/attachment_mod.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: attachment_mod.php,v 1.18 2003/02/23 20:38:36 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: attachment_mod.php,v 1.19 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 75,81 ****
  	$sql = 'SELECT *
  	FROM ' . ATTACH_CONFIG_TABLE;
  	 
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query attachment information', '', __LINE__, __FILE__, $sql);
  	}
--- 75,81 ----
  	$sql = 'SELECT *
  	FROM ' . ATTACH_CONFIG_TABLE;
  	 
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query attachment information', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 97,103 ****
  $cache_file = $cache_dir . '/attach_config.php';
  $attach_config = array();
  
! if ((file_exists($cache_dir)) && (is_dir($cache_dir)))
  {
  	if (file_exists($cache_file))
  	{
--- 97,103 ----
  $cache_file = $cache_dir . '/attach_config.php';
  $attach_config = array();
  
! if (file_exists($cache_dir) && is_dir($cache_dir) && is_writable($cache_dir))
  {
  	if (file_exists($cache_file))
  	{
diff -crbB attachmod238/attach_mod/displaying.php attachmod239/attach_mod/displaying.php
*** attachmod238/attach_mod/displaying.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/displaying.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: displaying.php,v 1.44 2003/03/06 23:30:52 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: displaying.php,v 1.46 2003/08/30 15:17:35 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 441,447 ****
  			}
  
  			$display_name = $attachment_filename_list[$i];
! 			$comment = stripslashes(trim(nl2br($attachment_comment_list[$i])));
  			
  			$extension = strtolower(trim($attachment_extension_list[$i]));
  
--- 441,447 ----
  			}
  
  			$display_name = $attachment_filename_list[$i];
! 			$comment = htmlspecialchars(stripslashes(trim(nl2br($attachment_comment_list[$i]))));
  			
  			$extension = strtolower(trim($attachment_extension_list[$i]));
  
***************
*** 676,682 ****
  		}
  
  		$display_name = $attachments['_' . $post_id][$i]['real_filename']; 
! 		$comment = stripslashes(trim(nl2br($attachments['_' . $post_id][$i]['comment'])));
  
  		$attachments['_' . $post_id][$i]['extension'] = strtolower(trim($attachments['_' . $post_id][$i]['extension']));
  
--- 676,682 ----
  		}
  
  		$display_name = $attachments['_' . $post_id][$i]['real_filename']; 
! 		$comment = htmlspecialchars(stripslashes(trim(nl2br($attachments['_' . $post_id][$i]['comment']))));
  
  		$attachments['_' . $post_id][$i]['extension'] = strtolower(trim($attachments['_' . $post_id][$i]['extension']));
  
***************
*** 800,806 ****
  					SET download_count = download_count + 1 
  					WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 					if ( !(attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count.', '', __LINE__, __FILE__, $sql);
  					}
--- 800,806 ----
  					SET download_count = download_count + 1 
  					WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 					if ( !($db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count.', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 863,869 ****
  				SET download_count = download_count + 1 
  				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  				}
--- 863,869 ----
  				SET download_count = download_count + 1 
  				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 897,903 ****
  				SET download_count = download_count + 1 
  				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  				}
--- 897,903 ----
  				SET download_count = download_count + 1 
  				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
  	
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  				}
diff -crbB attachmod238/attach_mod/includes/constants.php attachmod239/attach_mod/includes/constants.php
*** attachmod238/attach_mod/includes/constants.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/constants.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: constants.php,v 1.23 2003/06/18 19:48:45 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: constants.php,v 1.24 2003/08/30 15:47:39 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 72,77 ****
  define('QUOTA_UPLOAD_LIMIT', 1);
  define('QUOTA_PM_LIMIT', 2);
  
! define('ATTACH_VERSION', '2.3.8');
  
  ?>
\ No newline at end of file
--- 72,77 ----
  define('QUOTA_UPLOAD_LIMIT', 1);
  define('QUOTA_PM_LIMIT', 2);
  
! define('ATTACH_VERSION', '2.3.9');
  
  ?>
\ No newline at end of file
diff -crbB attachmod238/attach_mod/includes/functions_admin.php attachmod239/attach_mod/includes/functions_admin.php
*** attachmod238/attach_mod/includes/functions_admin.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_admin.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_admin.php,v 1.13 2003/01/28 16:32:31 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_admin.php,v 1.14 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 43,49 ****
  			// Check if user is already entered
  			$sql = "SELECT user_id FROM " . QUOTA_TABLE . " WHERE user_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  			}
--- 43,49 ----
  			// Check if user is already entered
  			$sql = "SELECT user_id FROM " . QUOTA_TABLE . " WHERE user_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 59,65 ****
  			}
  		}
  	
! 		if( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql);
  		}
--- 59,65 ----
  			}
  		}
  	
! 		if( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 71,77 ****
  		{
  			$sql = "DELETE FROM " . QUOTA_TABLE . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Unable to delete quota Settings', '', __LINE__, __FILE__, $sql);
  			}
--- 71,77 ----
  		{
  			$sql = "DELETE FROM " . QUOTA_TABLE . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Unable to delete quota Settings', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 81,87 ****
  			// Check if user is already entered
  			$sql = "SELECT group_id FROM " . QUOTA_TABLE . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  			}
--- 81,87 ----
  			// Check if user is already entered
  			$sql = "SELECT group_id FROM " . QUOTA_TABLE . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  
! 			if( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 96,102 ****
  				$sql = "UPDATE " . QUOTA_TABLE . " SET quota_limit_id = " . $quota_limit_id . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  			}
  	
! 			if( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql);
  			}
--- 96,102 ----
  				$sql = "UPDATE " . QUOTA_TABLE . " SET quota_limit_id = " . $quota_limit_id . " WHERE group_id = " . $id . " AND quota_type = " . $quota_type;
  			}
  	
! 			if( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 175,181 ****
  	FROM " . ATTACHMENTS_TABLE . "
  	WHERE attach_id = " . $attach_id;
  
! 	if( !attach_sql_query($sql) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  	}
--- 175,181 ----
  	FROM " . ATTACHMENTS_TABLE . "
  	WHERE attach_id = " . $attach_id;
  
! 	if( !$db->sql_query($sql) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 200,206 ****
  			WHERE privmsgs_id = ' . intval($ids[$i]['privmsgs_id']);
  		}
  
! 		if( !attach_sql_query($sql) )
  		{
  			message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  		}
--- 200,206 ----
  			WHERE privmsgs_id = ' . intval($ids[$i]['privmsgs_id']);
  		}
  
! 		if( !$db->sql_query($sql) )
  		{
  			message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 405,411 ****
  		FROM ' . USERS_TABLE . '
  		WHERE username LIKE \'' . $search_author . '\'';
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t obtain list of matching users (searching for: ' . $search_author . ')', '', __LINE__, __FILE__, $sql);
  		}
--- 405,411 ----
  		FROM ' . USERS_TABLE . '
  		WHERE username LIKE \'' . $search_author . '\'';
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t obtain list of matching users (searching for: ' . $search_author . ')', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 494,500 ****
  
  	$sql .= $order_by; 
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  	}
--- 494,500 ----
  
  	$sql .= $order_by; 
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 507,513 ****
  		message_die(GENERAL_MESSAGE, $lang['No_attach_search_match']);
  	}
  
! 	if ( !($result = attach_sql_query($total_rows_sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query attachments', '', __LINE__, __FILE__, $sql);
  	}
--- 507,513 ----
  		message_die(GENERAL_MESSAGE, $lang['No_attach_search_match']);
  	}
  
! 	if ( !($result = $db->sql_query($total_rows_sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query attachments', '', __LINE__, __FILE__, $sql);
  	}
diff -crbB attachmod238/attach_mod/includes/functions_attach.php attachmod239/attach_mod/includes/functions_attach.php
*** attachmod238/attach_mod/includes/functions_attach.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_attach.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_attach.php,v 1.33 2003/02/01 03:09:46 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_attach.php,v 1.34 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 456,462 ****
  	$sql = "SELECT attach_id FROM " . ATTACHMENTS_DESC_TABLE . "
  	WHERE physical_filename = '" . $filename . "' LIMIT 1";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get attachment information for filename: ' . $filename, '', __LINE__, __FILE__, $sql);
  	}
--- 456,462 ----
  	$sql = "SELECT attach_id FROM " . ATTACHMENTS_DESC_TABLE . "
  	WHERE physical_filename = '" . $filename . "' LIMIT 1";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get attachment information for filename: ' . $filename, '', __LINE__, __FILE__, $sql);
  	}
***************
*** 484,490 ****
  	FROM ' . ATTACHMENTS_TABLE . '
  	WHERE ' . $sql_id . ' = ' . $post_id . ' LIMIT 1';
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get attachment informations for specific posts', '', __LINE__, __FILE__, $sql);
  	}
--- 484,490 ----
  	FROM ' . ATTACHMENTS_TABLE . '
  	WHERE ' . $sql_id . ' = ' . $post_id . ' LIMIT 1';
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get attachment informations for specific posts', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 536,542 ****
  	WHERE ( a.post_id IN (" . $post_id_array . ")) AND (a.attach_id = d.attach_id)
  	ORDER BY d.filetime " . $display_order;
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Attachment Informations for post number ' . $post_id_array, '', __LINE__, __FILE__, $sql);
  	}
--- 536,542 ----
  	WHERE ( a.post_id IN (" . $post_id_array . ")) AND (a.attach_id = d.attach_id)
  	ORDER BY d.filetime " . $display_order;
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Attachment Informations for post number ' . $post_id_array, '', __LINE__, __FILE__, $sql);
  	}
***************
*** 587,593 ****
  	WHERE ( a.privmsgs_id IN (" . $privmsgs_id_array . ")) AND (a.attach_id = d.attach_id)
  	ORDER BY d.filetime " . $display_order;
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Attachment Informations for private message number ' . $privmsgs_id_array, '', __LINE__, __FILE__, $sql);
  	}
--- 587,593 ----
  	WHERE ( a.privmsgs_id IN (" . $privmsgs_id_array . ")) AND (a.attach_id = d.attach_id)
  	ORDER BY d.filetime " . $display_order;
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get Attachment Informations for private message number ' . $privmsgs_id_array, '', __LINE__, __FILE__, $sql);
  	}
***************
*** 613,619 ****
  	FROM " . ATTACHMENTS_DESC_TABLE . "
  	WHERE attach_id IN (" . $attach_ids . ")";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Total Filesize', '', __LINE__, __FILE__, $sql);
  	}
--- 613,619 ----
  	FROM " . ATTACHMENTS_DESC_TABLE . "
  	WHERE attach_id IN (" . $attach_ids . ")";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Total Filesize', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 653,659 ****
  	FROM " . ATTACHMENTS_TABLE . " a, " . PRIVMSGS_TABLE . " p
  	WHERE " . $user_sql . " AND (a.privmsgs_id != 0) AND (a.privmsgs_id = p.privmsgs_id) AND (p.privmsgs_type != " . PRIVMSGS_SENT_MAIL . ")";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Attachment Informations', '', __LINE__, __FILE__, $sql);
  	}
--- 653,659 ----
  	FROM " . ATTACHMENTS_TABLE . " a, " . PRIVMSGS_TABLE . " p
  	WHERE " . $user_sql . " AND (a.privmsgs_id != 0) AND (a.privmsgs_id = p.privmsgs_id) AND (p.privmsgs_type != " . PRIVMSGS_SENT_MAIL . ")";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Attachment Informations', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 704,710 ****
  	FROM " . EXTENSIONS_TABLE . " e, " . EXTENSION_GROUPS_TABLE . " g
  	WHERE (e.group_id = g.group_id) AND (g.allow_group = 1)";
  	
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Allowed Extensions.', '', __LINE__, __FILE__, $sql);
  	}
--- 704,710 ----
  	FROM " . EXTENSIONS_TABLE . " e, " . EXTENSION_GROUPS_TABLE . " g
  	WHERE (e.group_id = g.group_id) AND (g.allow_group = 1)";
  	
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not query Allowed Extensions.', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 724,730 ****
  	$sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE topic_id = " . $topic_id . "
  	GROUP BY post_id";
  		
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t select Post ID\'s', '', __LINE__, __FILE__, $sql);
  	}
--- 724,730 ----
  	$sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE topic_id = " . $topic_id . "
  	GROUP BY post_id";
  		
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t select Post ID\'s', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 753,759 ****
  	
  	$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE post_id IN (" . $post_id_sql . ") LIMIT 1";
  		
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t select Attachment ID\'s', '', __LINE__, __FILE__, $sql);
  	}
--- 753,759 ----
  	
  	$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE post_id IN (" . $post_id_sql . ") LIMIT 1";
  		
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t select Attachment ID\'s', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 762,768 ****
  
  	$sql = "UPDATE " . TOPICS_TABLE . " SET topic_attachment = " . $set_id . " WHERE topic_id = " . $topic_id;
  
! 	if ( !(attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t update Topics Table', '', __LINE__, __FILE__, $sql);
  	}
--- 762,768 ----
  
  	$sql = "UPDATE " . TOPICS_TABLE . " SET topic_attachment = " . $set_id . " WHERE topic_id = " . $topic_id;
  
! 	if ( !($db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t update Topics Table', '', __LINE__, __FILE__, $sql);
  	}
***************
*** 771,777 ****
  	{
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE post_id = " . $post_ids[$i] . " LIMIT 1";
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t select Attachment ID\'s', '', __LINE__, __FILE__, $sql);
  		}
--- 771,777 ----
  	{
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE post_id = " . $post_ids[$i] . " LIMIT 1";
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t select Attachment ID\'s', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 780,786 ****
  		
  		$sql = "UPDATE " . POSTS_TABLE . " SET post_attachment = " . $set_id . " WHERE post_id = " . $post_ids[$i];
  
! 		if ( !(attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t update Posts Table', '', __LINE__, __FILE__, $sql);
  		}
--- 780,786 ----
  		
  		$sql = "UPDATE " . POSTS_TABLE . " SET post_attachment = " . $set_id . " WHERE post_id = " . $post_ids[$i];
  
! 		if ( !($db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t update Posts Table', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 829,835 ****
  	WHERE (g.group_single_user = 0) AND (u.group_id = g.group_id) AND (u.user_id = " . $user_id . ") AND (g.group_id = " . $group_id . ")
  	LIMIT 1";
  			
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get User Group', '', __LINE__, __FILE__, $sql);
  	}
--- 829,835 ----
  	WHERE (g.group_single_user = 0) AND (u.group_id = g.group_id) AND (u.user_id = " . $user_id . ") AND (g.group_id = " . $group_id . ")
  	LIMIT 1";
  			
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Could not get User Group', '', __LINE__, __FILE__, $sql);
  	}
diff -crbB attachmod238/attach_mod/includes/functions_delete.php attachmod239/attach_mod/includes/functions_delete.php
*** attachmod238/attach_mod/includes/functions_delete.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_delete.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_delete.php,v 1.10 2003/02/23 13:15:29 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_delete.php,v 1.11 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 75,81 ****
  		$sql = "SELECT " . $p_id . " FROM " . ATTACHMENTS_TABLE . " WHERE attach_id IN (" . implode(', ', $attach_id_array) . ")
  		GROUP BY " . $p_id;
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select ids', '', __LINE__, __FILE__, $sql);
  		}
--- 75,81 ----
  		$sql = "SELECT " . $p_id . " FROM " . ATTACHMENTS_TABLE . " WHERE attach_id IN (" . implode(', ', $attach_id_array) . ")
  		GROUP BY " . $p_id;
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select ids', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 142,148 ****
  			
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " " . $whereclause . " GROUP BY attach_id";
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql);
  		}
--- 142,148 ----
  			
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " " . $whereclause . " GROUP BY attach_id";
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 198,204 ****
  				FROM " . PRIVMSGS_TABLE . "
  				WHERE privmsgs_id = " . $post_id_array[$i];
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t get Privmsgs Type', '', __LINE__, __FILE__, $sql);
  				}
--- 198,204 ----
  				FROM " . PRIVMSGS_TABLE . "
  				WHERE privmsgs_id = " . $post_id_array[$i];
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t get Privmsgs Type', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 249,255 ****
  
  	$sql = "DELETE FROM " . ATTACHMENTS_TABLE . " WHERE attach_id IN (" . implode(', ', $attach_id_array) . ") AND " . $sql_id . " IN (" . implode(', ', $post_id_array) . ")";
  
! 	if ( !(attach_sql_query($sql)) )   
  	{
  		message_die(GENERAL_ERROR, $lang['Error_deleted_attachments'], '', __LINE__, __FILE__, $sql);   
  	} 
--- 249,255 ----
  
  	$sql = "DELETE FROM " . ATTACHMENTS_TABLE . " WHERE attach_id IN (" . implode(', ', $attach_id_array) . ") AND " . $sql_id . " IN (" . implode(', ', $post_id_array) . ")";
  
! 	if ( !($db->sql_query($sql)) )   
  	{
  		message_die(GENERAL_ERROR, $lang['Error_deleted_attachments'], '', __LINE__, __FILE__, $sql);   
  	} 
***************
*** 258,264 ****
  	{
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = " . $attach_id_array[$i];
  			
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql);
  		}
--- 258,264 ----
  	{
  		$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = " . $attach_id_array[$i];
  			
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 269,275 ****
  			FROM ' . ATTACHMENTS_DESC_TABLE . '
  			WHERE attach_id = ' . $attach_id_array[$i];
  	
! 			if ( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query attach description table', '', __LINE__, __FILE__, $sql);
  			}
--- 269,275 ----
  			FROM ' . ATTACHMENTS_DESC_TABLE . '
  			WHERE attach_id = ' . $attach_id_array[$i];
  	
! 			if ( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query attach description table', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 293,299 ****
  					$sql = 'DELETE FROM ' . ATTACHMENTS_DESC_TABLE . '
  					WHERE attach_id = ' . $attachments[$j]['attach_id'];
  
! 					if ( !(attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, $lang['Error_deleted_attachments'], '', __LINE__, __FILE__, $sql);
  					}
--- 293,299 ----
  					$sql = 'DELETE FROM ' . ATTACHMENTS_DESC_TABLE . '
  					WHERE attach_id = ' . $attachments[$j]['attach_id'];
  
! 					if ( !($db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, $lang['Error_deleted_attachments'], '', __LINE__, __FILE__, $sql);
  					}
***************
*** 312,318 ****
  		{
  			$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE privmsgs_id = " . $post_id_array[$i];
  
! 			if ( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query Attachments Table', '', __LINE__, __FILE__, $sql);
  			}
--- 312,318 ----
  		{
  			$sql = "SELECT attach_id FROM " . ATTACHMENTS_TABLE . " WHERE privmsgs_id = " . $post_id_array[$i];
  
! 			if ( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query Attachments Table', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 321,327 ****
  			{
  				$sql = "UPDATE " . PRIVMSGS_TABLE . " SET privmsgs_attachment = 0 WHERE privmsgs_id = " . $post_id_array[$i];
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update Private Message Attachment Switch', '', __LINE__, __FILE__, $sql);
  				}
--- 321,327 ----
  			{
  				$sql = "UPDATE " . PRIVMSGS_TABLE . " SET privmsgs_attachment = 0 WHERE privmsgs_id = " . $post_id_array[$i];
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t update Private Message Attachment Switch', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 332,338 ****
  	{
  		$sql = "SELECT topic_id FROM " . POSTS_TABLE . " WHERE post_id IN (" . implode(', ', $post_id_array) . ") GROUP BY topic_id";
  		
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t select Topic ID', '', __LINE__, __FILE__, $sql);
  		}
--- 332,338 ----
  	{
  		$sql = "SELECT topic_id FROM " . POSTS_TABLE . " WHERE post_id IN (" . implode(', ', $post_id_array) . ") GROUP BY topic_id";
  		
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t select Topic ID', '', __LINE__, __FILE__, $sql);
  		}
diff -crbB attachmod238/attach_mod/includes/functions_includes.php attachmod239/attach_mod/includes/functions_includes.php
*** attachmod238/attach_mod/includes/functions_includes.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_includes.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_includes.php,v 1.30 2003/06/19 16:39:41 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_includes.php,v 1.32 2003/08/30 15:17:35 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 26,104 ****
  //
  
  //
- // This function is used to count the queries executed by the Attachment Mod
- //
- function attach_sql_query($query)
- {
- 	global $db, $dbms, $attach_num_queries;
- 
- 	$attach_num_queries++;
- 	
- 	if ( defined('ATTACH_QUERY_DEBUG') )
- 	{
- 		global $attach_sql_report, $attach_sql_time, $starttime;
- 		$curtime = explode(' ', microtime());
- 		$curtime = $curtime[0] + $curtime[1] - $starttime;
- 	}
- 
- 	$attach_result = $db->sql_query($query);
- 
- 	if ( defined('ATTACH_QUERY_DEBUG') )
- 	{
- 		$endtime = explode(' ', microtime());
- 		$endtime = $endtime[0] + $endtime[1] - $starttime;
- 
- 		$attach_sql_report .= "<pre>Query:\t" . preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n\t", $query) . "\n\n";
- 		$affected_rows = $db->sql_affectedrows($result);
- 		if ($attach_result)
- 		{
- 			$attach_sql_report .= "Time before:  $curtime\nTime after:   $endtime\nElapsed time: <b>" . ($endtime - $curtime) . "</b>\n</pre>";
- 		}
- 		else
- 		{
- 			$error = $db->sql_error();
- 			$attach_sql_report .= '<b>FAILED</b> - MySQL Error ' . $error['code'] . ': ' . $error['message'] . '<br><br><pre>';
- 		}
- 		$attach_sql_time += $endtime - $curtime;
- 
- 		if (($dbms == 'mysql') || ($dbms == 'mysql4'))
- 		{
- 			if (preg_match('/^SELECT/', $query))
- 			{
- 				$html_table = FALSE;
- 				if ($result = mysql_query("EXPLAIN $query", $db->db_connect_id))
- 				{
- 					$i = 0;
- 					while ($row = mysql_fetch_assoc($result))
- 					{
- 						$extra = array_pop($row);
- 						if (!$html_table && count($row))
- 						{
- 							$html_table = TRUE;
- 							$attach_sql_report .= "<table width=100% border=1 cellpadding=2 cellspacing=1>\n";
- 							$attach_sql_report .= "<tr>\n<td><b>" . implode("</b></td>\n<td><b>", array_keys($row));
- 							$attach_sql_report .= "</b></td>\n<td><b>affected_rows";
- 							$attach_sql_report .= "</b></td>\n<td><b>Extra"	. "</b></td>\n</tr>\n";
- 						}
- 						$attach_sql_report .= "<tr>\n<td>" . implode("&nbsp;</td>\n<td>", array_values($row));
- 						$attach_sql_report .= "&nbsp;</td>\n<td>" . ( ($i == 0) ? $affected_rows : '' );
- 						$attach_sql_report .= "&nbsp;</td>\n<td>" . $extra . "&nbsp;</td>\n</tr>\n";
- 						$i++;
- 					}
- 				}
- 				if ($html_table)
- 				{
- 					$attach_sql_report .= '</table><br>';
- 				}
- 			}
- 			$attach_sql_report .= "<hr>\n";
- 		}
- 	}
- 
- 	return ($attach_result);
- }
- 
- //
  // Include the FAQ-File (faq.php)
  //
  function attach_faq_include($lang_file)
--- 26,31 ----
***************
*** 230,236 ****
  	}
  
  	// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
! //	$rules_link = '(<a href="attach_mod/attach_rules.' . $phpEx . '?f=' . $forum_id . '" target="_blank">Rules</a>)';
  //	$s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $rules_link . ' ' . $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />';
  	$s_auth_can .= ( ( $is_auth['auth_attachments'] && $is_auth['auth_post'] ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />';
  
--- 157,163 ----
  	}
  
  	// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
! //	$rules_link = '(<a href=$phpbb_root_path . "attach_rules.' . $phpEx . '?f=' . $forum_id . '" target="_blank">Rules</a>)';
  //	$s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $rules_link . ' ' . $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />';
  	$s_auth_can .= ( ( $is_auth['auth_attachments'] && $is_auth['auth_post'] ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />';
  
***************
*** 308,314 ****
  		// Show the contents
  		$sql = "SELECT quota_limit_id, quota_type FROM " . QUOTA_TABLE . " WHERE user_id = " . $user_id;
  
! 		if( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql);
  		}
--- 235,241 ----
  		// Show the contents
  		$sql = "SELECT quota_limit_id, quota_type FROM " . QUOTA_TABLE . " WHERE user_id = " . $user_id;
  
! 		if( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 389,395 ****
  		// Show the contents
  		$sql = "SELECT quota_limit_id, quota_type FROM " . QUOTA_TABLE . " WHERE group_id = " . $group_id;
  
! 		if( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql);
  		}
--- 316,322 ----
  		// Show the contents
  		$sql = "SELECT quota_limit_id, quota_type FROM " . QUOTA_TABLE . " WHERE group_id = " . $group_id;
  
! 		if( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 482,488 ****
  		WHERE (q.group_id = " . $group_id . ") AND (q.quota_type = " . QUOTA_UPLOAD_LIMIT . ") 
  		AND (q.quota_limit_id = l.quota_limit_id) LIMIT 1";
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not get Group Quota', '', __LINE__, __FILE__, $sql);
  		}
--- 409,415 ----
  		WHERE (q.group_id = " . $group_id . ") AND (q.quota_type = " . QUOTA_UPLOAD_LIMIT . ") 
  		AND (q.quota_limit_id = l.quota_limit_id) LIMIT 1";
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not get Group Quota', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 506,512 ****
  				$sql = "SELECT quota_limit FROM " . QUOTA_LIMITS_TABLE . "
  				WHERE quota_limit_id = " . $quota_id . " LIMIT 1";
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get Quota Limit', '', __LINE__, __FILE__, $sql);
  				}
--- 433,439 ----
  				$sql = "SELECT quota_limit FROM " . QUOTA_LIMITS_TABLE . "
  				WHERE quota_limit_id = " . $quota_id . " LIMIT 1";
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get Quota Limit', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 574,580 ****
  	WHERE (user_id_1 = " . $user_id . ") AND (privmsgs_id = 0)
  	GROUP BY attach_id";
  		
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  	}
--- 501,507 ----
  	WHERE (user_id_1 = " . $user_id . ") AND (privmsgs_id = 0)
  	GROUP BY attach_id";
  		
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  	}
diff -crbB attachmod238/attach_mod/includes/functions_selects.php attachmod239/attach_mod/includes/functions_selects.php
*** attachmod238/attach_mod/includes/functions_selects.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_selects.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_selects.php,v 1.9 2002/12/12 19:47:29 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_selects.php,v 1.10 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 33,39 ****
  	FROM " . EXTENSION_GROUPS_TABLE . "
  	ORDER BY group_name";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Extension Groups Table", "", __LINE__, __FILE__, $sql);
  	}
--- 33,39 ----
  	FROM " . EXTENSION_GROUPS_TABLE . "
  	ORDER BY group_name";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Extension Groups Table", "", __LINE__, __FILE__, $sql);
  	}
***************
*** 75,81 ****
  		FROM " . EXTENSION_GROUPS_TABLE . "
  		WHERE group_id = " . $group_id;
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, "Couldn't query Extension Groups Table", "", __LINE__, __FILE__, $sql);
  		}
--- 75,81 ----
  		FROM " . EXTENSION_GROUPS_TABLE . "
  		WHERE group_id = " . $group_id;
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, "Couldn't query Extension Groups Table", "", __LINE__, __FILE__, $sql);
  		}
***************
*** 118,124 ****
  	$sql = "SELECT group_id, cat_id
  	FROM " . EXTENSION_GROUPS_TABLE;
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't select Category", "", __LINE__, __FILE__, $sql);
  	}
--- 118,124 ----
  	$sql = "SELECT group_id, cat_id
  	FROM " . EXTENSION_GROUPS_TABLE;
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't select Category", "", __LINE__, __FILE__, $sql);
  	}
***************
*** 197,203 ****
  	FROM " . QUOTA_LIMITS_TABLE . "
  	ORDER BY quota_limit ASC";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Quota Limits Table", "", __LINE__, __FILE__, $sql);
  	}
--- 197,203 ----
  	FROM " . QUOTA_LIMITS_TABLE . "
  	ORDER BY quota_limit ASC";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Quota Limits Table", "", __LINE__, __FILE__, $sql);
  	}
***************
*** 233,239 ****
  	FROM " . QUOTA_LIMITS_TABLE . "
  	ORDER BY quota_limit ASC";
  
! 	if ( !($result = attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Quota Limits Table", "", __LINE__, __FILE__, $sql);
  	}
--- 233,239 ----
  	FROM " . QUOTA_LIMITS_TABLE . "
  	ORDER BY quota_limit ASC";
  
! 	if ( !($result = $db->sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, "Couldn't query Quota Limits Table", "", __LINE__, __FILE__, $sql);
  	}
diff -crbB attachmod238/attach_mod/includes/functions_thumbs.php attachmod239/attach_mod/includes/functions_thumbs.php
*** attachmod238/attach_mod/includes/functions_thumbs.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/includes/functions_thumbs.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_thumbs.php,v 1.23 2003/06/18 17:53:01 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: functions_thumbs.php,v 1.25 2003/08/30 15:47:39 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 39,46 ****
  {
  
  	// Change these two values to define the Thumbnail Size
! 	$max_width = 300;	
! 	$max_height = 85;
  	
  	if ($width > $max_width)
  	{
--- 39,46 ----
  {
  
  	// Change these two values to define the Thumbnail Size
! 	$max_width = 400;
! 	$max_height = 200;
  	
  	if ($width > $max_width)
  	{
***************
*** 70,81 ****
  		$tag_height = $height;
  	}
  
- 	$tag_width = round($tag_width);
- 	$tag_height = round($tag_height);
-         
  	return array(
! 		$tag_width,
! 		$tag_height
  	);
  }
  
--- 70,78 ----
  		$tag_height = $height;
  	}
  
  	return array(
! 		round($tag_width),
! 		round($tag_height)
  	);
  }
  
***************
*** 176,182 ****
  	{
  		if (is_array($size) && count($size) > 0) 
  		{
! 			@exec($imagick . ' -quality 75 -antialias -sample ' . $new_size[0] . 'x' . $new_size[1] . ' ' . $source . ' +profile "*" ' . $new_file);
  			if (@file_exists(@amod_realpath($new_file)))
  			{
  				$used_imagick = TRUE;
--- 173,179 ----
  	{
  		if (is_array($size) && count($size) > 0) 
  		{
! 			passthru($imagick . ' -quality 85 -antialias -sample ' . $new_size[0] . 'x' . $new_size[1] . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $new_file) . '"');
  			if (@file_exists(@amod_realpath($new_file)))
  			{
  				$used_imagick = TRUE;
***************
*** 202,214 ****
  					break;
  				case '2' :
  					$im = imagecreatefromjpeg($source);
! 					$new_im = imagecreate($new_size[0], $new_size[1]);
  					imagecopyresized($new_im, $im, 0, 0, 0, 0, $new_size[0], $new_size[1], $size[0], $size[1]);
  					imagejpeg($new_im, $new_file, 90);
  					break;
  				case '3' :
  					$im = imagecreatefrompng($source);
! 					$new_im = imagecreate($new_size[0], $new_size[1]);
  					imagecopyresized($new_im, $im, 0, 0, 0, 0, $new_size[0], $new_size[1], $size[0], $size[1]);
  					imagepng($new_im, $new_file);
  					break;
--- 198,210 ----
  					break;
  				case '2' :
  					$im = imagecreatefromjpeg($source);
! 					$new_im = (intval($attach_config['use_gd2'])) ? @imagecreatetruecolor($new_size[0], $new_size[1]) : imagecreate($new_size[0], $new_size[1]);
  					imagecopyresized($new_im, $im, 0, 0, 0, 0, $new_size[0], $new_size[1], $size[0], $size[1]);
  					imagejpeg($new_im, $new_file, 90);
  					break;
  				case '3' :
  					$im = imagecreatefrompng($source);
! 					$new_im = (intval($attach_config['use_gd2'])) ? @imagecreatetruecolor($new_size[0], $new_size[1]) : imagecreate($new_size[0], $new_size[1]);
  					imagecopyresized($new_im, $im, 0, 0, 0, 0, $new_size[0], $new_size[1], $size[0], $size[1]);
  					imagepng($new_im, $new_file);
  					break;
***************
*** 231,237 ****
  	}
  	else
  	{
! 		@chmod($new_file, 0666);
  	}
  	
  	return (TRUE);
--- 227,233 ----
  	}
  	else
  	{
! 		@chmod($new_file, 0664);
  	}
  	
  	return (TRUE);
diff -crbB attachmod238/attach_mod/pm_attachments.php attachmod239/attach_mod/pm_attachments.php
*** attachmod238/attach_mod/pm_attachments.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/pm_attachments.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: pm_attachments.php,v 1.21 2003/01/22 11:33:35 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: pm_attachments.php,v 1.23 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 52,60 ****
  	{
  		global $attach_config, $userdata;
  
! 		if ( (!intval($attach_config['allow_pm_attach'])) && ($userdata['user_level'] != ADMIN) )
  		{
! 			return (FALSE);
  		}
  	
  		display_attachments_preview($this->attachment_list, $this->attachment_filesize_list, $this->attachment_filename_list, $this->attachment_comment_list, $this->attachment_extension_list, $this->attachment_thumbnail_list);
--- 52,60 ----
  	{
  		global $attach_config, $userdata;
  
! 		if (!intval($attach_config['allow_pm_attach']))
  		{
! 			return FALSE;
  		}
  	
  		display_attachments_preview($this->attachment_list, $this->attachment_filesize_list, $this->attachment_filename_list, $this->attachment_comment_list, $this->attachment_extension_list, $this->attachment_thumbnail_list);
***************
*** 75,92 ****
  			$a_privmsgs_id = $privmsg_sent_id;
  		}
  		
! 		if ((!empty($a_privmsgs_id)) && ( $mode == 'post' || $mode == 'reply' || $mode == 'edit' ) && ( (intval($attach_config['allow_pm_attach']) )  || ($userdata['user_level'] == ADMIN) ))
  		{
  			$this->do_insert_attachment('attach_list', 'pm', $a_privmsgs_id);
  			$this->do_insert_attachment('last_attachment', 'pm', $a_privmsgs_id);
  
! 			if ( ( (count($this->attachment_list) > 0) || ($this->post_attach) ) && (!isset($HTTP_POST_VARS['update_attachment'])) )
  			{
  				$sql = "UPDATE " . PRIVMSGS_TABLE . "
  				SET privmsgs_attachment = 1
  				WHERE privmsgs_id = " . $a_privmsgs_id;
  
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
  				}
--- 75,92 ----
  			$a_privmsgs_id = $privmsg_sent_id;
  		}
  		
! 		if (!empty($a_privmsgs_id) && ($mode == 'post' || $mode == 'reply' || $mode == 'edit') && intval($attach_config['allow_pm_attach']))
  		{
  			$this->do_insert_attachment('attach_list', 'pm', $a_privmsgs_id);
  			$this->do_insert_attachment('last_attachment', 'pm', $a_privmsgs_id);
  
! 			if ((count($this->attachment_list) > 0 || $this->post_attach) && !isset($HTTP_POST_VARS['update_attachment']))
  			{
  				$sql = "UPDATE " . PRIVMSGS_TABLE . "
  					SET privmsgs_attachment = 1
  					WHERE privmsgs_id = " . $a_privmsgs_id;
  
! 				if (!$db->sql_query($sql))
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 107,113 ****
  			FROM ' . ATTACHMENTS_TABLE . '
  			WHERE privmsgs_id = ' . $original_privmsg_id;
  
! 			if ( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query Attachment Table', '', __LINE__, __FILE__, $sql);
  			}
--- 107,113 ----
  			FROM ' . ATTACHMENTS_TABLE . '
  			WHERE privmsgs_id = ' . $original_privmsg_id;
  
! 			if ( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Couldn\'t query Attachment Table', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 122,128 ****
  					$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) 
  					VALUES ( ' . $rows[$i]['attach_id'] . ', ' . $rows[$i]['post_id'] . ', ' . $new_privmsg_id . ', ' . $rows[$i]['user_id_1'] . ', ' . $rows[$i]['user_id_2'] . ')';
  
! 					if ( !($result = attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment for sent Private Message', '', __LINE__, __FILE__, $sql);
  					}
--- 122,128 ----
  					$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) 
  					VALUES ( ' . $rows[$i]['attach_id'] . ', ' . $rows[$i]['post_id'] . ', ' . $new_privmsg_id . ', ' . $rows[$i]['user_id_1'] . ', ' . $rows[$i]['user_id_2'] . ')';
  
! 					if ( !($result = $db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment for sent Private Message', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 132,138 ****
  				SET privmsgs_attachment = 1
  				WHERE privmsgs_id = " . $new_privmsg_id;
  
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
  				}
--- 132,138 ----
  				SET privmsgs_attachment = 1
  				WHERE privmsgs_id = " . $new_privmsg_id;
  
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 213,219 ****
  			$this->display_attach_box_limits();
  		}
  
! 		if ( (!intval($attach_config['allow_pm_attach'])) && ($userdata['user_level'] != ADMIN) )
  		{
  			return;
  		}
--- 213,219 ----
  			$this->display_attach_box_limits();
  		}
  
! 		if (!intval($attach_config['allow_pm_attach']))
  		{
  			return;
  		}
diff -crbB attachmod238/attach_mod/posting_attachments.php attachmod239/attach_mod/posting_attachments.php
*** attachmod238/attach_mod/posting_attachments.php	Thu Jun 19 19:20:17 2003
--- attachmod239/attach_mod/posting_attachments.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: posting_attachments.php,v 1.57 2003/06/19 16:34:50 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: posting_attachments.php,v 1.60 2003/08/30 16:13:00 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 87,93 ****
  
  		//
  		// Define Filesize Limits (Prepare Quota Settings)
! 		// Priority: Group, User, Management
  		//
  		// This method is somewhat query intensive, but i think because this one is only executed while attaching a file, 
  		// it does not make much sense to come up with an new db-entry.
--- 87,93 ----
  
  		//
  		// Define Filesize Limits (Prepare Quota Settings)
! 		// Priority: User, Group, Management
  		//
  		// This method is somewhat query intensive, but i think because this one is only executed while attaching a file, 
  		// it does not make much sense to come up with an new db-entry.
***************
*** 95,102 ****
  		// Default Limits for all Users/Groups)
  		//
  
! 		// Change this to 'user;group' if you want to have first priority on user quota settings.
! 		$priority = 'group;user';
  		
  		if ( $userdata_quota['user_level'] == ADMIN )
  		{
--- 95,103 ----
  		// Default Limits for all Users/Groups)
  		//
  
! 		// Change this to 'group;user' if you want to have first priority on group quota settings.
! //		$priority = 'group;user';
! 		$priority = 'user;group';
  
  		if ( $userdata_quota['user_level'] == ADMIN )
  		{
***************
*** 136,142 ****
  				$sql = "SELECT u.group_id FROM " . USER_GROUP_TABLE . " u, " . GROUPS_TABLE . " g 
  				WHERE (g.group_single_user = 0) AND (u.group_id = g.group_id) AND (u.user_id = " . $user_id . ")";
  			
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get User Group', '', __LINE__, __FILE__, $sql);
  				}
--- 137,143 ----
  				$sql = "SELECT u.group_id FROM " . USER_GROUP_TABLE . " u, " . GROUPS_TABLE . " g 
  				WHERE (g.group_single_user = 0) AND (u.group_id = g.group_id) AND (u.user_id = " . $user_id . ")";
  			
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get User Group', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 155,161 ****
  					WHERE (q.group_id IN (" . implode(',', $group_id) . ")) AND (q.group_id <> 0) AND (q.quota_type = " . $quota_type . ") 
  					AND (q.quota_limit_id = l.quota_limit_id) ORDER BY l.quota_limit DESC LIMIT 1";
  
! 					if ( !($result = attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Could not get Group Quota', '', __LINE__, __FILE__, $sql);
  					}
--- 156,162 ----
  					WHERE (q.group_id IN (" . implode(',', $group_id) . ")) AND (q.group_id <> 0) AND (q.quota_type = " . $quota_type . ") 
  					AND (q.quota_limit_id = l.quota_limit_id) ORDER BY l.quota_limit DESC LIMIT 1";
  
! 					if ( !($result = $db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Could not get Group Quota', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 178,184 ****
  				WHERE (q.user_id = " . $user_id . ") AND (q.user_id <> 0) AND (q.quota_type = " . $quota_type . ") 
  				AND (q.quota_limit_id = l.quota_limit_id) LIMIT 1";
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get User Quota', '', __LINE__, __FILE__, $sql);
  				}
--- 179,185 ----
  				WHERE (q.user_id = " . $user_id . ") AND (q.user_id <> 0) AND (q.quota_type = " . $quota_type . ") 
  				AND (q.quota_limit_id = l.quota_limit_id) LIMIT 1";
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get User Quota', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 206,212 ****
  				$sql = "SELECT quota_limit FROM " . QUOTA_LIMITS_TABLE . "
  				WHERE quota_limit_id = " . $quota_id . " LIMIT 1";
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get Default Quota Limit', '', __LINE__, __FILE__, $sql);
  				}
--- 207,213 ----
  				$sql = "SELECT quota_limit FROM " . QUOTA_LIMITS_TABLE . "
  				WHERE quota_limit_id = " . $quota_id . " LIMIT 1";
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not get Default Quota Limit', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 545,551 ****
  								SET thumbnail = 0
  								WHERE attach_id = " . $actual_id_list[$i];
  
! 								if ( !(attach_sql_query($sql)) )
  								{
  									message_die(GENERAL_ERROR, 'Unable to update ' . ATTACHMENTS_DESC_TABLE . ' Table.', '', __LINE__, __FILE__, $sql);
  								}
--- 546,552 ----
  								SET thumbnail = 0
  								WHERE attach_id = " . $actual_id_list[$i];
  
! 								if ( !($db->sql_query($sql)) )
  								{
  									message_die(GENERAL_ERROR, 'Unable to update ' . ATTACHMENTS_DESC_TABLE . ' Table.', '', __LINE__, __FILE__, $sql);
  								}
***************
*** 603,609 ****
  						$sql = "SELECT physical_filename, comment, thumbnail FROM " . ATTACHMENTS_DESC_TABLE . "
  						WHERE attach_id = " . $attachment_id;
  
! 						if ( !($result = attach_sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Unable to select old Attachment Entry.', '', __LINE__, __FILE__, $sql);
  						}
--- 604,610 ----
  						$sql = "SELECT physical_filename, comment, thumbnail FROM " . ATTACHMENTS_DESC_TABLE . "
  						WHERE attach_id = " . $attachment_id;
  
! 						if ( !($result = $db->sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Unable to select old Attachment Entry.', '', __LINE__, __FILE__, $sql);
  						}
***************
*** 627,633 ****
  						SET physical_filename = '" . $this->attach_filename . "', real_filename = '" . $this->filename . "', comment = '" . $comment . "', extension = '" . $this->extension . "', mimetype = '" . $this->type . "', filesize = " . $this->filesize . ", filetime = " . $this->filetime . ", thumbnail = " . $this->thumbnail . "
  						WHERE attach_id = " . $attachment_id;
  						
! 						if ( !(attach_sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Unable to update the Attachment.', '', __LINE__, __FILE__, $sql);
  						}
--- 628,634 ----
  						SET physical_filename = '" . $this->attach_filename . "', real_filename = '" . $this->filename . "', comment = '" . $comment . "', extension = '" . $this->extension . "', mimetype = '" . $this->type . "', filesize = " . $this->filesize . ", filetime = " . $this->filetime . ", thumbnail = " . $this->thumbnail . "
  						WHERE attach_id = " . $attachment_id;
  						
! 						if ( !($db->sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Unable to update the Attachment.', '', __LINE__, __FILE__, $sql);
  						}
***************
*** 744,750 ****
  					SET comment = '" . trim($this->attachment_comment_list[$i]) . "'
  					WHERE attach_id = " . $this->attachment_id_list[$i];
  
! 					if ( !(attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Unable to update the File Comment.', '', __LINE__, __FILE__, $sql);
  					}
--- 745,751 ----
  					SET comment = '" . trim($this->attachment_comment_list[$i]) . "'
  					WHERE attach_id = " . $this->attachment_id_list[$i];
  
! 					if ( !($db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Unable to update the File Comment.', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 758,764 ****
  					$sql = "INSERT INTO " . ATTACHMENTS_DESC_TABLE . " (physical_filename, real_filename, comment, extension, mimetype, filesize, filetime, thumbnail) 
  					VALUES ( '" . $this->attachment_list[$i] . "', '" . str_replace("'", "''", $this->attachment_filename_list[$i]) . "', '" . trim($this->attachment_comment_list[$i]) . "', '" . $this->attachment_extension_list[$i] . "', '" . $this->attachment_mimetype_list[$i] . "', " . $this->attachment_filesize_list[$i] . ", " . $this->attachment_filetime_list[$i] . ", " . $this->attachment_thumbnail_list[$i] . ")";
  
! 					if ( !(attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  					}
--- 759,765 ----
  					$sql = "INSERT INTO " . ATTACHMENTS_DESC_TABLE . " (physical_filename, real_filename, comment, extension, mimetype, filesize, filetime, thumbnail) 
  					VALUES ( '" . $this->attachment_list[$i] . "', '" . str_replace("'", "''", $this->attachment_filename_list[$i]) . "', '" . trim($this->attachment_comment_list[$i]) . "', '" . $this->attachment_extension_list[$i] . "', '" . $this->attachment_mimetype_list[$i] . "', " . $this->attachment_filesize_list[$i] . ", " . $this->attachment_filetime_list[$i] . ", " . $this->attachment_thumbnail_list[$i] . ")";
  
! 					if ( !($db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 767,773 ****
  					
  					$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) VALUES (' . $attach_id . ', ' . $post_id . ', ' . $privmsgs_id . ', ' . $user_id_1 . ', ' . $user_id_2 . ')';
  					
! 					if ( !(attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  					}
--- 768,774 ----
  					
  					$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) VALUES (' . $attach_id . ', ' . $post_id . ', ' . $privmsgs_id . ', ' . $user_id_1 . ', ' . $user_id_2 . ')';
  					
! 					if ( !($db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 790,796 ****
  				//
  				// Inform the user that his post has been created, but nothing is attached
  				//
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  				}
--- 791,797 ----
  				//
  				// Inform the user that his post has been created, but nothing is attached
  				//
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 800,806 ****
  				$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) 
  				VALUES (' . $attach_id . ', ' . $post_id . ', ' . $privmsgs_id . ', ' . $user_id_1 . ', ' . $user_id_2 . ')';
  					
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  				}
--- 801,807 ----
  				$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) 
  				VALUES (' . $attach_id . ', ' . $post_id . ', ' . $privmsgs_id . ', ' . $user_id_1 . ', ' . $user_id_2 . ')';
  					
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t store Attachment.<br />Your ' . $message_type . ' has been stored.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 873,879 ****
  			'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'],
  			'L_FILE_NAME' => $lang['File_name'],
  			'L_FILE_COMMENT' => $lang['File_comment'],
! 			'RULES' => '<a href="' . append_sid("attach_mod/attach_rules.$phpEx?f=$u_rules_id") . '" target="_blank">' . $lang['Allowed_extensions_and_sizes'] . '</a>',
  
  			'S_HIDDEN' => $s_hidden)
  		);
--- 874,880 ----
  			'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'],
  			'L_FILE_NAME' => $lang['File_name'],
  			'L_FILE_COMMENT' => $lang['File_comment'],
! 			'RULES' => '<a href="' . append_sid($phpbb_root_path . "attach_rules.$phpEx?f=$u_rules_id") . '" target="_blank">' . $lang['Allowed_extensions_and_sizes'] . '</a>',
  
  			'S_HIDDEN' => $s_hidden)
  		);
***************
*** 1007,1013 ****
  			WHERE (g.group_id = e.group_id) AND (e.extension = '" . $this->extension . "')
  			LIMIT 1";
  
! 			if ( !($result = attach_sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not query Extensions.', '', __LINE__, __FILE__, $sql);
  			}
--- 1008,1014 ----
  			WHERE (g.group_id = e.group_id) AND (e.extension = '" . $this->extension . "')
  			LIMIT 1";
  
! 			if ( !($result = $db->sql_query($sql)) )
  			{
  				message_die(GENERAL_ERROR, 'Could not query Extensions.', '', __LINE__, __FILE__, $sql);
  			}
***************
*** 1133,1139 ****
  			{
  				$sql = 'SELECT sum(filesize) as total FROM ' . ATTACHMENTS_DESC_TABLE;
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not query total filesize', '', __LINE__, __FILE__, $sql);
  				}
--- 1134,1140 ----
  			{
  				$sql = 'SELECT sum(filesize) as total FROM ' . ATTACHMENTS_DESC_TABLE;
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Could not query total filesize', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 1190,1196 ****
  						FROM " . ATTACHMENTS_DESC_TABLE . "
  						WHERE attach_id IN (" . implode(', ', $attach_id) . ")";
  
! 						if ( !($result = attach_sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Could not query total filesize', '', __LINE__, __FILE__, $sql);
  						}
--- 1191,1197 ----
  						FROM " . ATTACHMENTS_DESC_TABLE . "
  						WHERE attach_id IN (" . implode(', ', $attach_id) . ")";
  
! 						if ( !($result = $db->sql_query($sql)) )
  						{
  							message_die(GENERAL_ERROR, 'Could not query total filesize', '', __LINE__, __FILE__, $sql);
  						}
***************
*** 1258,1264 ****
  					FROM " . USERS_TABLE . "
  					WHERE username = '" . $to_user . "'";
  					
! 					if ( !($result = attach_sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Could not query userdata', '', __LINE__, __FILE__, $sql);
  					}
--- 1259,1265 ----
  					FROM " . USERS_TABLE . "
  					WHERE username = '" . $to_user . "'";
  					
! 					if ( !($result = $db->sql_query($sql)) )
  					{
  						message_die(GENERAL_ERROR, 'Could not query userdata', '', __LINE__, __FILE__, $sql);
  					}
***************
*** 1559,1565 ****
  				SET post_attachment = 1
  				WHERE post_id = " . $post_id;
  
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Posts Table.', '', __LINE__, __FILE__, $sql);
  				}
--- 1560,1566 ----
  				SET post_attachment = 1
  				WHERE post_id = " . $post_id;
  
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Posts Table.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 1567,1573 ****
  				$sql = "SELECT topic_id FROM " . POSTS_TABLE . "
  				WHERE post_id = " . $post_id;
  				
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to select Posts Table.', '', __LINE__, __FILE__, $sql);
  				}
--- 1568,1574 ----
  				$sql = "SELECT topic_id FROM " . POSTS_TABLE . "
  				WHERE post_id = " . $post_id;
  				
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to select Posts Table.', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 1578,1584 ****
  				SET topic_attachment = 1
  				WHERE topic_id = " . $row['topic_id'];
  
! 				if ( !(attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Topics Table.', '', __LINE__, __FILE__, $sql);
  				}
--- 1579,1585 ----
  				SET topic_attachment = 1
  				WHERE topic_id = " . $row['topic_id'];
  
! 				if ( !($db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Unable to update Topics Table.', '', __LINE__, __FILE__, $sql);
  				}
Only in attachmod239: attach_rules.php
diff -crbB attachmod238/download.php attachmod239/download.php
*** attachmod238/download.php	Thu Jun 19 19:20:17 2003
--- attachmod239/download.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: download.php,v 1.35 2003/06/19 16:34:50 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: download.php,v 1.36 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 286,292 ****
  FROM ' . ATTACHMENTS_DESC_TABLE . '
  WHERE attach_id = ' . intval($download_id);
  
! if ( !($result = attach_sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql);
  }
--- 286,292 ----
  FROM ' . ATTACHMENTS_DESC_TABLE . '
  WHERE attach_id = ' . intval($download_id);
  
! if ( !($result = $db->sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql);
  }
***************
*** 307,313 ****
  FROM ' . ATTACHMENTS_TABLE . '
  WHERE attach_id = ' . $attachment['attach_id'];
  
! if ( !($result = attach_sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql);
  }
--- 307,313 ----
  FROM ' . ATTACHMENTS_TABLE . '
  WHERE attach_id = ' . $attachment['attach_id'];
  
! if ( !($result = $db->sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql);
  }
***************
*** 323,329 ****
  		FROM ' . POSTS_TABLE . '
  		WHERE post_id = ' . $auth_pages[$i]['post_id'];
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not query post information', '', __LINE__, __FILE__, $sql);
  		}
--- 323,329 ----
  		FROM ' . POSTS_TABLE . '
  		WHERE post_id = ' . $auth_pages[$i]['post_id'];
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Could not query post information', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 362,368 ****
  FROM " . EXTENSION_GROUPS_TABLE . " g, " . EXTENSIONS_TABLE . " e
  WHERE (g.allow_group = 1) AND (g.group_id = e.group_id)";
  
! if ( !($result = attach_sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query Allowed Extensions.', '', __LINE__, __FILE__, $sql);
  }
--- 362,368 ----
  FROM " . EXTENSION_GROUPS_TABLE . " g, " . EXTENSIONS_TABLE . " e
  WHERE (g.allow_group = 1) AND (g.group_id = e.group_id)";
  
! if ( !($result = $db->sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Could not query Allowed Extensions.', '', __LINE__, __FILE__, $sql);
  }
***************
*** 401,407 ****
  	SET download_count = download_count + 1 
  	WHERE attach_id = ' . $attachment['attach_id'];
  	
! 	if ( !(attach_sql_query($sql)) )
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  	}
--- 401,407 ----
  	SET download_count = download_count + 1 
  	WHERE attach_id = ' . $attachment['attach_id'];
  	
! 	if (!$db->sql_query($sql))
  	{
  		message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
  	}
diff -crbB attachmod238/language/lang_english/lang_admin_attach.php attachmod239/language/lang_english/lang_admin_attach.php
*** attachmod238/language/lang_english/lang_admin_attach.php	Thu Jun 19 19:20:17 2003
--- attachmod239/language/lang_english/lang_admin_attach.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *     copyright            : (C) 2002 Meik Sievertsen
   *     email                : acyd.burn@gmx.de
   *
!  *     $Id: lang_admin_attach.php,v 1.35 2002/12/21 17:30:01 acydburn Exp $
   *
   ****************************************************************************/
  
--- 6,12 ----
   *     copyright            : (C) 2002 Meik Sievertsen
   *     email                : acyd.burn@gmx.de
   *
!  *     $Id: lang_admin_attach.php,v 1.36 2003/08/30 15:47:39 acydburn Exp $
   *
   ****************************************************************************/
  
***************
*** 144,149 ****
--- 144,153 ----
  $lang['Image_imagick_path_explain'] = 'Enter the Path to the convert program of imagick, normally /usr/bin/convert (on windows: c:/imagemagick/convert.exe).';
  $lang['Image_search_imagick'] = 'Search Imagick';
  
+ $lang['Use_gd2'] = 'Make use of GD2 Extension';
+ $lang['Use_gd2_explain'] = 'PHP is able to be compiled with the GD1 or GD2 Extension for image manipulating. To correctly create Thumbnails without imagemagick the Attachment Mod uses two different methods, based on your selection here. If your thumbnails are in a bad quality or screwed up, try to change this setting.';
+ $lang['Attachment_version'] = 'Attachment Mod Version %s'; // %s is the version number
+ 
  // Extensions -> Forbidden Extensions
  $lang['Manage_forbidden_extensions'] = 'Manage Forbidden Extensions';
  $lang['Manage_forbidden_extensions_explain'] = 'Here you can add or delete the forbidden extensions. The Extensions php, php3 and php4 are forbidden by default for security reasons, you can not delete them.';
diff -crbB attachmod238/language/lang_german/lang_admin_attach.php attachmod239/language/lang_german/lang_admin_attach.php
*** attachmod238/language/lang_german/lang_admin_attach.php	Thu Jun 19 19:20:17 2003
--- attachmod239/language/lang_german/lang_admin_attach.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *     copyright            : (C) 2002 Meik Sievertsen
   *     email                : acyd.burn@gmx.de
   *
!  *     $Id: lang_admin_attach.php,v 1.12 2002/12/21 17:30:01 acydburn Exp $
   *
   ****************************************************************************/
  
--- 6,12 ----
   *     copyright            : (C) 2002 Meik Sievertsen
   *     email                : acyd.burn@gmx.de
   *
!  *     $Id: lang_admin_attach.php,v 1.13 2003/08/30 15:47:40 acydburn Exp $
   *
   ****************************************************************************/
  
***************
*** 144,149 ****
--- 144,153 ----
  $lang['Image_imagick_path_explain'] = 'Gib den Pfad zu dem Convert Programm von Imagemagick an, noralerweise ist das /usr/bin/convert (unter windows: c:/imagemagick/convert.exe).';
  $lang['Image_search_imagick'] = 'Imagemagick suchen';
  
+ $lang['Use_gd2'] = 'Benutze die GD2 Erweiterung';
+ $lang['Use_gd2_explain'] = 'PHP kann mit der GD1 oder GD2 Erweiterung kompiliert werden, die fr Bildmanipulationen genutzt wird. Um Thumbnails korrekt ohne der Zunahme von Imagemagick generieren zu knnen, benutzt das Attachment Mod zwei Methoden, basierend auf der hier gewhlten Einstellung. Wenn deine Thumbnails eine schlechte Qualitt besitzen oder total verzerrt sind, dann versuche diese Einstellung zu ndern.';
+ $lang['Attachment_version'] = 'Attachment Mod Version %s'; // %s is the version number
+ 
  // Extensions -> Forbidden Extensions
  $lang['Manage_forbidden_extensions'] = 'Verbotene Erweiterungen einstellen';
  $lang['Manage_forbidden_extensions_explain'] = 'Hier kannst du verbotene Erweiterungen hinzufgen oder lschen. Die Erweiterungen php, php3 und php4 sind standardmig verboten, du kannst sie hier nicht lschen.';
diff -crbB attachmod238/templates/subSilver/add_attachment_body.tpl attachmod239/templates/subSilver/add_attachment_body.tpl
*** attachmod238/templates/subSilver/add_attachment_body.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/add_attachment_body.tpl	Sat Aug 30 18:55:29 2003
***************
*** 8,14 ****
  
  	<tr> 
  		<td class="row1"><span class="gen"><b>{L_FILE_NAME}</b></span></td> 
! 	    <td class="row2"><span class="genmed"><input type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="{FILENAME}" class="post" /></span></td> 
  	</tr> 
  	<tr> 
  		<td class="row1"><span class="gen"><b>{L_FILE_COMMENT}</b></span></td> 
--- 8,14 ----
  
  	<tr> 
  		<td class="row1"><span class="gen"><b>{L_FILE_NAME}</b></span></td> 
! 	    <td class="row2"><span class="genmed"><input type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="" class="post" /></span></td> 
  	</tr> 
  	<tr> 
  		<td class="row1"><span class="gen"><b>{L_FILE_COMMENT}</b></span></td> 
diff -crbB attachmod238/templates/subSilver/admin/attach_cat_body.tpl attachmod239/templates/subSilver/admin/attach_cat_body.tpl
*** attachmod238/templates/subSilver/admin/attach_cat_body.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_cat_body.tpl	Sat Aug 30 18:55:29 2003
***************
*** 23,28 ****
--- 23,32 ----
  		<td class="row1" width="80%">{L_MIN_THUMB_FILESIZE}<br /><span class="gensmall">{L_MIN_THUMB_FILESIZE_EXPLAIN}</span></td>
  		<td class="row2"><input type="text" size="7" maxlength="15" name="img_min_thumb_filesize" value="{IMAGE_MIN_THUMB_FILESIZE}" class="post" /> {L_BYTES}</td>
  	</tr>
+ 	<tr>
+ 		<td class="row1" width="80%">{L_USE_GD2}<br /><span class="gensmall">{L_USE_GD2_EXPLAIN}</span></td>
+ 		<td class="row2"><input type="radio" name="use_gd2" value="1" {USE_GD2_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="use_gd2" value="0" {USE_GD2_NO} /> {L_NO}</td>
+ 	</tr>
  <!-- END switch_thumbnail_support -->
  	<tr>
  		<td class="row1" width="80%">{L_IMAGICK_PATH}<br /><span class="gensmall">{L_IMAGICK_PATH_EXPLAIN}</span></td>
***************
*** 41,44 ****
--- 45,51 ----
  	</tr>
  </table></form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_cp_attachments.tpl attachmod239/templates/subSilver/admin/attach_cp_attachments.tpl
*** attachmod238/templates/subSilver/admin/attach_cp_attachments.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_cp_attachments.tpl	Sat Aug 30 18:55:29 2003
***************
*** 80,82 ****
--- 80,85 ----
  	<td align="right"><span class="nav">{PAGINATION}&nbsp;</span></td>
    </tr>
  </table></form>
+ 
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
diff -crbB attachmod238/templates/subSilver/admin/attach_cp_body.tpl attachmod239/templates/subSilver/admin/attach_cp_body.tpl
*** attachmod238/templates/subSilver/admin/attach_cp_body.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_cp_body.tpl	Sat Aug 30 18:55:29 2003
***************
*** 47,49 ****
--- 47,52 ----
    </tr>
  </table>
  </form>
+ 
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
diff -crbB attachmod238/templates/subSilver/admin/attach_cp_search.tpl attachmod239/templates/subSilver/admin/attach_cp_search.tpl
*** attachmod238/templates/subSilver/admin/attach_cp_search.tpl	Thu Jun 19 19:20:17 2003
--- attachmod239/templates/subSilver/admin/attach_cp_search.tpl	Sat Aug 30 18:55:29 2003
***************
*** 72,74 ****
--- 72,77 ----
  </table>
  
  </form>
+ 
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
diff -crbB attachmod238/templates/subSilver/admin/attach_cp_user.tpl attachmod239/templates/subSilver/admin/attach_cp_user.tpl
*** attachmod238/templates/subSilver/admin/attach_cp_user.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_cp_user.tpl	Sat Aug 30 18:55:29 2003
***************
*** 44,46 ****
--- 44,49 ----
  	<td align="right"><span class="nav">{PAGINATION}&nbsp;</span></td>
    </tr>
  </table></form>
+ 
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
diff -crbB attachmod238/templates/subSilver/admin/attach_extension_groups.tpl attachmod239/templates/subSilver/admin/attach_extension_groups.tpl
*** attachmod238/templates/subSilver/admin/attach_extension_groups.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_extension_groups.tpl	Sat Aug 30 18:55:29 2003
***************
*** 99,102 ****
--- 99,105 ----
  
  </form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_extensions.tpl attachmod239/templates/subSilver/admin/attach_extensions.tpl
*** attachmod238/templates/subSilver/admin/attach_extensions.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_extensions.tpl	Sat Aug 30 18:55:29 2003
***************
*** 50,53 ****
--- 50,56 ----
  
  </form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_forbidden_extensions.tpl attachmod239/templates/subSilver/admin/attach_forbidden_extensions.tpl
*** attachmod238/templates/subSilver/admin/attach_forbidden_extensions.tpl	Thu Jun 19 19:20:17 2003
--- attachmod239/templates/subSilver/admin/attach_forbidden_extensions.tpl	Sat Aug 30 18:55:29 2003
***************
*** 39,42 ****
--- 39,45 ----
  
  </form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_manage_body.tpl attachmod239/templates/subSilver/admin/attach_manage_body.tpl
*** attachmod238/templates/subSilver/admin/attach_manage_body.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_manage_body.tpl	Sat Aug 30 18:55:29 2003
***************
*** 141,144 ****
--- 141,147 ----
  	</tr>
  </table></form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_quota_body.tpl attachmod239/templates/subSilver/admin/attach_quota_body.tpl
*** attachmod238/templates/subSilver/admin/attach_quota_body.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_quota_body.tpl	Sat Aug 30 18:55:29 2003
***************
*** 144,147 ****
--- 144,150 ----
  </table>
  <!-- END switch_quota_limit_desc -->
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/attach_shadow.tpl attachmod239/templates/subSilver/admin/attach_shadow.tpl
*** attachmod238/templates/subSilver/admin/attach_shadow.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/attach_shadow.tpl	Sat Aug 30 18:55:29 2003
***************
*** 70,73 ****
--- 70,76 ----
  
  </form>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/templates/subSilver/admin/extension_groups_permissions.tpl attachmod239/templates/subSilver/admin/extension_groups_permissions.tpl
*** attachmod238/templates/subSilver/admin/extension_groups_permissions.tpl	Thu Jun 19 19:20:18 2003
--- attachmod239/templates/subSilver/admin/extension_groups_permissions.tpl	Sat Aug 30 18:55:29 2003
***************
*** 52,55 ****
--- 52,58 ----
  	</tr>
  </table>
  
+ <br />
+ <div align="center"><span class="copyright">{ATTACH_VERSION}</span></div>
+ 
  <br clear="all" />
diff -crbB attachmod238/uacp.php attachmod239/uacp.php
*** attachmod238/uacp.php	Thu Jun 19 19:20:17 2003
--- attachmod239/uacp.php	Sat Aug 30 18:55:29 2003
***************
*** 6,12 ****
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: uacp.php,v 1.11 2003/02/23 13:15:30 acydburn Exp $
   *
   *
   ***************************************************************************/
--- 6,12 ----
   *   copyright            : (C) 2002 Meik Sievertsen
   *   email                : acyd.burn@gmx.de
   *
!  *   $Id: uacp.php,v 1.12 2003/08/30 14:02:32 acydburn Exp $
   *
   *
   ***************************************************************************/
***************
*** 82,88 ****
  	$profiledata['user_id'] = intval($profiledata['user_id']);
  }
  
! if ( ($profiledata['user_id'] != $userdata['user_id']) && ($userdata['user_level'] != ADMIN) )
  {
  	message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
  }
--- 82,88 ----
  	$profiledata['user_id'] = intval($profiledata['user_id']);
  }
  
! if ($profiledata['user_id'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN)
  {
  	message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
  }
***************
*** 99,105 ****
  
  include($phpbb_root_path . 'language/lang_' . $language . '/lang_admin_attach.' . $phpEx);
  
! $start = ( isset($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;
  
  if(isset($HTTP_POST_VARS['order']))
  {
--- 99,105 ----
  
  include($phpbb_root_path . 'language/lang_' . $language . '/lang_admin_attach.' . $phpEx);
  
! $start = (isset($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0;
  
  if(isset($HTTP_POST_VARS['order']))
  {
***************
*** 114,120 ****
  	$sort_order = '';
  }
  
! if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
  {
  	$mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
  }
--- 114,120 ----
  	$sort_order = '';
  }
  
! if (isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
  {
  	$mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
  }
***************
*** 209,215 ****
  
  	for ($i = 0; $i < count($delete_id_list); $i++)
  	{
! 		$sql = "SELECT post_id FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = " . $delete_id_list[$i];
  		$result = $db->sql_query($sql);
  		if ($result)
  		{
--- 209,217 ----
  
  	for ($i = 0; $i < count($delete_id_list); $i++)
  	{
! 		$sql = "SELECT post_id 
! 			FROM " . ATTACHMENTS_TABLE . " 
! 				WHERE attach_id = " . $delete_id_list[$i];
  		$result = $db->sql_query($sql);
  		if ($result)
  		{
***************
*** 227,237 ****
  	
  
  }
! else if ( ($delete) && (count($delete_id_list)) > 0 )
  {
- 	//
  	// Not confirmed, show confirmation message
- 	//	
  	$hidden_fields = '<input type="hidden" name="view" value="' . $view . '" />';
  	$hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
  	$hidden_fields .= '<input type="hidden" name="order" value="' . $sort_order . '" />';
--- 229,237 ----
  	
  
  }
! else if ($delete && count($delete_id_list) > 0)
  {
  	// Not confirmed, show confirmation message
  	$hidden_fields = '<input type="hidden" name="view" value="' . $view . '" />';
  	$hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
  	$hidden_fields .= '<input type="hidden" name="order" value="' . $sort_order . '" />';
***************
*** 312,318 ****
  WHERE user_id_1 = " . $profiledata['user_id'] . " OR user_id_2 = " . $profiledata['user_id'] . "
  GROUP BY attach_id";
  		
! if ( !($result = attach_sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  }
--- 312,318 ----
  WHERE user_id_1 = " . $profiledata['user_id'] . " OR user_id_2 = " . $profiledata['user_id'] . "
  GROUP BY attach_id";
  		
! if ( !($result = $db->sql_query($sql)) )
  {
  	message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  }
***************
*** 335,343 ****
  	WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " .
  	$order_by;
  		
! 	if ( !($result = attach_sql_query($sql)) )
  	{
! 		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  	}
  
  	$attachments = $db->sql_fetchrowset($result);
--- 335,343 ----
  		WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " .
  		$order_by;
  		
! 	if ( !($result = $db->sql_query($sql)) )
  	{
! 		message_die(GENERAL_ERROR, "Couldn't query attachments", '', __LINE__, __FILE__, $sql);
  	}
  
  	$attachments = $db->sql_fetchrowset($result);
***************
*** 365,371 ****
  		FROM " . ATTACHMENTS_TABLE . "
  		WHERE attach_id = " . $attachments[$i]['attach_id'];
  
! 		if ( !($result = attach_sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  		}
--- 365,371 ----
  		FROM " . ATTACHMENTS_TABLE . "
  		WHERE attach_id = " . $attachments[$i]['attach_id'];
  
! 		if ( !($result = $db->sql_query($sql)) )
  		{
  			message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
  		}
***************
*** 382,388 ****
  				WHERE p.post_id = " . $ids[$j]['post_id'] . " AND p.topic_id = t.topic_id
  				GROUP BY t.topic_id, t.topic_title";
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t query topic', '', __LINE__, __FILE__, $sql);
  				}
--- 382,388 ----
  				WHERE p.post_id = " . $ids[$j]['post_id'] . " AND p.topic_id = t.topic_id
  				GROUP BY t.topic_id, t.topic_title";
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t query topic', '', __LINE__, __FILE__, $sql);
  				}
***************
*** 407,413 ****
  				FROM " . PRIVMSGS_TABLE . "
  				WHERE privmsgs_id = " . $ids[$j]['privmsgs_id'];
  
! 				if ( !($result = attach_sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t get Privmsgs Type', '', __LINE__, __FILE__, $sql);
  				}
--- 407,413 ----
  				FROM " . PRIVMSGS_TABLE . "
  				WHERE privmsgs_id = " . $ids[$j]['privmsgs_id'];
  
! 				if ( !($result = $db->sql_query($sql)) )
  				{
  					message_die(GENERAL_ERROR, 'Couldn\'t get Privmsgs Type', '', __LINE__, __FILE__, $sql);
  				}
