<?php

///////////////////////////////////////////////////////////////////////////////////////////////////////
// BotBanish 7.1.06
// Randem Systems: https://randemsystems.support
// BotBanish Black and White Country List Templates for SMF
// Date: 04/18/2026
// Usage: 
//
// Function: Shows Black / White Country Lists
///////////////////////////////////////////////////////////////////////////////////////////////////////

function template_search_blackwhitelist() {
	
	global $context, $settings, $options, $scripturl, $BotBanishText, $BotBanishSettings;

	$type = stripos($_REQUEST['area'], 'whitelist') === false ? 'blacklist' : 'whitelist';
	$rtn = 'searchdata' . $type . 'country';
	
	echo $BotBanishSettings['BOTBANISH_HEADER_HTML'];

	echo '
	<div id="admincenter">
		<form action="', $scripturl, '?action=botbanish;area=' . $rtn . '" method="post" accept-charset="', $context['character_set'], '">
			<div class="cat_bar">
				<h3 class="catbg">
					<span class="floatleft">', $BotBanishText['search_for'] . ' ' . $context['BotBanishBlackWhiteListType'], '</span>
					<span class="smalltext floatright">', $BotBanishText['wild_cards_allowed'], '</span>
				</h3>
			</div>
			<input type="hidden" name="sa" value="query" />
			<div class="windowbg">
				<span class="topslice"><span></span></span>
				<div class="content">
					<div class="flow_hidden">
						<div class="msearch_details">
							<dl class="settings right">
								<dt class="righttext">
									<strong>', $BotBanishText['Country'], ':</strong>
									<select name="types[country]">
										<option value="--">&lt;</option>
										<option value="-">&lt;=</option>
										<option value="=" selected="selected">=</option>
										<option value="+">&gt;=</option>
										<option value="++">&gt;</option>
									</select>
								</dt>
								<dd>
									<input type="text" name="country" value="" size="50"" class="input_text" />
								</dd>
								<dt class="righttext">
									<strong>', $BotBanishText['countrycode'], ':</strong>
									<select name="types[countrycode]">
										<option value="--">&lt;</option>
										<option value="-">&lt;=</option>
										<option value="=" selected="selected">=</option>
										<option value="+">&gt;=</option>
										<option value="++">&gt;</option>
									</select>
								</dt>
								<dd>
									<input type="text" name="countrycode" value="" size="3" class="input_text" />
								</dd>
								<dt class="righttext">
									<strong>', $BotBanishText['active'], ':</strong>
									<select name="types[active]">
										<option value="--">&lt;</option>
										<option value="-">&lt;=</option>
										<option value="=" selected="selected">=</option>
										<option value="+">&gt;=</option>
										<option value="++">&gt;</option>
									</select>
								</dt>
								<dd>
									<input type="text" name="active" value="" size="1" class="input_text" />
								</dd>
							</dl>
						</div>
					</div>
				</div>
				<span class="botslice clear_right"><span></span></span>
			</div>
			<br />
			</div><br />
			<div class="righttext">
				<input type="submit" value="', $BotBanishText['blackwhitelist_search'] . ' ' . $context['BotBanishBlackWhiteListType'], '" class="button_submit" />
			</div>
		</form>
	</div>
	<br class="clear" />';
}

function template_add_blackwhitelist()
{
	global $context, $settings, $options, $scripturl, $BotBanishText, $BotBanishSettings;

	$type = stripos($_REQUEST['area'], 'whitelist') === false ? 'blacklist' : 'whitelist';
	$rtn = 'adddata' . $type . 'country';
	
	echo $BotBanishSettings['BOTBANISH_HEADER_HTML'];

	echo '
	<div id="admincenter">
		<form action="', $scripturl, '?action=botbanish;area=' . $rtn . '" method="post" accept-charset="', $context['character_set'], '">
			<div class="cat_bar">
				<h3 class="catbg">
					<span class="floatleft">', $BotBanishText['blackwhitelist_add'] . ' ' . $context['BotBanishBlackWhiteListType'], '</span>
					<span class="smalltext floatright">', $BotBanishText['wild_cards_not_allowed'], '</span>
				</h3>
			</div>
			<input type="hidden" name="sa" value="add" />
			<div class="windowbg">
				<span class="topslice"><span></span></span>
				<div class="content">
					<div class="flow_hidden">
						<div class="msearch_details">
							<dl class="settings right">
								<dt class="righttext">
									<strong>', $BotBanishText['countrycode'], ':</strong>
								</dt>
								<dd>
									<input type="text" name="countrycode" value="" size="3" class="input_text" />
								</dd>
								<dt class="righttext">
									<strong>', $BotBanishText['Country'], ':</strong>
								</dt>
								<dd>
									<input type="text" name="country" value="" size="50" class="input_text" />
								</dd>
							</dl>
						</div>
					</div>
				</div>
				<span class="botslice clear_right"><span></span></span>
			</div>
			<br />
			</div><br />
			<div class="righttext">
				<input type="submit" value="', $BotBanishText['blackwhitelist_add'] . ' ' . $context['BotBanishBlackWhiteListType'], '" class="button_submit" />
			</div>
		</form>
	</div>
	<br class="clear" />';
}
?>