##############################################################
## MOD Title: Anti-bot Guest Post Mod
## MOD Author: otseng < N/A > (Oliver Tseng) http://debatingchristianity.com
## MOD Description: This MOD makes it a little bit harder 
##                  for a robot to make an anonymous posting.  
##                  It will ask to select a dropdown to confirm
##                  an anonymous post.
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: <5 Minutes
## Files To Edit:
##               posting.php
##               templates/subSilver/posting_body.tpl
##               language/lang_english/lang_main.php
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes:
##
##   The MOD will install using EasyMOD
##
##   MOD dev thread:
##   http://www.phpbb.com/phpBB/viewtopic.php?t=264103
##
##   This MOD was in response to the following topic:
##   http://www.phpbb.com/phpBB/viewtopic.php?t=263469
##					
##   Demo is available at:
##   http://debatingchristianity.com/forum/viewtopic.php?t=1300
##
##############################################################
## MOD History:
##
##   2005-02-17 - Version 0.0.1
##  	- Beta release
##
##   2006-01-20 - Version 1.0.0
##  	- General release
##
##   2006-01-25 - Version 1.0.1
##  	- Replaced hard coded values
##
##   2007-02-13 - Version 1.0.1.rus
##  	- Translating in Russian
##
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
#			$poll_options = ( isset($HTTP_POST_VARS['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_option_text'] : '';
#			$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';
$bbcode_uid = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
			// Anti-bot Guest Post Mod
			$confirm_guest_post = ( !empty($HTTP_POST_VARS['confirm_guest_post']) ) ? $HTTP_POST_VARS['confirm_guest_post'] : '';

#
#-----[ FIND ]------------------------------------------
#
#			prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
prepare_post($mode, $post_data, 
#
#-----[ AFTER, ADD ]------------------------------------------
#

			// Anti-bot Guest Post Mod
			if( !$userdata['session_logged_in'])
			{
				if ($confirm_guest_post != "1")
				{
					$error_msg = $lang['Confirm_post_error']; 
				}
			}
			
#
#-----[ FIND ]------------------------------------------
#
if( !$userdata['session_logged_in'] || ( $mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS ) )
{
	$template->assign_block_vars('switch_username_select', array());
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Anti-bot Guest Post Mod
if( !$userdata['session_logged_in'])
{
	$template->assign_block_vars('switch_antibot_post', array());
}
#
#-----[ FIND ]------------------------------------------
#
	'SMILIES_STATUS' => $smilies_status, 
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_CONFIRM_POST' => $lang['Confirm_post'],
	'L_CONFIRM_POST_EXPLAIN' => $lang['Confirm_post_explain'],
	'L_YES' => $lang['Yes'],
	'L_NO' => $lang['No'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
	  <td class="row2" width="78%"> <span class="gen"> 
		<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
		</span> </td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
	<!-- BEGIN switch_antibot_post -->
	<tr> 
		<td class="row1"><span class="gen"><b>{L_CONFIRM_POST}</b></span></td>
		<td class="row2"><span class="genmed">
		<select name="confirm_guest_post" size="1">
		    <option value="0">{L_NO}</option>
		    <option value="1">{L_YES}</option>
  		</select>
		{L_CONFIRM_POST_EXPLAIN}</span></td>
	</tr>
	<!-- END switch_antibot_post -->
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti-bot Guest Post Mod
$lang['Confirm_post'] = 'Submit post?';
$lang['Confirm_post_explain'] = 'Please select "Yes" to submit your guest post';
$lang['Confirm_post_error'] = 'Please select "Yes" in "Submit post?" to submit your guest post';
#
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_russian/lang_main.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
// 
// That's all, Folks! 
// ------------------------------------------------- 
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
// Anti-bot Guest Post Mod $lang['Confirm_post'] = '  ?'; 
$lang['Confirm_post_explain'] = ',  "",    .'; 
$lang['Confirm_post_error'] = ' . ,  "",    .'; 
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM