#############################################################################
## Mod Title:   File Attachment Mod v2 
## Mod Version: 2.1.1
## Author:      Meik Sievertsen (acyd.burn@gmx.de)
## Site:        http://www.opentools.de/attach_mod/ (here you can download Language Packs)
##
## Description: 
##		This Mod adds the ability of File Attachments to phpBB2 v2.0.
##		Versions >= 2.1.1 only supports phpBB2 RC4 and greater.
##
## Features:
##		- ACL for Attachments (you can set permissions for Attachments on each forum)
##		  Permission to download attachments (read permission in phpBB2 for now)
##		  Permission to attach files
##		- Add Attachments with comment
##		- Delete Attachments in post if posts deleted or pruned (in moderator cp also)
##		- Delete/Add/Change Attachments with edit post
##		- even if the local path for attachments is changed in admin, all previous posted attachments will
##		  be displayed correctly
##		- category support: (special behaviour instead of just presenting a link)
##			- display images
##			- display streaming wma-files
##			- display flash files
##		- little image for attachments (in forum view and thread view, also per Mime Group possible)
##		- max upload size definable (also per Mime Group)
##		- maximum number of attachments per post definable
##		- attachment quota (maximum size of all attachments)
##		- download counter
##		- multiple attachments in one post
##		- Download Link Presentation selectable for every Mime Group
##			This is very useful for Datatypes that support a 'real' link, for example real media files
##
##		- Admin Modules
##		  -> Define Filesize, Attachment Icon, Local Path ...
##		  -> Manage Forbidden Extensions
##		  -> Manage Mime Types (Delete, Add, Assign new group)
##		  -> Manage Mime Groups (Delete, Add, Permit posting of one group, define image-group)
##		  -> Delete Shadow Attachments (those Attachments not deleted with posts, for what reason ever)
##		  -> a complete Attachment Control Panel (with an integrated search feature)
## 
##		- languages: english, french, german, norwegian, dutch, italian, polish, chinese traditional taiwan, albanian
##			( languages at work (as far as i know): russian, spanish )
##			( if someone is willing to translate the Attachment Mod to other languages, please contact me )
##
##		- database-support: mysql, mysql4, mssql, mssql-odbc, postgresql
##
## Credits:
##	Translators:
##		[ French ] - Lionel F. Lebeau (lionel.lebeau (at) noos.fr)
##		[ Norwegian ] - torgeir andrew waterhouse (torgeir.waterhouse (at) forbrukerradet.no)
##		[ Dutch ] - Matthijs van de Water (matthijs (at) beryllium.net)
##		[ Italian ] - Michael Scalet (vran (at) jlbbooks.it)
##		[ Polish ] - Marek Sliwinski (elfy (at) tolkien.com.pl)
##              [ Taiwan ] - Cheng-Yu Wang (jack (at) peacock-ad.com)
##		[ Albanian ] - Ing. Jakup Sadiku (jasacom (at) albaforum.com)
##
##	Additional:
##		[ MSSQL-Support ] - F. Javier "Maverick" Lancharro (maverick (at) spania-hq.com)
##		[ FAQ ] - torgeir andrew waterhouse (torgeir.waterhouse (at) forbrukerradet.no)
##
## Revision History:
##
##		2002-03-27 - Version 2.1.1
##			- added the albanian language pack
##			- added a FAQ
##			- Split up the Languages to be seperate available
##			- Made a little html-page about this
##
##		2002-03-26
##			- made those category definitions available to clean install... 
##			  if you are upgrading and don't know what to add for flash, wma and rm files, drop me a pm or mail me. :)
##			- added category swf (flash files)
##
##		2002-03-25
##			- discontinue support for phpBB2 RC2 and phpBB2 RC3
##			- added taiwanese language
##			- some cleanups
##
##		2002-03-24
##			- the admin has the ability to specify maximum filesizes to mime groups
##			- added download_mode (you can choose, if you want to present the 'ghost'-link or
##			  the physical link. Now rm-files can attached correctly)
##			- added a category selector into Mime Groups
##			- inline image display is a category now and depends on that of course (inline image selector
##			  in management deleted)
##			- category wma-files added (if category is assigned, wma-files can be streamed in posts)
##			- Now i can add special html-codes for mime groups (thanks to the category-thingy. ;) )
##			- special upload images for mime groups now possible.
##			- added extra checking of upload dir (checks if it exists and if it's chmodded correctly)
##			- added a .htaccess file to the files-directory (thanks matthijs for the suggestion)
##
##		2002-03-22
##			- fixed bug : Couldn't download Attachment on some circumstances
##
##		2002-03-20 - Version 2.1.0
##			- fixed bug : special chars in file comments
##			- fixed bug : duplicate attachments on refresh/poll
##			- fixed bug : can't attach files in opera
##			- fixed bug : postgresql schema file incomplete
##			- cleanup install.txt (split up RC2, RC3, RC4/CVS, additional folder)
##			- cleanup update.txt (additional folder)
##			- added dutch translation
##			- added italian translation
##			- added polish translation
##			- cleanup in faq (thanks michael)
##		
##		2002-03-03 - Version 2.0.9
##			- a small change in displaying attachments (viewtopic), now the display-order is from newest to oldest
##			  ( if you upgrade please execute update_to_209.php and delete it after execution )
##
##		2002-03-02
##			- added forbidden file-extensions pl, asp and cgi in upgrade-script (since v2.0.7 there are in db-basic)
##			- filesize and attachment post time now stored in db (speed increase)
##			- added attachment quota feature
##			- added a search-feature to the Attachment Control Panel
##
##		2002-03-01
##			- added feature: 'disable mod'
##			- changed some things for file uploading
##			- bring it up to latest cvs... :)
##
##		2002-02-27 - Version 2.0.8
##			- fixed a very bad bug who overrides the Authentication (thanks to SHS` who have seen it at first. ;) )
##			- Changed the Database shema a little bit
##			- Introduced Basic and Schema-files for postgreSQL (NOT TESTED)
##			- The Language Variable {L_POSTED_ATTACHMENTS} is now available in viewtopic_attach_body.tpl
##			- Introduced Language Variables for hardcoded Sizes in Templates (Bytes, KB, MB)
##			- Added a little Template How-To (attach_mod_tpl_doc.html)
##
##		2002-02-23 - Version 2.0.7
##			- changed the use of authentication 
##			  (now those haven't the permission to the update-command in mysql can install and use this mod)
##				
##			  ( if you upgrade please execute update_to_207.php and delete it after execution )
##
##		2002-02-19
##			- changed mod_table_inst.php and mod_table_uninst.php to allow installation even if errors occured
##			- adjusted code to fit the newest changes in posting.php (now only have to add 3 instead of 6 lines)
##			- added a "preview" of the attachment control panel (just new files, no changes to existing ones)
##
##		2002-02-13 - Version 2.0.6
##			- added FAQ (the faq [english, norwegian] is written by water, thank you very much)
##			- added norwegian translation (water)
##
##		2002-02-11
##			- converted max filesize to human readable format in configuration
##			- bugfixes in admin_attachments.php
##			- bugfix with upload-dirs beginning with /
##
##		2002-02-07
##			- seperated language variables (main, admin and faq)
##			- added topic icon for attachments
##
##		2002-02-04 - Version 2.0.5
##			- fixed bug with filenames
##			- filenames are no longer part of the stored file
##			- test another download-mechanism to present only the filename (need feedback on this)
##			  if someone experience problems in downloading files, please feel free to contact me
##
##		2002-02-03
##			- added "multiple attachments"-feature
##			- max number of attachments in one post definable
##			- comments are now editable (in posts only, edit comments in admin-panel will be added soon)
##
##		2002-02-01
##			- added file-comment to attachment-deletion in posts and admin-panel
##			- the attachments are viewable at deletion
##			- don't display attachment icon if it's empty
##			- some little/cosmetic changes
##
##		2002-01-31
##			- fixed bug with upload_image_path (thanks lional)
##			- added MSSQL-support (thank you very much Javier)
##
##		2002-01-26 - Version 2.0.4
##			- introduced viewtopic_attach_body.tpl
##			- View/Download of attachments now based on the permission to read posts
##			- some minor bugfixes
##
##		2002-01-23
##			- fixed bug with usernames (thanks SHS')
##			- removed menu in Admin->Attachments->Manage, display it in left frame
##			- templated the html-code for attachments in viewtopic
##				(i need a more detailed documentation of recursive template parsing 
##				 or the template class isn't as powerful as i thought)
##			- changed upload smilie code to image path
##
##		2002-01-22 - Version 2.0.3
##			- two typos in french translation (Lionel F. Lebeau)
##			- added move_uploaded_file as an second instance if copy fails
##
##		2002-01-21 - Version 2.0.2
##			- Admin Module finished
##			- Database changes can be undone (mod_table_uninst.php)
##			- added check of upload ability and safe mode at table installation
##			- put language changes for installation in extra files
##			- kicked 'array_'-functions, because they are not supported in php3
##			- some cleanups and bugfixes
##			- some changes to the download counter (especially security related things)
##
##		2002-01-20 - Version 2.0.1
##			- Download Counter
##
##		2002-01-19
##			- French translation (Lional F. Lebeau, thank you very much)
##
##		2002-01-14
##			- changed the install.txt a little bit
##			- default auth for attachments in forums now ADMIN
##
##		2002-01-12 - Version 2.0.0
##			- Initial Release only for testing, little admin-module (group and shadow not finished yet)
##
##
## Installation Level:  intermediate - Advanced
## Installation Time:   15-20 Minutes 
## Files To Edit:       13
##			[5 (main directory)]
##			[3 (Include Directory)]
##			[2 (Admin Directory)]
##			[3 (tpl)]
## Included Files:      16 (+5 temporary files - db-schemas and files for installation, uninstallation and update)
##			[1 (main directory)]
##			[2 (admin directory)]
##			[3 (for every language)]
##			[2 (tpl's for subSilver)]
##			[8 (tpl's for subSilver in admin)]
## 
#############################################################################
## 
## Installation Notes: 
## 
## This Mod will add 5 tables to your db.
##
## To make the table changes, either execute the mod_table_inst.php
## or make the table changes yourself. 
## (attach_*.sql in db/schemas)
##
#############################################################################
##
## NOTES:
##
## This Mod was tested with the following databases:
##	MySQL, MSSQL
##
## I have added PostgreSQL-Support, but i haven't tested it. It would be nice
## if you give Feedback on this.
##
## if someone can test it with any other dbms and willing to convert the 
## schema, please contact me.
##
#############################################################################

