php /* Copyright (c) 2008-present InnAnTech Industries Author: Dave Guindon Web: www.DaveGuindon.info Support: www.DaveGuindonSupport.com Product: www.ExitSplash.com Product Help: www.ExitSplash.com/help Product Version: 1.2.8 Please send bug reports, suggestions and/or feedback to the support website given above. ExitSplash is a commercial software. Any distribution is strictly prohibited unless a resale rights license was delivered along with this software. */ //if you would like to change the Exit Splash Top bar ad, simply change the text inbetween the single quotations below //see http://www.exitsplash.com/help for help $barad = 'Increases Website Response by up to 325% in 3 days! CLICK HERE ==>'; /* script security if you want to secure this script to the domain that it will be uploaded to, then change the code below these comments to: $secure = true; To learn more, please watch the help videos at: http://www.exitsplash.com/help */ $secure = false; if ($secure){ $host = $_SERVER['HTTP_HOST']; $refer = $_SERVER['HTTP_REFERER']; $pos = strpos($refer,$host); if ($pos === false){ exit; } } $unique = uniqid('exit'); $topbarcolor = $_GET['tc']; if ((!isset($topbarcolor))||($topbarcolor=='')){ $topbarcolor = '#95d776'; } if (strpos($topbarcolor, '#') === false){ $topbarcolor = '#'.$topbarcolor; } $show = $_GET['sh']; $cb = $_GET['cb']; $clink = $_GET['cl']; if ((isset($cb))||($cb!='')){ $afflink = 'http://'.$cb.'.exitsplash.hop.clickbank.net'; }else{ $afflink = 'http://www.exitsplash.com'; } if ($clink=='yes'){ $afflink = '\'+customafflink+\''; } $barheight = $_GET['bh']; $fontsize = $_GET['fs']; $fontfamily = $_GET['lf']; $afftext = $_GET['at']; $dohover = $_GET['hv']; if ((!isset($barheight))||($barheight=='')){ $barheight = '22'; } if ((!isset($fontsize))||($fontsize=='')){ $fontsize = '12'; } if ((!isset($fontfamily))||($fontfamily=='')){ $fontfamily = 'tahoma'; } if ((!isset($afftext))||($afftext=='')){ $afftext = 'Powered by ExitSplash'; } $cc = MakeVisibleColor($topbarcolor); $afflinkcolor = '#'.$cc[0]; $afflinkcolorOver = '#'.$cc[1]; $topbarcode = ''; $topbarover = '#'.$cc[0]; if ($show != 'no'){ if ($dohover != 'no'){ $topbarcode = 'theDiv = theDiv + \'
'; $topbarcode .= ''.$barad.'  '; $topbarcode .= ''.$afftext.'   
\';'."\n"; }else{ $topbarcode = 'theDiv = theDiv + \'
'; $topbarcode .= ''.$afftext.'   
\';'."\n"; } } $ua = $_GET['ua']; $uaShow = ''; if ((isset($ua))&&($ua!='')){ $uaShow = 'window.alert(exitsplashalertmessage);'; } $imgbackcolor = $_GET['ic']; if ((!isset($imgbackcolor))||($imgbackcolor=='')){ $imgbackcolor = '#FFFFFF'; } if (strpos($imgbackcolor, '#') === false){ $imgbackcolor = '#'.$imgbackcolor; } $uh = $_GET['uh']; $imgalign = $_GET['ia']; if ((!isset($imgalign))||($imgalign=='')){ $imgalign = 'left'; } $uhFunction = 'hideexitcancelbuttonimage = function(){ document.getElementById(\'ExitCancelButtonImageDiv\').style.display=\'none\'; }'."\n"; if ($uh == 'custom'){ $imagediv = 'theDiv = theDiv + \'
\';'."\n"; }else if (($uh != 'custom')&&($uh != 'none')){ if ($uh == 'default'){ $uh = '0'; } //backwards compatible with older version $imagefile = 'http://exitsplash.s3.amazonaws.com/files/exitimpactimage'.$uh.'.gif'; $imagediv = 'theDiv = theDiv + \'
\';'."\n"; }else{ $uhFunction = ''; $imagediv = ''; } $ad = $_GET['ad']; $stopaudio = $_GET['sf']; $audio = ''; $audioWidth = '1'; //default 150 $audioHeight = '1'; //default 50 if ($ad == 'custom'){ $audio = 'theDiv = theDiv + \'
\';'."\n"; }else if (($ad != 'custom')&&($ad != 'none')){ $audiofile = 'http://exitsplash.s3.amazonaws.com/files/exitsplash'.$ad.'.mp3'; $audio = 'theDiv = theDiv + \'
\';'."\n"; } $stopAudioFunction = ''; if ((isset($ad))&&($ad != '')&&($ad != 'none')&&($stopaudio != 'run')){ $stopAudioFunction = 'StopExitImpactAudio = function(){ var esDiv = document.getElementById(\'ExitSplashDiv\'); var esiaDiv = document.getElementById(\'exitsplashimpactaudio\'); esDiv.removeChild(esiaDiv); }'."\n"; } if ((isset($uh))&&($uh != '')&&($uh != 'none')){ //exit impact image is being used if ((isset($ad))&&($ad != '')&&($ad != 'none')&&($stopaudio != 'run')){ //exit impact audio is being used and stop audio when user clicks cancel button $uhMouse = 'onmouseover="javascript:hideexitcancelbuttonimage();StopExitImpactAudio();"'; }else{ $uhMouse = 'onmouseover="javascript:hideexitcancelbuttonimage();"'; } }else{ if ((isset($ad))&&($ad != '')&&($ad != 'none')&&($stopaudio != 'run')){ $uhMouse = 'onmouseover="javascript:StopExitImpactAudio();"'; } } $onclick = 'var a = document.getElementsByTagName(\'A\'); for (var i = 0; i < a.length; i++) { if(a[i].target !== \'_blank\') {addClickEvent(a,i, function(){ PreventExitSplash=true; });} else{addClickEvent(a,i, function(){ PreventExitSplash=false;});}}'; $onclick .= 'disablelinksfunc = function(){'.$onclick.'}'."\n"; $onclick .= $uhFunction; $onclick .= $stopAudioFunction; $onclick .= 'addLoadEvent(disablelinksfunc);'."\n"; $onclick .= 'disableformsfunc = function(){ var f = document.getElementsByTagName(\'FORM\'); for (var i=0;i\';'."\n"; $output .= $imagediv; $output .= $topbarcode; $output .= $audio; $output .= 'theDiv = theDiv + \'\';'."\n"; $output .= 'theDiv = theDiv + \'\';'."\n"; $output .= 'theBody = document.body; if (!theBody) {theBody = document.getElementById("body"); if (!theBody) {theBody = document.getElementsByTagName("body")[0];}}'."\n"; $output .= 'var PreventExitSplash = false;'."\n"; $output .= 'function DisplayExitSplash(){ if(PreventExitSplash == false){ window.scrollTo(0,0); '.$uaShow.' PreventExitSplash=true;'; $output .= ' divtag = document.createElement("div");'; $output .= ' divtag.setAttribute("id","ExitSplashMainOuterLayer");'; $output .= ' divtag.style.position="absolute";'; $output .= ' divtag.style.width="100%";'; $output .= ' divtag.style.height="100%";'; $output .= ' divtag.style.zIndex="99";'; $output .= ' divtag.style.left="0px";'; $output .= ' divtag.style.top="0px";'; $output .= ' divtag.innerHTML=theDiv;'; $output .= ' theBody.innerHTML="";'; $output .= ' theBody.topMargin="0px";'; $output .= ' theBody.rightMargin="0px";'; $output .= ' theBody.bottomMargin="0px";'; $output .= ' theBody.leftMargin="0px";'; $output .= ' theBody.style.overflow="hidden";'; $output .= ' theBody.appendChild(divtag);'; $output .= ' return exitsplashmessage; } }'."\n"; $output .= $onclick; $output .= 'window.onbeforeunload = DisplayExitSplash;'."\n"; echo $output; /*==================================================================*/ function MakeVisibleColor($color){ if ($color[0] == '#'){ $color = substr($color, 1); } if (strlen($color) == 6){ list($r, $g, $b) = array($color[0].$color[1], $color[2].$color[3], $color[4].$color[5]); }else if (strlen($color) == 3){ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]); }else{ return false; } $r = hexdec($r); //php verision 4.1.0 $g = hexdec($g); $b = hexdec($b); $rgb = array($r, $g, $b); $var_r = ($rgb[0] / 255); $var_g = ($rgb[1] / 255); $var_b = ($rgb[2] / 255); $var_min = min($var_r, $var_g, $var_b); $var_max = max($var_r, $var_g, $var_b); $del_max = $var_max - $var_min; $v = $var_max; if($del_max == 0) { $h = 0; $s = 0; } else { $s = $del_max / $var_max; $del_r = ((($var_max - $var_r) / 6) + ($del_max / 2)) / $del_max; $del_g = ((($var_max - $var_g) / 6) + ($del_max / 2)) / $del_max; $del_b = ((($var_max - $var_b) / 6) + ($del_max / 2)) / $del_max; if($var_r == $var_max) { $h = $del_b - $del_g; } elseif($var_g == $var_max) { $h = (1 / 3) + $del_r - $del_b; } elseif($var_b == $var_max) { $h = (2 / 3) + $del_g - $del_r; } if($h < 0) { $h += 1; } if($h > 1) { $h -= 1; } } $cc = ''; if($h != 0){ $h = round($h*100); } if($s != 0){ $s = round($s*100); } if($v != 0){ $v = round($v*100); } if (($s <= 50) && ($v >= 60 )){ $cc[0] = '000000'; $cc[1] = 'FFFFFF'; }else{ $cc[0] = 'FFFFFF'; $cc[1] = '000000'; } return $cc; } ?>