##############################################################
## MOD Title: Mail2Forum
## MOD Author: Pda0 < N/A > (M2F Team) http://www.mail2forum.com
## MOD Description: This MOD will allow you to bridge mailing lists with phpBB.
## MOD Version: See m2f_common.php
##
## Installation Level: Advanced
## Installation Time: 15 Minutes
## Files To Edit: includes/functions_post.php, includes/page_header.php, common.php, templates/subSilver/overall_header.tpl
## Included Files: (a lot)
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## Read readme.txt in the "docs" directory for more information about Mail2Forum
## Read install.txt in the "docs" directory for installation instructions
## Read changelog.txt in the "docs" directory for a complete list of changes
##
############################################################## 
## MOD History: See docs/changelog.txt
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ COPY ]------------------------------------------
#
# 1. Copy M2F to <phpBB_dir>/m2f
# 2. Copy M2F's additional scripts and templates to <phpBB_dir>
# 3. Install the M2F config file
#

copy *.*                               to m2f/
copy root/*.*                          to /
copy m2f_config.php.dist               to m2f/m2f_config.php


#
# Alterations to phpBB follow:
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
	return false;
}

//
// Update post stats and details
//
function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id)

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// Begin M2F ----------------------------------------------
	if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
	{
		global $m2f_handler;
		
		// Build post
		$m2f_forum_post 								= new m2f_forum_post();
		$m2f_forum_post->body 					= $post_message;
		$m2f_forum_post->title 					= $post_subject;
		$m2f_forum_post->forum_id 			= $forum_id;
		$m2f_forum_post->topic_id 			= $topic_id;
		$m2f_forum_post->post_id 				= $post_id;
		$m2f_forum_post->user_data 			= $userdata;
		$m2f_forum_post->mode 					= $mode;
		$m2f_forum_post->enable_sig 		= $attach_sig; 
		$m2f_forum_post->bbcode_uid 		= $bbcode_uid; 
		$m2f_forum_post->enable_smilies = $smilies_on; 
		$m2f_forum_post->enable_html 		= $html_on; 
		$m2f_forum_post->post_username 	= $post_username; 
		
		$m2f_forum_post->msg_attachments->get_post_attachments();
		$m2f_handler->new_post_event($m2f_forum_post);
	}
	// End   M2F ----------------------------------------------
	
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
#  
	'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_SUBSCRIPTIONS' => 'Forum Subscriptions', 

# 
#-----[ FIND ]------------------------------------------ 
#  
	'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'U_SUBSCRIPTIONS' => append_sid('m2f_usercp.'.$phpEx),

# 
#-----[ OPEN ]------------------------------------------ 
# 
common.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/db.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Begin M2F ---------------------------------------------- 
if(isset($ModName))  
{  
  $phpbb_root_path = './modules/' . $ModName . '/';  
}  

define('M2F_ROOT_PATH', $phpbb_root_path.'m2f/');
require_once(M2F_ROOT_PATH. 'm2f_phpbb204.php');  
// End M2F ---------------------------------------------- 

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
#  
<a name="top"></a>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

<IFRAME SRC="m2f/m2f_import_msgs.php?m2f_cron_check=1" TITLE="M2F Simple Cron check" WIDTH="1" HEIGHT="1" FRAMEBORDER="0" SCROLLING="NO">
<!-- Alternate content for non-supporting browsers -->
</IFRAME>

# 
#-----[ FIND ]------------------------------------------ 
#  
<td align="center" valign="top" nowrap="nowrap">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#  
<span class="mainmenu">&nbsp;

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#  
<a href="{U_SUBSCRIPTIONS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_subscription.gif" width="12" height="13" border="0" alt="{L_SUBSCRIPTIONS}" hspace="3" />{L_SUBSCRIPTIONS}</a>&nbsp; &nbsp;

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