-> If you want to update from previous versions please read the documentation in docs/update.

#
# First of all, copy all files to their respective location
#

# For Uninstallation (this file will delete all of your Attachments):
#	/mod_table_uninst.php   (only for deleting the mod-tables)

# These are: 
#	/mod_table_inst.php	(you can delete it after installation)
#	/attachment_mod.php
#
#	/admin/admin_attachments.php
#	/admin/admin_attach_cp.php
#
#	/templates/subSilver/posting_attach_body.tpl
#	/templates/subSilver/viewtopic_attach_body.tpl
#
#	/templates/subSilver/admin/attach_cp_body.tpl
#	/templates/subSilver/admin/attach_cp_user.tpl
#	/templates/subSilver/admin/attach_cp_search.tpl
#	/templates/subSilver/admin/attach_cp_attachments.tpl
#	/templates/subSilver/admin/attach_extensions.tpl
#	/templates/subSilver/admin/attach_manage_body.tpl
#	/templates/subSilver/admin/attach_mimegroups.tpl
#	/templates/subSilver/admin/attach_mimetypes.tpl
#	/templates/subSilver/admin/attach_shadow.tpl
#
# for mysql:
#	/db/schemas/attach_mysql_schema.sql
#	/db/schemas/attach_mysql_basic.sql
#
# for mssql:
#	/db/schemas/attach_mssql_schema.sql
#	/db/schemas/attach_mssql_basic.sql
#
# for postgresql:
#	/db/schemas/attach_postgres_schema.sql
#	/db/schemas/attach_postgres_basic.sql
#
# Language Files (English and German are provided within this archive)
# If you want/have another language, please visit http://www.opentools.de/attach_mod/ , and download your
# Language (Languages there -> French, Norwegian, Dutch, Italian, Polish, Taiwan, Albanian):
#
# Now copy the language files to their respective position
#	/language/lang_*/lang_main_attach.php
#	/language/lang_*/lang_admin_attach.php
#	/language/lang_*/lang_faq_attach.php
#
# if you have an multi-national board you may want to upload these language files for all languages
#
 
