Switch to
Redirect Code Integration
';
}
if($active_tab == 'ads1k_redirect_code')
{
$active_txt .= '
Switch to
PopUnder Code Integration
';
}
return $active_txt;
}
function aoppt_show_logo()
{
$logo = '
';
return $logo;
}
function aoppt_ads1k_xKO()
{
$theTab = isset($_REQUEST['tab'])?trim($_REQUEST['tab']):aoppt_pick_aTab();
$theTab = strtolower($theTab);
if (get_option('aoppt_ads_off') == true)
echo '
-
Popunder code is disabled for this website.
Click here to enable it!
';
}
function aoppt_ads1k_xOK()
{
$theTab = isset($_REQUEST['tab'])?trim($_REQUEST['tab']):aoppt_pick_aTab();
$theTab = strtolower($theTab);
$theURL = 'admin.php?page=ads1k-com&tab=';
$switch = isset($_REQUEST['ads1k_switch'])?trim($_REQUEST['ads1k_switch']):'';
$txtPop = 'ads1k_popunder_code';
$txtRed = 'ads1k_redirect_code';
if (($theTab != $txtPop) && ($theTab != $txtRed))
{
$theURL .= $theTab;
}
else
{
$theURL .= 'ads1k_popunder_code';
}
if ( isset($switch) )
{
if ($switch == 'switch')
{
if (get_option('aoppt_ads_off') == false)
update_option('aoppt_ads_off', true);
else
update_option('aoppt_ads_off', false);
wp_redirect($theURL);
exit;
}
}
}
function aoppt_show_pop()
{
global $adsPop;
if(isset($adsPop) && !empty($adsPop))
echo '
';
}
function aoppt_show_red()
{
global $adsRed;
if(isset($adsRed) && !empty($adsRed))
echo '
';
}
function aoppt_codValid($adsPop)
{
$setting = 'aoppt_ads_Pop';
if(filter_var($adsPop, FILTER_VALIDATE_URL) && strpos($adsPop, '/ads1k.com/') !== false)
{
$adsPop = str_replace('logs.php', '', $adsPop);
if(substr($adsPop, -1) == '/'){ $adsPop = substr($adsPop, 0, -1); }
$adsPop = explode('/', $adsPop);
$adsPop = array_pop($adsPop);
}
if (preg_match('/^[a-z0-9]+$/', $adsPop) && strlen($adsPop) == 32)
{
return $adsPop;
}
else
{
$message = 'Publisher\'s ID isn\'t properly formatted';
add_settings_error($setting, 'wid-error', $message, 'error');
return false;
}
}
function aoppt_includeT()
{
include plugin_dir_path( __FILE__ ).'template.php';
}
?>