<?php

///////////////////////////////////////////////////////////////////////////////////////////////////////
// BotBanish 7.1.00
// Randem Systems: https://randemsystems.support
// BotBanish Black and White List Domain Templates for SMF
// Date: 01/25/2026
// Usage: 
//
// Function: Shows Black / White Domain Lists
///////////////////////////////////////////////////////////////////////////////////////////////////////

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

	$type = stripos($_REQUEST['area'], 'whitelist') === false ? 'blacklist' : 'whitelist';
	$rtn = 'searchdata' . $type . 'domain';
	
	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['id_domain'], ':</strong>
									<select name="types[domainid]">
										<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="domainid" value="" size="10" class="input_text" />
								</dd>
								<dt class="righttext">
									<strong>', $BotBanishText['domain'], ':</strong>
									<select name="types[domainname]">
										<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="domainname" value="" size="30" 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 . 'domain';
	
	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['domain'], ':</strong>
								</dt>
								<dd>
									<input type="text" name="domainname" value="" size="30" 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" />';
}
?>