Now we want to create the tables, therefore we execute mod_table_inst.php (http://www.yoursite.com/phpBB2/mod_table_inst.php)
If you see an error message, you don't want to install this mod. ;)
Contact me if you have questions.

Now you have to alter existing files, read the instructions carefully and make sure you find all lines.

#
# Changes to already existing files
#

#
# Root Directory
#

# 
#-----[ Open faq.php ]-------------------------------------------------------
# 

# 
#-----[ REPLACE ]---------- around line 60 -----------------------------------
# 
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);

# 
#-----[ WITH ]----------------------------------------------------------------
# 
language_include(str_replace("lang_", "", $lang_file));

# 
#-----[ Save and Close faq.php ]---------------------------------------------
# 

-----------------------------------------------------------------------------

# 
#-----[ Open modcp.php ]-----------------------------------------------------
# 

# 
#-----[ AFTER the last in the first include-group ]--------------------------
# 
include(...);

# 
#-----[ ADD ]----------------------------------------------------------------
# 
include($phpbb_root_path . 'attachment_mod.'.$phpEx);

# 
#-----[ BEFORE ]---------- around line 227 -----------------------------------
# 
			$sql = "SELECT vote_id 
				FROM " . VOTE_DESC_TABLE . " 

# 
#-----[ ADD ]----------------------------------------------------------------
# 
			$attachment_mod['modcp']->get_attachment_id_list($post_id_sql);

