##############################################################
## MOD Title: Email Digests
## MOD Author: MarkDHamill < mhamill@computer.org > (Mark D. Hamill) http://www.potomactavern.org
## MOD Author, Secondary: Indemmity83 < Indemnity83@dormlife.us > (Kyle D. Klaus) http://www.dormlife.us
## MOD Author, Secondary: david63 < david.wood@pear-tree.org.uk > (David Wood) n/a
## MOD Description: Sends customized email digests of forum messages to subscribers
## MOD Version: 1.3.4
##
## Installation Level: Advanced
## Installation Time: 60 Minutes to several days, depending on whether you need to set up SSH and
##                    your skills at the server operating system command line.
##
## Files To Edit:	constants.php,
##			admin_db_utilities.php,
##			admin_forums.php,
##			admin_groups.php,
##			admin_user_ban.php,
##			admin_users.php,
##			login.php,
##			posting.php,
##			functions_post.php,
##			groupcp.php,
##			lang_main.php
##			usercp_register.php,
##			profile_add_body.tpl,
##			posting_body.tpl,
##			forum_edit_body.tpl,
##			group_edit_body.tpl,
##			groupcp_info_body.tpl 
##
## Included Files:	digests.php,
##			digests_common.php,
##			digests_user_cp.php,
##			install_digests.php,
##			mail_digests.php,
##			admin_digests_management.php,
##			admin_digests_add_users.php,
##			admin_digests_add_groups.php,
##			admin_digests_config.php,
##			admin_digests_confirm.php,
##			admin_digests_dump.php,
##			admin_digests_log.php,
##			admin_digests_mail.php,
##			admin_digests_verify.php,
##			digest_times.php,
##			functions_digests.php,
##			lang_digests.php,
##			mail_digests_confirm.tpl,
##			mail_digests_html.tpl,
##			mail_digests_text.tpl,
##			digests.tpl,
##			digests_management.tpl,
##			digests_config_body.tpl,
##			digests_confirm.tpl,
##			digests_dump.tpl,
##			digests_dump_body.tpl,
##			digests_log.tpl,
##			digests_mail.tpl,
##			digest_times.tpl,
##			digests_user_cp.tpl,
##			digests_verify.tpl,
##			digests_verify_body.tpl,
##			mail_digests.tpl,
##			digest_user_select_body.tpl,
##			icon_mini_digest.gif,
##			logo_digests.gif,
##			batch_scheduling.txt
##
############################################################################################################# 
## 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:
##
############################################################## 
## MOD History: 
## 
##   (Look at install_digests_132.txt for MOD History.)
##
## 
############################################################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#############################################################################################################
# 
#-----[ COPY ]------------------------------------------
#
copy digests.php to digests.php
copy digests_common.php to digests_common.php
copy digests_user_cp.php to digests_user_cp.php
copy install_digests.php to install_digests.php
copy admin/admin_digests_management.php to admin/admin_digests_management.php
copy admin/admin_digests_add_users.php to admin/admin_digests_add_users.php
copy admin/admin_digests_add_groups.php to admin/admin_digests_add_groups.php
copy admin/admin_digests_config.php to admin/admin_digests_config.php
copy admin/admin_digests_confirm.php to admin/admin_digests_confirm.php
copy admin/admin_digests_dump.php to admin/admin_digests_dump.php
copy admin/admin_digests_log.php to admin/admin_digests_log.php
copy admin/admin_digests_mail.php to admin/admin_digests_mail.php
copy admin/admin_digests_verify.php to admin/admin_digests_verify.php
copy admin/digest_times.php to admin/digest_times.php
copy admin/mail_digests.php to admin/mail_digests.php
copy includes/functions_digests.php to includes/functions_digests.php
copy language/lang_english/lang_digests.php to language/lang_english/lang_digests.php
copy language/lang_english/email/mail_digests_confirm.tpl to language/lang_english/email/mail_digests_confirm.tpl
copy language/lang_english/email/mail_digests_html.tpl to language/lang_english/email/mail_digests_html.tpl
copy language/lang_english/email/mail_digests_text.tpl to language/lang_english/email/mail_digests_text.tpl
copy templates/subSilver/digests.tpl to templates/subSilver/digests.tpl
copy templates/subSilver/digests_user_cp.tpl to templates/subSilver/digests_user_cp.tpl
copy templates/subSilver/admin/digests_management.tpl to templates/subSilver/admin/digests_management.tpl
copy templates/subSilver/admin/digests_config_body.tpl to templates/subSilver/admin/digests_config_body.tpl
copy templates/subSilver/admin/digests_confirm.tpl to templates/subSilver/admin/digests_confirm.tpl
copy templates/subSilver/admin/digests_dump.tpl to templates/subSilver/admin/digests_dump.tpl
copy templates/subSilver/admin/digests_dump_body.tpl to templates/subSilver/admin/digests_dump_body.tpl
copy templates/subSilver/admin/digests_log.tpl to templates/subSilver/admin/digests_log.tpl
copy templates/subSilver/admin/digests_mail.tpl to templates/subSilver/admin/digests_mail.tpl
copy templates/subSilver/admin/digest_times.tpl to templates/subSilver/admin/digest_times.tpl
copy templates/subSilver/admin/digests_verify.tpl to templates/subSilver/admin/digests_verify.tpl
copy templates/subSilver/admin/digests_verify_body.tpl to templates/subSilver/admin/digests_verify_body.tpl
copy templates/subSilver/admin/user_lookup_body.tpl to templates/subSilver/admin/user_lookup_body.tpl
copy templates/subSilver/admin/digest_user_select_body.tpl to templates/subSilver/admin/digest_user_select_body.tpl
copy templates/subSilver/admin/mail_digests.tpl to templates/subSilver/admin/mail_digests.tpl
copy templates/subSilver/images/icon_mini_digest.gif to templates/subSilver/images/icon_mini_digest.gif
copy templates/subSilver/images/logo_digests.gif to templates/subSilver/images/logo_digests.gif
#
#-----[ OPEN ]------------------------------------------
#
groupcp.php
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('confirm');

		include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
	}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
