<?php 
//Security Check
if(count(get_included_files()) ==1) exit("No direct script access allowed.");
$config["ads-enable"] = ADS;
$code = "
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src='https://www.googletagmanager.com/gtag/js?id=%id'>
</script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '%id');
</script>
";
$ga = str_replace("%id", $config["ga"], $code);
$config["ga"] = $ga;
$ads = array("ad728", "ad468", "ad300");
function get_ad( $ad){
	if(ADS==TRUE){
		GLOBAL $config;
		GLOBAL $ads;
		if(in_array($ad, $ads)){
			switch($ad){
				case $ads[0]:
					echo block_it($config[$ads[0]]);
				break;
		
				case $ads[1]:
					echo block_it($config[$ads[1]]);
				break;
		
				case $ads[2]:
					echo block_it($config[$ads[2]]);
				break;
			}
		}
	}
}
function block_it($ad) {
	return '<div class="col-md-12 mx-auto mb-5">'.$ad.'</div>';
}
?>