# 
#-----[ AFTER ]---------- around line 285 ----------------------------------
# 
				remove_search_post($post_id_sql);
			}

# 
#-----[ ADD ]----------------------------------------------------------------
# 

			$attachment_mod['modcp']->delete_attachments_from_posts($post_id_sql);


# 
#-----[ Save and Close modcp.php ]-------------------------------------------
# 

-----------------------------------------------------------------------------

# 
#-----[ Open posting.php ]---------------------------------------------------
# 

# 
#-----[ AFTER the last in the first include-group ]--------------------------
# 
include(...);

# 
#-----[ ADD ]----------------------------------------------------------------
# 
include($phpbb_root_path . 'attachment_mod.'.$phpEx);

# 
#-----[ AFTER ]---------- around line 397 -----------------------------------
# 
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );

# 
#-----[ ADD ]----------------------------------------------------------------
# 
$attachment_mod['posting']->posting_attachment_mod();

# 
#-----[ AFTER ]---------- around line 536 -----------------------------------
# 
				user_notification($mode, $post_data, $forum_id, $topic_id, $post_id, $notify_user);

# 
#-----[ ADD ]----------------------------------------------------------------
# 
				$attachment_mod['posting']->insert_attachment($post_id);

# 
#-----[ Save and Close posting.php ]----------------------------------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open viewforum.php ]-------------------------------------------------
# 

# 
#-----[ AFTER the last in the first include-group ]--------------------------
# 
include(...);

# 
#-----[ ADD ]----------------------------------------------------------------
# 
include($phpbb_root_path . 'attachment_mod.'.$phpEx);

# 
#-----[ AFTER ]---------- around line 373 -----------------------------------
# 
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . "<br />";

# 
#-----[ ADD ]----------------------------------------------------------------
# 
$s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . "<br />";

# 
#-----[ AFTER ]---------- around line 635 -----------------------------------
# 
			"NEWEST_POST_IMG" => $newest_post_img, 

# 
#-----[ ADD ]----------------------------------------------------------------
# 
			"HAS_ATTACHMENTS_IMG" => $attachment_mod['viewforum']->get_attachments_img($topic_id),

# 
#-----[ Save and Close viewforum.php ]--------------------------------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open viewtopic.php ]-------------------------------------------------
# 

# 
#-----[ AFTER the last in the first include-group ]--------------------------
# 
include(...);