else if (isset($HTTP_POST_VARS['digest_confirm']) && $group_id)
{
	$sql = "UPDATE " . USER_GROUP_TABLE . " 
		SET digest_confirm_date = 0 
		WHERE user_id = ". $userdata['user_id'] . "
		AND group_id = $group_id";

	if (!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not update digest confirmation', '', __LINE__, __FILE__, $sql);
	}

	redirect(append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id"));
}
else if (isset($HTTP_POST_VARS['digest_options']) && $group_id)
{
		redirect(append_sid($phpbb_root_path . "digests.$phpEx?user_id=$group_id&mode=group&digest_type=1"));

}
#
#-----[ FIND ]------------------------------------------
#
if ( !($group_info = $db->sql_fetchrow($result)) )
	{
		message_die(GENERAL_MESSAGE, $lang['Group_not_exist']); 
	}
#
#-----[ AFTER, ADD ]------------------------------------------
#

	$group_digest = $group_info['group_digest'];
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, ug.user_pending
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ug.user_pending
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ug.digest_confirm_date
#
#-----[ FIND ]------------------------------------------
#
				$is_group_member = TRUE;
#
#-----[ AFTER, ADD ]------------------------------------------
#

				if ( $group_members[$i]['digest_confirm_date'] != 0 )
				{
					$confirm_outstanding = TRUE;
				}
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('switch_unsubscribe_group_input', array());
#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( $confirm_outstanding )
		{
			$template->assign_block_vars('digest_confirm_input', array());
		}
#
#-----[ FIND ]------------------------------------------
#
'L_UPDATE' => $lang['Update'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'L_GROUP_DIGEST' => $lang['Group_digest'],
		'L_DIGEST_OPTIONS' => $lang['Digest_options'],
		'L_DIGEST_CONFIRM' => $lang['Digest_confirm_title'],
#
#-----[ FIND ]------------------------------------------
#
if ( $is_moderator )
	{
		$template->assign_block_vars('switch_mod_option', array());
		$template->assign_block_vars('switch_add_member', array());
#
#-----[ AFTER, ADD ]------------------------------------------
#

		if ($group_digest == TRUE)
		{
			$template->assign_block_vars('switch_digest_option', array());
		}
#
#-----[ OPEN ]------------------------------------------
#
login.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'digests_common.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT user_id, username, user_password, user_active, user_level
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_level
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
,user_digest_status
#
#-----[ FIND ]------------------------------------------
#
if( $session_id )
					{
						$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
#
#-----[ AFTER, ADD ]------------------------------------------
#

						if ($row['user_digest_status'] > 0)
						{
							if (($row['user_digest_status'] == 1) || ($row['user_digest_status'] == 3))
							{
								$sql = "INSERT INTO " . USER_GROUP_TABLE . "
									(group_id, user_id, user_pending)
									VALUES (".$digest_config['auto_subscribe_group'].", ".$row['user_id'].", 0)";

								if (!($result = $db->sql_query($sql)))
								{
									message_die(GENERAL_ERROR, 'Could not insert data into user groups table', '', __LINE__, __FILE__, $sql);
								}
							}

							if (($row['user_digest_status'] == 2) || ($row['user_digest_status'] == 3))
							{
								$url = 'digests.php';
							}

							$sql = "UPDATE " . USERS_TABLE . "
								SET user_digest_status = '0'
								WHERE user_id = ".$row['user_id']."";

							$result = $db->sql_query($sql);
						}
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'digests_common.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );
#
#-----[ AFTER, ADD ]------------------------------------------
#
$urgent_post = ( !empty($HTTP_POST_VARS['urgent_post']) ) ? TRUE : 0;
#
#-----[ FIND ]------------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$attach_sig,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 $urgent_post,
#
#-----[ FIND ]------------------------------------------
#
if( $user_sig != '' )
{
	$template->assign_block_vars('switch_signature_checkbox', array());
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ($userdata['session_logged_in'] && $is_auth['auth_read']) 
{ 
	if (($mode != 'editpost') || (($mode == 'editpost') && ($post_info['poster_id'] != ANONYMOUS))) 
	{ 
		$urgent_run = get_urgent_run($userdata['user_id'], $forum_id, $digest_config['allow_urgent']);
		if ($urgent_run == TRUE)
		{
			$template->assign_block_vars('switch_urgent_checkbox', array());
		}
	} 
}

#
#-----[ FIND ]------------------------------------------
#
	'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_URGENT_POST' => $lang['Urgent_post'],
#
#-----[ FIND ]------------------------------------------
#
	'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', 
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'S_URGENT_CHECKED' => ( $urgent_post ) ? 'checked="checked"' : '',
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_db_utilities.php
#
#-----[ FIND ]------------------------------------------
#
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm'
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'confirm'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'digests', 'digests_config', 'digests_forums'
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]------------------------------------------
#
				$forumstatus = $row['forum_status'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
				$forum_digest = $row['forum_digest'];
#
#-----[ FIND ]------------------------------------------
#
				$forum_id = ''; 
				$prune_enabled = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#				
				$forum_digest = 1; 
#
#-----[ FIND ]------------------------------------------
#
				'L_FORUM_STATUS' => $lang['Forum_status'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
				'L_DIGEST' => $lang['Allow_forum_digest'],
#
#-----[ FIND ]------------------------------------------
#
				'L_DAYS' => $lang['Days'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],

				'FORUM_DIGEST_CHECKED_YES' => ($forum_digest == true) ? 'checked="checked"' : '',			
				'FORUM_DIGEST_CHECKED_NO' => ($forum_digest == false) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
#
#-----[ IN-LINE FIND ]------------------------------------------
#
forum_status,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 forum_digest,
#
#-----[ FIND ]------------------------------------------
#
			VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
intval($HTTP_POST_VARS['forumstatus']) . ",
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 " . intval($HTTP_POST_VARS['forum_digest']) . ",
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . FORUMS_TABLE . "
				SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ",
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 forum_digest = " . intval($HTTP_POST_VARS['forum_digest']) . ",
#
#-----[ FIND ]------------------------------------------
#
$sql = "DELETE FROM " . PRUNE_TABLE . "
				WHERE forum_id = $from_id";
			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't delete forum prune information!", "", __LINE__, __FILE__, $sql);
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#

			$sql = "DELETE FROM " . DIGEST_FORUMS_TABLE . "
				WHERE forum_id = $from_id";
			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't delete digest forum data", "", __LINE__, __FILE__, $sql);
			}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_groups.php
#
#-----[ FIND ]------------------------------------------
#
$group_info = array (
			'group_name' => '',
			'group_description' => '',
			'group_moderator' => '',
			'group_type' => GROUP_OPEN
#
#-----[ IN-LINE FIND ]------------------------------------------
#
GROUP_OPEN
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
,
			'group_digest' => 0
#
#-----[ FIND ]------------------------------------------
#
		'L_YES' => $lang['Yes'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'L_NO' => $lang['No'],
		'L_GROUP_DIGESTS' => $lang['Group_digests'],
		'L_GROUP_DIGESTS_EXPLAIN' => $lang['Group_digest_explain'],
#
#-----[ FIND ]------------------------------------------
#
		'S_GROUP_HIDDEN_CHECKED' => $group_hidden,
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'S_GROUP_DIGEST_YES' => ($group_info['group_digest']) ? 'checked="checked"' : '',
		'S_GROUP_DIGEST_NO' => (!$group_info['group_digest']) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#

		$group_moderator = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#
		$group_digest = isset($HTTP_POST_VARS['group_digest']) ? $HTTP_POST_VARS['group_digest'] : '';
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . GROUPS_TABLE . "
				SET group_type = $group_type, group_name = '" . str_replace("\'", "''", $group_name) . "', group_description = '" . str_replace("\'", "''", $group_description) . "', group_moderator = $group_moderator
#
#-----[ IN-LINE FIND ]------------------------------------------
#
group_moderator = $group_moderator
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, group_digest = $group_digest
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
group_single_user
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, group_digest
#
#-----[ FIND ]------------------------------------------
#
VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator,	'0'
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'0'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $group_digest
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_user_ban.php
#
#-----[ FIND ]------------------------------------------
#
require('./pagestart.' . $phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'digests_common.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
if ( !$in_banlist )
		{
			$kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . "session_user_id = " . $user_list[$i];

			$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid)
				VALUES (" . $user_list[$i] . ")";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't insert ban_userid info into database", "", __LINE__, __FILE__, $sql);
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			digest_ban($user_list[$i], 0);
#
#-----[ FIND ]------------------------------------------
#
if ( isset($HTTP_POST_VARS['unban_user']) )
	{
		$user_list = $HTTP_POST_VARS['unban_user'];

		for($i = 0; $i < count($user_list); $i++)
		{
			if ( $user_list[$i] != -1 )
			{
				$where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . intval($user_list[$i]);
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			digest_ban($user_list[$i], 1);
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
			$sql = "DELETE FROM " . BANLIST_TABLE . "
				WHERE ban_userid = $user_id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "DELETE FROM " . DIGEST_TABLE . "
				WHERE user_id = $user_id";
			if (!$db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, 'Could not delete user from digests table', '', __LINE__, __FILE__, $sql);
			}

			$sql = "DELETE FROM " . DIGEST_FORUMS_TABLE . "
				WHERE user_id = $user_id";
			if (!$db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, 'Could not delete user from digest forums table', '', __LINE__, __FILE__, $sql);
			}
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
define("BBCODE_UID_LEN", 10);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path . 'includes/functions_digests.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
function smilies_pass($message)
{
	static $orig, $repl;
#
#-----[ AFTER, ADD ]------------------------------------------
#
	$siteURL = get_site_url();
#
#-----[ FIND ]------------------------------------------
#
$repl[] = '<img src="'. $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$repl[] = '<img src="' . $siteURL . '/' . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />';
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
define('PAGE_TOPIC_OFFSET', 5000);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
define('PAGE_DIGEST', -2025);
#
#-----[ FIND ]------------------------------------------
#
// Digests MOD
define('SUBSCRIPTIONS_TABLE', $table_prefix.'mod_subscriptions');
define('SUBSCRIBED_FORUMS_TABLE', $table_prefix.'mod_subscribed_forums');

// Digest MOD Constants
define('WEEKLY_DIGEST_DAY', 0);   // Day of week to send weekly digest, use 0-6 where 0=Sunday, 6=Saturday etc.
define('OVERIDE_THEME', false); // set to true to overide both the board, and user defualt themes
define('DIGEST_THEME', 1); // If OVERIDE_THEME is true, this is the theme_id to use
define('DIGEST_SUPPORT', "http://www.phpbb.com/phpBB/viewtopic.php?t=187868");
// End Digests MOD
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Digests MOD
define('DIGEST_TABLE', $table_prefix.'digests');
define('DIGEST_FORUMS_TABLE', $table_prefix.'digests_forums');
define('DIGEST_CONFIG_TABLE', $table_prefix.'digests_config');
define('DIGEST_LOG_TABLE', $table_prefix.'digests_log');
#
#-----[ OPEN ]------------------------------------------
#
includes/emailer.php
#
#-----[ FIND ]------------------------------------------
#
function send()
#
#-----[ REPLACE WITH ]------------------------------------------
#
function send($is_html = '')
#
#-----[ FIND ]------------------------------------------
#
$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ($is_html)
		{
 			$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');
		}
		else 
		{
			$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');
		}
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
function init_userprefs($userdata)
{
	global $board_config, $theme, $images;
	global $template, $lang, $phpEx, $phpbb_root_path;
	global $nav_links;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function init_userprefs($userdata, $mode = '')
{
	global $board_config, $theme, $images;
	global $lang, $phpEx, $phpbb_root_path;
	global $nav_links;

	if ($mode != 'digest')
	{
		global $template;
	}
#
#-----[ FIND ]------------------------------------------
#
if ( $theme = setup_style($userdata['user_style']) )
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $theme = setup_style($userdata['user_style'], $mode) )
#
#-----[ FIND ]------------------------------------------
#
$theme = setup_style($board_config['default_style']);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$theme = setup_style($board_config['default_style'], $mode);
#
#-----[ FIND ]------------------------------------------
#
function setup_style($style)
{
	global $db, $board_config, $template, $images, $phpbb_root_path;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function setup_style($style, $mode = '')
{
	global $db, $board_config, $images, $phpbb_root_path;

	if ($mode != 'digest')
	{
		global $template;
	}
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)#
#
#-----[ IN-LINE FIND ]------------------------------------------
#
&$attach_sig,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 &$urgent_post,
#
#-----[ FIND ]------------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, urgent_post) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $urgent_post)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
#
#-----[ FIND ]------------------------------------------
#
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($urgent_post) 
    { 
		$sql = "UPDATE " . DIGEST_CONFIG_TABLE . "
			SET config_value = 1
			WHERE config_name = 'urgent_run_required'";

		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error updating digest config table', '', __LINE__, __FILE__, $sql);
		}
		  
        $message = $lang['Urgent_stored'] . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
   }    
   else 
   { 
#
#-----[ FIND ]------------------------------------------
#
$message = $lang['Stored'] . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
#
#-----[ AFTER, ADD ]------------------------------------------
#
}
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
//
// Check and initialize some variables if needed
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'digests_common.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
	if ( $mode == 'register' )
	{
		$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];

		$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $board_config['allow_html'];
		$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $board_config['allow_bbcode'];
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$digest_auto = (isset($HTTP_POST_VARS['digest_auto'])) ? (($HTTP_POST_VARS['digest_auto']) ? 1 : 0) : $digest_config['auto_subscribe'];
		$digest_new = (isset($HTTP_POST_VARS['digest_new'])) ? (($HTTP_POST_VARS['digest_new']) ? 2 : 0) :  $digest_config['new_sign_up'];
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_allow_pm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_digest_status
#
#-----[ FIND ]------------------------------------------
#
 $user_lang) . "', $user_style, 0, 1
#
#-----[ IN-LINE FIND ]------------------------------------------
#
 1
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, ".($digest_auto + $digest_new)." 
#
#-----[ FIND ]------------------------------------------
#
	if ( $mode == 'editprofile' )
	{
		$template->assign_block_vars('switch_edit_profile', array());
	}
#
#-----[ AFTER, ADD ]------------------------------------------
#
	
	if ($mode == 'register')
	{
		if ($digest_config['auto_subscribe'] == 1)
		{
			$template->assign_block_vars('switch_auto_subscribe_digest', array());
		}

		if ($digest_config['new_sign_up'] == 1)
		{
			$template->assign_block_vars('switch_new_sign_up', array());
		}
	}
#
#-----[ FIND ]------------------------------------------
#
'SMILIES_STATUS' => $smilies_status,
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'DIGEST_AUTO_YES' => ( $digest_auto ) ? 'checked="checked"' : '',
		'DIGEST_AUTO_NO' => ( !$digest_auto ) ? 'checked="checked"' : '',
		'DIGEST_NEW_YES' => ( $digest_new ) ? 'checked="checked"' : '',
		'DIGEST_NEW_NO' => ( !$digest_new ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'L_DIGEST_AUTO' => sprintf($lang['Digest_user_auto'], get_group_name($digest_config['auto_subscribe_group'])),
		'L_DIGEST_NEW' => $lang['Digest_user_new'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_faq.php
#
#-----[ FIND ]------------------------------------------
#
$faq[] = array("--","Digests");
$faq[] = array("What are Digests?", "Digests are email messages sent to you periodically with a summary of the postings made here.");
$faq[] = array("Why would I want a digest?", "It makes your life easier. You do not have to explicitly visit this site to see what conversations are going on around here. Just read your digest and if there is a topic that seems of interest, click on it in your email program and start participating! Unsubscribe at any time.");
$faq[] = array("How often are digests sent?", "You pick how often they are sent. You can select the frequency between digests when you set them up. So if its a busy forum, and you always want to be on top setup the digest to be sent every hour. If its a slow forum, and you just want to keep a lazy eye, use something like daily or weekly.");
$faq[] = array("Suppose I do not want summaries of every message here. Can I be selective?", "Yes. You can pick the forum or forums that interest you. By default you will get messages for all forums that you are allowed to access.");
$faq[] = array("Can I have more than one digest?", "Yes, you can have several digests, each with their own frequency - but a forum can only be in one digest. For example you can Forum A & Forum D every hour, you can have Forum G daily, you can have Forum C weekly and you can have Forum B, Forum E & Forum F monthly. This way you will only be notified of postings once.");
$faq[] = array("What email message formats are available?", "We can send you HTML or text. Unless your email program cannot handle HTML (very unusual these days) we suggest HTML. Frankly, text digests look pretty plain and are harder to use. That is the nature of plain text.");
$faq[] = array("Do I get the whole message text in the digest?", "By default you get the first 150 characters of the text, or you can elect to see either all of the message text or just see the topic subject instead. We recommend keeping the default message length because otherwise your digests may get so big as to be unusable. We have also heard that very large digests may be rejected by your ISP or put you over your server storage quota. An excerpt reduces bandwidth and is usually all that is needed. Why? Because each message has a convenient link that will take you to the topic or message of interest.");
$faq[] = array("How do I get started?", "Just click on the Digests link near the top right part of any page. Or if you prefer <a href=\"./digests.php\">click here</a>.");
$faq[] = array("Can I unsubscribe?", "Of course! Just go to the same page and check the  \"Delete this digest\" box. Then submit the form. Your subscription, to that digest, will end immediately.");
$faq[] = array("Are digests commercial free?", "Of course. There are no annoying ads nor will there ever be any on our site.");
$faq[] = array("Is my privacy protected?", "Yes, your digest is sent to you at the email address you gave us in your profile. Think of the digest as a special edition newspaper customized just for you. Someone else is likely getting a completely different digest."); 
#
#-----[ REPLACE WITH ]------------------------------------------
#
$faq[] = array("--","Digests");
$faq[] = array("What are Digests?", "Digests are email messages sent to you periodically with a summary of the postings made here.");
$faq[] = array("Why would I want a digest?", "It makes your life easier. You do not have to explicitly visit this site to see what conversations are going on around here. Just read your digest and if there is a topic that seems of interest, click on it in your email program and start participating! Unsubscribe at any time.");
$faq[] = array("How often are digests sent?", "You pick how often they are sent. You can select the frequency between digests when you set them up. So if its a busy forum, and you always want to be on top setup the digest to be sent every hour. If its a slow forum, and you just want to keep a lazy eye, use something like daily or weekly.");
$faq[] = array("Suppose I do not want summaries of every message here. Can I be selective?", "Yes. You can pick the forum or forums that interest you. By default you will get messages for all forums that you are allowed to access.");
$faq[] = array("Can I have more than one digest?", "Yes, you can have several digests, each with their own frequency - but a forum can only be in one digest. For example you can Forum A & Forum D every hour, you can have Forum G daily, you can have Forum C weekly and you can have Forum B, Forum E & Forum F monthly. This way you will only be notified of postings once.");
$faq[] = array("What email message formats are available?", "We can send you HTML or text. Unless your email program cannot handle HTML (very unusual these days) we suggest HTML. Frankly, text digests look pretty plain and are harder to use. That is the nature of plain text.");
$faq[] = array("Do I get the whole message text in the digest?", "By default you get the first 150 characters of the text, or you can elect not to see any of the message text and just see the topic subject instead. You can select message excerpts including the first 50, 100, 150, 300 or 600 characters, or the full text of the message (up to 32,000 characters). Anything beyond the limit you set will be truncated. We recommend keeping the default message length because otherwise your digests may get so big as to be unusable. We have also heard that very large digests may be rejected by your ISP or put you over your server storage quota. An excerpt reduces bandwidth and is usually all that is needed. Why? Because each message has a convenient link that will take you to the topic or message of interest.");
$faq[] = array("How do I get started?", "Just click on the Digests link near the top right part of any page. Or if you prefer <a href=\"./digests.php\">click here</a>.");
$faq[] = array("Can I unsubscribe?", "Of course! Just go to the same page and check the  \"Delete this digest\" box. Then submit the form. Your subscription, to that digest, will end immediately.");
$faq[] = array("Are digests commercial free?", "Of course. There are no annoying ads nor will there ever be any on our site.");
$faq[] = array("Is my privacy protected?", "Yes, your digest is sent to you at the email address you gave us in your profile. Think of the digest as a special edition newspaper customized just for you. Someone else is likely getting a completely different digest."); 
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// Digests MOD
//
// This block is for general lang definitions
$lang['Digests'] = 'Digests';
$lang['digest_options'] = 'Digest Options';
$lang['digest_format'] = 'Format';
$lang['digest_show_message_text'] = 'Show Message Text';
$lang['digest_show_my_messages'] = 'Show My Messages';
$lang['digest_frequency'] = 'Digest Frequency';
$lang['digest_send'] = 'Time of day to send digest';
$lang['digest_new_only'] = 'Show only new messages since last time I logged in';
$lang['digest_send_empty'] = 'Send empty digests';
$lang['digest_message_size'] = 'Maximum characters per message in digest';

// This block is for lang specific to mail_digests.php
$lang['digest_introduction'] = "As you requested, here is the latest digest of messages posted on %s forums. Please come and join the discussion!";
$lang['digest_disclaimer_html'] = "This digest is being sent to registered members of %s forums and only because you explicitly requested it. %s is completely commercial free. Your email address is never disclosed to outside parties. See our %sFAQ%s for more information on our privacy policies. You can change or delete your subscription by logging into %s from the %sDigest Page%s. (You must be logged in to change your digest settings.) If you have questions or feedback on the format of this digest please send it to the %sWebmaster%s.";
$lang['digest_disclaimer_text'] = "This digest is being sent to registered members of %s forums and only because you explicitly requested it. %s is completely commercial free. Your email address is never disclosed to outside parties. See our FAQ for more information on our privacy policies. You can change or delete your subscription by logging into %s from the Digest Page. (You must be logged in to change your digest settings.) If you have questions or feedback on the format of this digest please send it to the Webmaster.";
$lang['digest_salutation'] = 'Dear';

// This block is for lang specific to digests.php
$lang['digest_explanation'] = "Digests are email summaries of messages posted here that are sent to you periodically. Digests can be sent daily or weekly at an hour of the day you select. You can specify those particular forums for which you want message summaries, or you can elect to receive all messages for all forums for which you are allowed access.<br /><br />\r\nConsisent with our privacy policy digests contain no \"spam\", nor is your email address used in any way connected to an advertisement. You can, of course, cancel your digest subscription at any time by simply coming back to this page. Most users find digests to be very useful. We encourage you to give it a try!";
$lang['digest_none'] = 'None (Unsubscribe)';
$lang['digest_daily'] = 'Daily';
$lang['digest_weekly'] = 'Weekly';
$lang['digest_html'] = 'HTML';
$lang['digest_text'] = 'Text';
$lang['digest_format_desc'] = 'HTML is highly recommended unless your email program cannot display HTML';
$lang['digest_new_only_desc'] = 'This will filter out any messages posted prior to the date and time you last visited that would otherwise be included in the digest.';
$lang['digest_send_desc'] = 'This is the time based on the time zone you set in your profile. If you change your profile time zone and you want digests to arrive at the same time of day then change this value too.';
$lang['digest_size_desc'] = 'Caution: setting this too high may make for very long digests. A link is provided for each message that will let you see the full content of the message.';
$lang['digest_midnight']='Midnight';
$lang['digest_1am']='1 AM';
$lang['digest_2am']='2 AM';
$lang['digest_3am']='3 AM';
$lang['digest_4am']='4 AM';
$lang['digest_5am']='5 AM';
$lang['digest_6am']='6 AM';
$lang['digest_7am']='7 AM';
$lang['digest_8am']='8 AM';
$lang['digest_9am']='9 AM';
$lang['digest_10am']='10 AM';
$lang['digest_11am']='11 AM';
$lang['digest_12pm']='12 PM';
$lang['digest_1pm']='1 PM';
$lang['digest_2pm']='2 PM';
$lang['digest_3pm']='3 PM';
$lang['digest_4pm']='4 PM';
$lang['digest_5pm']='5 PM';
$lang['digest_6pm']='6 PM';
$lang['digest_7pm']='7 PM';
$lang['digest_8pm']='8 PM';
$lang['digest_9pm']='9 PM';
$lang['digest_10pm']='10 PM';
$lang['digest_11pm']='11 PM';
$lang['digest_select_forums']='Send digests for these forums';
$lang['digest_create']='Your digest settings were successfully created';
$lang['digest_modify']='Your digest settings were successfully updated';
$lang['digest_unsubscribe']='You have been unsubscribed and will no longer receive a digest';
$lang['digest_no_forums_selected']='You have not selected any forums, so you will be unsubscribed';
$lang['digest_all_forums']='All Subscribed Forums';
$lang['digest_submit_text']='Make Digest Changes';
$lang['size_50']='50';
$lang['size_100']='100';
$lang['size_150']='150';
$lang['size_300']='300';
$lang['size_600']='600';
$lang['size_max']='Maximum (32000)';
//
// End Digests MOD
//
#
#-----[ REPLACE WITH ]------------------------------------------
#

//
// Digest Mod
//
$lang['Digests'] = 'Email Digests';
$lang['Digest_options'] = 'Digest Options';
$lang['Digest_confirm_title'] = 'Confirm Digest Subscription';
$lang['Digest_user_auto'] = 'Upon successful registration automatically subscribe me into the %s digest group';
$lang['Digest_user_new'] = 'Upon successful registration let me select my digest options';
$lang['Group_digests'] = 'Allow group digests';
$lang['Group_digest_explain'] = 'Set to Yes if you want the group moderator to be able to setup a digest for the members of this group. If set to No then the moderator will not be able to configure a digest.';
$lang['Group_digest'] = 'Group digest';
$lang['Urgent_post'] = 'Check this box if this is an URGENT message (to initiate an immediate Digest mailing). Do NOT abuse this feature.  It could take 30 seconds or more for the confirmation page to appear!  Do not click the SUBMIT button more than once!'; 
$lang['Urgent_stored'] = 'Your Urgent message has been entered successfully and the Urgent Digests will be sent out shortly.'; 
$lang['Allow_forum_digest'] = 'Allow digests for this forum';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/groupcp_info_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_unsubscribe_group_input -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN digest_confirm_input -->
		<input class="mainoption" type="submit" name="digest_confirm" value="{L_DIGEST_CONFIRM}" />
		<!-- END digest_confirm_input -->
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_mod_option -->
#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN switch_digest_option -->
	<tr>
		<td class="row1" width="20%"><span class="gen">{L_GROUP_DIGEST}:</span></td>
		<td class="row2"><span class="gen"><input class="mainoption" type="submit" name="digest_options" value="{L_DIGEST_OPTIONS}" /></span></td>
	</tr>
	<!-- END switch_digest_option -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN switch_notify_checkbox -->
		  <tr> 
			<td> 
			  <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
			</td>
			<td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
		  </tr>
		  <!-- END switch_notify_checkbox -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_urgent_checkbox --> 
		 <tr> 
			<td> 
				<input type="checkbox" name="urgent_post" {S_URGENT_CHECKED}/> 
			</td> 
			<td><span class="gen">{L_URGENT_POST}</span></td> 
		 </tr> 
		  <!-- END switch_urgent_checkbox --> 
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"> 
	<input type="radio" name="allowsmilies" value="1" {ALWAYS_ALLOW_SMILIES_YES} />
	<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
	<input type="radio" name="allowsmilies" value="0" {ALWAYS_ALLOW_SMILIES_NO} />
	<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
	
	<!-- BEGIN switch_auto_subscribe_digest -->
	<tr> 
	  <td class="row1"><span class="gen">{L_DIGEST_AUTO}:</span></td>
	  <td class="row2">
		<input type="radio" name="digest_auto" value="1" {DIGEST_AUTO_YES} /><span class="gen">&nbsp;{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="digest_auto" value="0" {DIGEST_AUTO_NO} /><span class="gen">&nbsp;{L_NO}</span></td>
	</tr>
	<!-- END switch_auto_subscribe_digest -->
	
	<!-- BEGIN switch_new_sign_up -->
	<tr> 
	  <td class="row1"><span class="gen">{L_DIGEST_NEW}:</span></td>
	  <td class="row2">
		<input type="radio" name="digest_new" value="2" {DIGEST_NEW_YES} /><span class="gen">&nbsp;{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="digest_new" value="0" {DIGEST_NEW_NO} /><span class="gen">&nbsp;{L_NO}</span></td>
	</tr>
	<!-- END switch_new_sign_up -->

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/forum_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1">{L_FORUM_STATUS}</td>
	  <td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr> 
      		<td class="row1">{L_DIGEST}</td> 
      		<td valign="top" class="row2"><input type="radio" name="forum_digest" value="1" {FORUM_DIGEST_CHECKED_YES} />{L_YES}&nbsp;&nbsp;<input type="radio" name="forum_digest" value="0" {FORUM_DIGEST_CHECKED_NO} />{L_NO}</td> 
   	</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/group_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="row2" width="62%"> 
		<input type="radio" name="group_type" value="{S_GROUP_OPEN_TYPE}" {S_GROUP_OPEN_CHECKED} /> {L_GROUP_OPEN} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_CLOSED_TYPE}" {S_GROUP_CLOSED_CHECKED} />	{L_GROUP_CLOSED} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_HIDDEN_TYPE}" {S_GROUP_HIDDEN_CHECKED} />	{L_GROUP_HIDDEN}</td> 
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#

<tr>
		 <td class="row1" width="38%"><span class="gen">{L_GROUP_DIGESTS}:</span><br /><span class="gensmall">{L_GROUP_DIGESTS_EXPLAIN}</span></td>
		 <td class="row2" width="62%"><input type="radio" name="group_digest" value="0" {S_GROUP_DIGEST_NO} />{L_NO}&nbsp;&nbsp;<input type="radio" name="group_digest" value="1" {S_GROUP_DIGEST_YES} />{L_YES}</td>
	</tr>

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


#
# Now run install_digests.php
#


# EoM 