# 
#-----[ ADD ]----------------------------------------------------------------
# 
include($phpbb_root_path . 'attachment_mod.'.$phpEx);

# 
#-----[ AFTER ]---------- around line 594 -----------------------------------
# 
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . "<br />";

# 
#-----[ ADD ]----------------------------------------------------------------
# 
$s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . "<br />";


# 
#-----[ BEFORE ]---------- around line 816 ----------------------------------
# 
//
// Update the topic view counter
//

# 
#-----[ ADD ]----------------------------------------------------------------
# 
$attachment_mod['viewtopic']->get_attach_info();


# 
#-----[ AFTER ]---------- around line 1171 ----------------------------------
# 
		"U_POST_ID" => $postrow[$i]['post_id'])
	);

# 
#-----[ ADD ]----------------------------------------------------------------
# 

	$attachment_mod['viewtopic']->display_attachments($postrow[$i]['post_id']);

# 
#-----[ Save and Close viewtopic.php ]--------------------------------------- 
# 

# 
# Includes Directory
# 

# 
#-----[ Open includes/auth.php ]---------------------------------------------
# 

# 
#-----[ AFTER ]---------- around line 63 ------------------------------------
# 
			$auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_sticky", "auth_announce", "auth_vote", "auth_pollcreate");

# 
#-----[ ADD ]----------------------------------------------------------------
# 
			$a_sql .= ', a.auth_attachments';
			$auth_fields[] = 'auth_attachments';

# 
#-----[ AFTER ]---------- around line 111 -----------------------------------
# 
		case AUTH_ATTACH:

# 
#-----[ ADD ]----------------------------------------------------------------
# 
			$a_sql = 'a.auth_attachments';
			$auth_fields = array('auth_attachments');

# 
#-----[ Save and Close includes/auth.php ]----------------------------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open includes/constants.php ]---------------------------------------- 
# 

# 
#-----[ AFTER ]--------------------------------------------------------------
# 
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');

# 
#-----[ ADD ]----------------------------------------------------------------
# 
define('ATTACH_CONFIG_TABLE', $table_prefix.'attach_config');
define('ATTACH_TYPES_TABLE', $table_prefix.'attach_types');
define('ATTACH_TYPECONFIG_TABLE', $table_prefix.'attach_typeconfig');
define('ATTACH_EXTENSIONS_TABLE', $table_prefix.'attach_extensions');
define('ATTACH_DESC_TABLE', $table_prefix.'attach_desc');

define('ATTACH_VERSION', '2.1.1');

# 
#-----[ Save and Close includes/constants.php ]------------------------------ 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open includes/functions.php ]----------------------------------------
# 

# 
#-----[ BEFORE ]---------- around line 180 ----------------------------------
# 
//
// Initialise user settings on page load

# 
#-----[ ADD ]----------------------------------------------------------------
# 
//
// Include language files
function language_include($category)
{
	global $phpbb_root_path, $board_config, $lang, $faq;

	$dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'];

	$dir = opendir($dirname);

	while($file = readdir($dir))
	{
		if( ereg("^lang_" . $category, $file) && is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) )
		{
			$incname = str_replace("lang_" . $category, "", $file);
			include($dirname . '/lang_' . $category . $incname);
		}
	}

	closedir($dir);
}

# 
#-----[ REPLACE ]---------- around line 241 ---------------------------------
# 
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);

# 
#-----[ WITH ]---------------------------------------------------------------
# 
	language_include('main');

# 
#-----[ REPLACE ]---------- around line 250 ---------------------------------
# 
		include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);

# 
#-----[ WITH ]----------------------------------------------------------------
# 
		language_include('admin');

# 
#-----[ Save and Close includes/functions.php ]------------------------------
# 

-----------------------------------------------------------------------------

#
# Admin Directory
#

# 
#-----[ Open admin/admin_forumauth.php ]------------------------------------- 
# 

# 
#-----[ AFTER ]---------- around line 71 ------------------------------------
# 
$forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN);

# 
#-----[ ADD ]---------------------------------------------------------------
# 

//
// Add Attachment Auth
//
//					Attachments
$simple_auth_ary[0][] = AUTH_MOD;
$simple_auth_ary[1][] = AUTH_MOD;
$simple_auth_ary[2][] = AUTH_MOD;
$simple_auth_ary[3][] = AUTH_MOD;
$simple_auth_ary[4][] = AUTH_MOD;
$simple_auth_ary[5][] = AUTH_MOD;
$simple_auth_ary[6][] = AUTH_MOD;

$forum_auth_fields[] = 'auth_attachments';
$field_names['auth_attachments'] = $lang['Attach'];

# 
#-----[ Save and Close admin/admin_forumauth.php ]--------------------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open admin/admin_ug_auth.php ]---------------------------------------
# 

# 
#-----[ BEFORE ]---------- around line 84 ------------------------------------
# 
// ---------------
// Start Functions

# 
#-----[ ADD ]----------------------------------------------------------------
# 
//
// Add Attachment Auth
//
$forum_auth_fields[] = 'auth_attachments';
$auth_field_match['auth_attachments'] = AUTH_ATTACH;
$field_names['auth_attachments'] = $lang['Attach'];

# 
#-----[ Save and Close admin/admin_ug_auth.php ]---------------------------
# 

#
# Template Directory
#
## Notes for posting_body.tpl:
##		If you want to edit your own template, please add
##		enctype="multipart/form-data"
##		to your form tag (which opens {S_POST_ACTION})
##
##		The Attachment will show up with {ATTACHBOX}, place it
##		in your template at your needs.
##
## Notes for viewtopic_body.tpl
##		You can implement the display of the attachments in posts in your template
##		with {postrow.ATTACHMENTS}.
##		the html-code for this is in viewtopic_attach_body.tpl.
##
## Notes for viewforum_body.tpl
##		The Attachment Image for Topics is {topicrow.HAS_ATTACHMENTS_IMG}.
##
## If you want a more specific explanation, please read the attach_mod_tpl_doc.html.
##

# 
#-----[ Open templates/subSilver/posting_body.tpl ]-------------------------- 
# 

# 
#-----[ REPLACE ]---------- around line 225 ---------------------------------
# 
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

# 
#-----[ WITH ]---------------------------------------------------------------
# 
<form action="{S_POST_ACTION}" method="post" name="post" onSubmit="return checkForm(this)" {S_FORM_ENCTYPE}> 

# 
#-----[ BEFORE ]---------- around line 434 ----------------------------------
# 
	{POLLBOX}

# 
#-----[ ADD ]----------------------------------------------------------------
# 
	{ATTACHBOX}

# 
#-----[ Save and Close templates/subSilver/posting_body.tpl ]---------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open templates/subSilver/viewforum_body.tpl ]------------------------ 
# 

# 
#-----[ Direct AFTER ]---------- around line 26 -----------------------------
# 
{topicrow.NEWEST_POST_IMG}

# 
#-----[ ADD (in the same line) ]---------------------------------------------
# 
{topicrow.HAS_ATTACHMENTS_IMG}

# 
#-----[ Save and Close templates/SubSilver/viewforum_body.tpl ]-------------- 
# 

-----------------------------------------------------------------------------

# 
#-----[ Open templates/subSilver/viewtopic_body.tpl ]------------------------ 
# 

# 
#-----[ Direct AFTER ]---------- around line 51 -----------------------------
# 
{postrow.MESSAGE}{postrow.SIGNATURE}</span>

# 
#-----[ ADD (in the same line) ]---------------------------------------------
# 
{postrow.ATTACHMENTS}

# 
#-----[ Save and Close templates/SubSilver/viewtopic_body.tpl ]-------------- 
# 

in this installation i have put two little icons (icon_disk.gif, icon_clip.gif) for attachments into. 
Put it to your images, or whereever you want.

The standard path for your files is 'files' and the standard upload image is images/icon_clip.gif.
If you want to change it, go to your Administration Panel under Attachments->Manage.

You'll have to create the upload path and chmod it to 777 (or change the owner to you httpd-servers owner) to upload files.
if you have only plain ftp-access change the 'Attribute' of your files-directory to rwxrwxrwx.

it would be wise that you put the provided index.html to this directory.
If you use Apache please also put the provided .htaccess - file to this directory.
