Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php $version = '1.4.8'; @ob_start(); error_reporting(E_ALL); if (isset($_GET['ve..
Decoded Output download
<?php
$version = '1.4.8'; @ob_start(); error_reporting(E_ALL); if (isset($_GET['version'])) { echo $version; exit(); } define('SERVICES_JSON_SLICE', 1); define('SERVICES_JSON_IN_STR', 2); define('SERVICES_JSON_IN_ARR', 3); define('SERVICES_JSON_IN_OBJ', 4); define('SERVICES_JSON_IN_CMT', 5); define('SERVICES_JSON_LOOSE_TYPE', 16); define('SERVICES_JSON_SUPPRESS_ERRORS', 32); @header("Content-type: text/javascript; charset=utf-8");
if (isset($_SERVER['HTTP_REFERER'])) { $page_with_script = parse_url($_SERVER['HTTP_REFERER']); } else { $page_with_script = array('host' => ''); } $host_server_basic = $_SERVER['SERVER_NAME']; while (1 < substr_count($host_server_basic, '.')) { $host_server_basic = substr($host_server_basic, strpos($host_server_basic, '.') + 1); } $host_referer_basic = $page_with_script['host']; while (1 < substr_count($host_referer_basic, '.')) { $host_referer_basic = substr($host_referer_basic, strpos($host_referer_basic, '.') + 1); } if ('' == $page_with_script['host'] && !isset($_POST['settings']) && (!isset($_SERVER['QUERY_STRING']) || '' == trim($_SERVER['QUERY_STRING']))) { exit('[ComeBacker] : , . :) ...'); } if ($host_referer_basic != $host_server_basic && $page_with_script['host'] != $_SERVER['SERVER_NAME'] && "geneva-style.ru" != $host_server_basic && "top-blogging.com" != $host_server_basic ) { exit('/' . '*: . http://comebacker.ru . - .*' . '/'); } if (isset($_SERVER['HTTP_REFERER']) && FALSE !== strpos($_SERVER['HTTP_REFERER'], 'comebacker=off')) { exit('/' . '* ComeBacker was turned off with comebacker=off *' . '/'); } if (isset($_POST['settings'])) { $settings = (string)$_POST['settings']; $referer = (isset($_POST['referer'])) ? (string)$_POST['referer'] : ''; } else { parse_str(@$_SERVER['QUERY_STRING'], $_GET); $settings = (string)$_GET['settings']; $referer = (isset($_GET['referer'])) ? (string)$_GET['referer'] : ''; } $referer = str_replace("'", "\'", $referer); if(!function_exists('json_decode')) { function json_decode($data, $array = FALSE) { $json = new Services_JSON(); if (FALSE === $array) { return($json->decode($data)); } else { return(objectToArray($json->decode($data))); } } } if (!function_exists('str_ireplace')) { function str_ireplace($needle, $str, $haystack) { return preg_replace('/' . preg_quote($needle, '/') . '/i', $str, $haystack); } } $comebacker = json_decode(base64_decode($settings), TRUE); if (FALSE === is_array($comebacker) || 0 == count($comebacker)) { exit('Error in decoding encoded settings'); } if(!function_exists('stripos')) { function stripos($haystack, $needle){ return strpos($haystack, stristr( $haystack, $needle )); } } $browser = new Browser(); $text_variant = chooseTextVariant($browser, $comebacker['settings']['button_name_capitalization']); $image_variant = chooseImageVariant($browser); $audio_variant = chooseAudioVariant($browser); $alert_variant = chooseAlertVariant($browser); if (isset($_GET['c'])) $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']] = $_GET['c']; if (isset($_COOKIE['comebacker_was_shown'])) { $too_often = TRUE; if ('one_time_for_all' == $comebacker['settings']['how_often_show']) { $too_often = TRUE; } elseif ('every_time' != $comebacker['settings']['how_often_show'] && isset($_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']])) { switch ($comebacker['settings']['how_often_show']) { case 'one_time': $too_often = TRUE; break; case 'every_day': if (60 * 60 * 24 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_week': if (60 * 60 * 24 * 7 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_month': if (60 * 60 * 24 * 30.43684991666667 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_year': if (60 * 60 * 24 * 365.242199 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; } } else { $too_often = FALSE; } } $http_host = 'http://' . $_SERVER['SERVER_NAME']; if (0 === stripos($referer, $http_host)) $page_now = str_ireplace($http_host, '', $referer); else { $page_now = parse_url($referer); $page_now = (isset($page_now['path'])) ? $page_now['path'] : ''; } $question_mark = stripos($page_now, '?'); $page_now = (FALSE === $question_mark) ? $page_now : substr($page_now, 0, $question_mark); $page_now = ('' == $page_now) ? '/' : $page_now; if ('' != trim($comebacker['settings']['work_page'])) { if (FALSE === strpos($comebacker['settings']['work_page'], ',')) { $comebacker['settings']['work_page'] = array($comebacker['settings']['work_page']); } else { $comebacker['settings']['work_page'] = explode(',', $comebacker['settings']['work_page']); foreach ($comebacker['settings']['work_page'] as $key => $value) $comebacker['settings']['work_page'][$key] = trim($value); } } else { $comebacker['settings']['work_page'] = FALSE; } function preg_match_page($pattern, $source) { $pattern = '~^' . str_replace('*', '(.*)', str_replace('/', '\/', ltrim($pattern, '!'))) . '$~'; if (preg_match($pattern, $source)) return TRUE; return FALSE; } function preg_match_url($work_page, $url) { $result = array( 'result' => TRUE, 'rule' => ' ' ); $allowed_rule = FALSE; foreach ($work_page as $mask) if (0 < strlen($mask)) if ('!' !== $mask[0]) $allowed_rule = TRUE; if (FALSE === $allowed_rule) array_unshift($work_page, '*'); foreach ($work_page as $mask) if (strlen($mask) > 0) if (preg_match_page($mask, $url)) $result = array( 'result' => ('!' === $mask[0]), 'rule' => $mask ); return $result; } function get_work_on_this_page($work_page, $page) { if (FALSE === $work_page) return array( 'result' => FALSE, 'rule' => FALSE ); return preg_match_url($work_page, $page); } $if_working_in_opera = (FALSE === $comebacker['settings']['working_in_opera'] && ('opera' == $browser->getBrowser())) ? TRUE : FALSE; $work_on_this_page = get_work_on_this_page($comebacker['settings']['work_page'], $page_now); $if_work_on_this_page = $work_on_this_page['result']; $is_mobile = $browser->isMobile(); if ( $if_working_in_opera || $if_work_on_this_page || $is_mobile || TRUE === @$too_often ) { $message = ''; $message .= (TRUE === $if_working_in_opera) ? 'not permitted work in opera' : ''; $message .= (TRUE === $if_work_on_this_page) ? 'not permitted work on this page (rule: ' . @$work_on_this_page['rule'] . ')' : ''; $message .= (TRUE === @$too_often) ? 'not permitted work so often' : ''; $message .= (TRUE === $is_mobile) ? 'not permitted work on mobile devices' : ''; exit('/' . '*not that time: ' . $message . ' *' . '/'); } if (FALSE != $comebacker['image']) { if (TRUE === imageExist(@$comebacker['image']['src'][$image_variant])) { $comebacker['image']['src'] = $comebacker['image']['src'][$image_variant]; } elseif ((2 == $image_variant || 4 == $image_variant) && (TRUE === imageExist(@$comebacker['image']['src'][2]) || TRUE === imageExist(@$comebacker['image']['src'][4]))) { $comebacker['image']['src'] = (TRUE === imageExist(@$comebacker['image']['src'][2])) ? $comebacker['image']['src'][2] : $comebacker['image']['src'][4]; } elseif ((1 == $image_variant || 2 == $image_variant || 4 == $image_variant) && (TRUE === imageExist(@$comebacker['image']['src'][1]) || TRUE === imageExist(@$comebacker['image']['src'][2]) || TRUE === imageExist(@$comebacker['image']['src'][4]))) { $comebacker['image']['src'] = (TRUE === imageExist(@$comebacker['image']['src'][1])) ? $comebacker['image']['src'][1] : ((TRUE === imageExist(@$comebacker['image']['src'][2])) ? $comebacker['image']['src'][2] : $comebacker['image']['src'][4]); } elseif (TRUE === imageExist(@$comebacker['image']['src'][666])) { $comebacker['image']['src'] = $comebacker['image']['src'][666]; } else { $comebacker['image'] = FALSE; } if ('-' == $comebacker['image']['src']) $comebacker['image'] = FALSE; } if (FALSE != $comebacker['audio']) { if (isset($comebacker['audio']['src'][$audio_variant])) { $comebacker['audio']['src'] = $comebacker['audio']['src'][$audio_variant]; if (!isset($comebacker['audio']['source'])) $comebacker['audio']['source'] = array(); if (!isset($comebacker['audio']['source']['mp3'])) $comebacker['audio']['source']['mp3'] = $comebacker['audio']['src']; if (!isset($comebacker['audio']['source']['ogg'])) $comebacker['audio']['source']['ogg'] = str_ireplace('.mp3', '.ogg', $comebacker['audio']['source']['mp3']); } else { $comebacker['audio'] = FALSE; } } if (isset($comebacker['settings']['dir_url']) && '' != trim($comebacker['settings']['dir_url'])) { $script_path_player = $comebacker['settings']['dir_url']; } elseif (isset($comebacker['settings']['script_path'])) { $script_path_player = str_replace('comebacker.php', '', $comebacker['settings']['script_path']); } ?> (function (A) { if (!String.prototype.trim) A.trim = A.trim || function (object) { return this.replace(/^\s+|\s+$/g,""); }; if (!String.prototype.ltrim) A.ltrim = A.ltrim || function (object) { return this.replace(/^\s+/,""); }; if (!String.prototype.rtrim) A.rtrim = A.rtrim || function (object) { return this.replace(/\s+$/,""); }; })(String.prototype); (function (A) { if (!Array.prototype.indexOf) A.indexOf = A.indexOf || function (object) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === object) { return i; } } return -1; }; if (!Array.prototype.forEach) A.forEach = A.forEach || function (action, that) { for (var i = 0, l = this.length; i < l; i++) if (i in this) action.call(that, this[i], i, this); }; if (!Array.prototype.push) A.push = A.push || function() { for (var i = 0, l = arguments.length; i < l; i++) this[this.length] = arguments[i]; return this.length; }; A.inArray = function(needle, argStrict) { var key = '', strict = !! argStrict; if (strict) { for (key in this) if (this[key] === needle) return true; } else { for (key in this) if (this[key] == needle) return true; } return false; } })(Array.prototype); comebacker = eval('(' + comebacker + ')'); cb_referer = '<?php echo $referer; ?>'; array_exit_pages = new Array(); if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item) { array_exit_pages.push(item.url); }); } array_exit_pages.push(comebacker['settings']['page_to']); comebacker['settings']['launch'] = !array_exit_pages.inArray(cb_referer); if (undefined == typeof(comebacker['settings']['working_in_opera_after'])) { comebacker['settings']['working_in_opera_after'] = 0; } comebacker['temp'] = { 'audio_refresher' : '', 'cursor_x' : 0, 'cursor_y' : 0, 'cursor_y_previous' : 0, 'cancel_click' : false, 'launch_time' : 0, 'cache' : {}, <?php if ('opera' == $browser->getBrowser()): ?> 'time_activate' : comebacker_time(), <?php endif; ?> 'anticache' : 1625, 'start_time': comebacker_time(), 'log' : [] }; comebacker['exit_text'] = comebacker['exit_text'].replace("[[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438]]", '<?php echo $text_variant?>'); <?php if (FALSE !== $comebacker['alert'] && FALSE == ('firefox' == $browser->getBrowser() && 27 <= $browser->getVersion())): ?> comebacker['alert']['text'][<?php echo $alert_variant; ?>] = comebacker['alert']['text'][<?php echo $alert_variant; ?>].replace("[[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438]]", '<?php echo $text_variant?>'); <?php endif ?> var comebacker_html = { 'prefix' : '', 'postfix' : '', 'bar' : '', 'image' : '', 'audio' : '', 'iframe' : '' }; comebacker_html['css'] = ' html{ height: 100%; } body{ margin: 0px; padding: 0px; height: 100% !important; background: none; }'; comebacker_html['prefix'] += '<div id="comebacker_main_div" style="overflow: hidden; width: 1px; height: 1px;" onmouseover="comebackerCancelClick();">'; comebacker_html['postfix'] = '</div>'; <?php if (TRUE === $comebacker['bar']): ?> comebacker_html['css'] += ' #comebacker_bar {background-color: #' + comebacker['bar']['background_color'] + '; height: ' + comebacker['bar']['height'] + 'px; padding: 0px 7px 0px 7px; line-height: ' + comebacker['bar']['height'] + 'px; } #comebacker_bar a{color: #' + comebacker['bar']['link_color'] + '; font-size: ' + comebacker['bar']['link_size'] + 'px; text-decoration: underline; font-family: tahoma;} #comebacker_bar a:hover{text-decoration: none;}</style>'; comebacker_html['bar'] += '<div id="comebacker_bar"><a href="' + comebacker['bar']['link_href'] + '" style="float: left" target="_blank">' + comebacker['bar']['link_text_left'] + '</a><a href="' + comebacker['bar']['link_href'] + '" target="_blank" style="float: right">' + comebacker['bar']['link_text_right'] + '</a></div>'; <?php endif ?> <?php if (FALSE !== $comebacker['image']): ?> <?php if ('before_page' == $comebacker['image']['position']) { if ('center' == $comebacker['image']['align']) { $image_style_left = '50%'; } else if ('left' == $comebacker['image']['align']) { $image_style_left = '0%'; } else { $image_style_left = '100%'; } $image_add_styles = 'position: absolute; left: ' . $image_style_left . ';'; $margin = @$comebacker['image']['margin']; $margin[1] = 0; $margin[3] = 0; } else { $image_add_styles = 'width: 100%; text-align: ' . $comebacker['image']['align'] . '; background-color: #' . $comebacker['image']['background_color'] . ';'; $margin = @$comebacker['image']['margin']; } ?> comebacker_html['image'] = '<div id="comebacker_image_div" style="<?php echo @$image_add_styles; ?> top: 0; display: none; z-index: 9999;"><img id="comebacker_image" style="margin: <?php echo @(int)$margin[0]; ?>px <?php echo @(int)$margin[1]; ?>px <?php echo @(int)$margin[2]; ?>px <?php echo @(int)$margin[3]; ?>px;" src="<?php echo $comebacker['image']['src']; ?>"></div>'; <?php endif; ?> <?php if (FALSE !== $comebacker['audio']): ?> function cbDetectIE() { var ua = navigator.userAgent, re = undefined; if ('Microsoft Internet Explorer' == navigator.appName) re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); else if ('Netscape' == navigator.appName) re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); else return false; if (null != re.exec(ua)) return parseFloat(RegExp.$1); return false; }; function cbDetectFlash() { result = false; try { var foo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); if (foo) result = true; } catch (e) { if (undefined !== navigator.mimeTypes['application/x-shockwave-flash']) result = true; } return result; }; if (cbDetectIE()) { comebacker_html['audio'] += '<object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += '</object>'; } else if (cbDetectFlash()) { window.cbAudioListener<?php echo $comebacker['settings']['id'];?> = new Object(); window.cbAudioListener<?php echo $comebacker['settings']['id'];?>.onInit = function () { if ('undefined' === typeof window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>) window.cbAudioInstance<?php echo $comebacker['settings']['id'];?> = new cbAudioObject({ mode: 'flash', mp3: '<?php echo $comebacker['audio']['source']['mp3']; ?>', ogg: '<?php echo $comebacker['audio']['source']['ogg']; ?>' }); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.preferred_object.SetVariable('method:setUrl', window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.config.mp3); window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?> = window.setInterval(function () { window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.setPosition(0); }, 3000); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_initialize().setVolume(0).cb_play(); comebacker_log('audio player initialized, flash mode'); }; window.cbAudioListener<?php echo $comebacker['settings']['id'];?>.onUpdate = function() {}; comebacker_html['audio'] += '<object id="cb-audio-flash<?php echo $comebacker['settings']['id'];?>" type="application/x-shockwave-flash" data="<?php echo $script_path_player; ?>player_mp3_js.swf" width="1" height="1" style="position: absolute;">'; comebacker_html['audio'] += ' <param name="movie" value="<?php echo $script_path_player; ?>player_mp3_js.swf">'; comebacker_html['audio'] += ' <param name="FlashVars" value="listener=cbAudioListener<?php echo $comebacker['settings']['id'];?>&interval=500">'; comebacker_html['audio'] += ' <audio id="cb-audio-html5<?php echo $comebacker['settings']['id'];?>" preload="auto">'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['mp3']; ?>" type="audio/mpeg; codecs=mp3" />'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['ogg']; ?>" type="audio/ogg; codecs=vorbis" />'; comebacker_html['audio'] += ' <object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += ' </object>'; comebacker_html['audio'] += ' </audio>'; comebacker_html['audio'] += ' <a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/></a>'; comebacker_html['audio'] += '</object>'; } else { comebacker_html['audio'] += '<audio id="cb-audio-html5<?php echo $comebacker['settings']['id'];?>" preload="auto">'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['mp3']; ?>" type="audio/mpeg; codecs=mp3" />'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['ogg']; ?>" type="audio/ogg; codecs=vorbis" />'; comebacker_html['audio'] += ' <object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += ' </object>'; comebacker_html['audio'] += '</audio>'; }; function cbAudioObject (config) { this.cb_initialized = false; this.preferred_mode = undefined; this.preferred_object = undefined; this.audio_refresher = undefined; this.getPreferredMode = function () { this.preferred_mode = undefined; if (cbDetectIE()) { this.preferred_object = document.getElementById("cb-audio-wmp<?php echo $comebacker['settings']['id'];?>"); if ('undefined' !== typeof this.preferred_object.playState) { this.preferred_mode = 'wmp'; return this.preferred_mode; }; }; if (cbDetectFlash()) { this.preferred_mode = 'flash'; this.preferred_object = document.getElementById("cb-audio-flash<?php echo $comebacker['settings']['id'];?>"); return this.preferred_mode; }; this.preferred_object = document.getElementById("cb-audio-html5<?php echo $comebacker['settings']['id'];?>"); if (this.preferred_object.cb_play instanceof Function) { this.preferred_mode = "html5"; return this.preferred_mode; }; return undefined; }; this.initializeMode = function() { return this; }; this.getPreferredFunctions = function () { switch (this.preferred_mode) { case "html5": this.isPlaying = function () { return !this.preferred_object.paused; }; this.cb_play = function () { this.preferred_object.cb_play(); return this; }; this.cb_pause = function () { this.preferred_object.cb_pause(); return this; }; this.cb_stop = function () { this.preferred_object.cb_pause(); this.preferred_object.currentTime = 0; return this; }; this.setPosition = function (position) { this.preferred_object.currentTime = position; return this; }; this.setVolume = function (volume) { this.preferred_object.volume = volume / 100; return this; }; break; case "wmp": this.isPlaying = function () { return (3 == this.preferred_object.playState); }; this.cb_play = function () { this.preferred_object.controls.cb_play(); return this; }; this.cb_pause = function () { this.preferred_object.controls.cb_pause(); return this; }; this.cb_stop = function () { this.preferred_object.controls.cb_stop(); return this; }; this.setPosition = function (position) { this.preferred_object.controls.currentPosition = position; return this; }; this.setVolume = function (volume) { this.preferred_object.settings.volume = volume; return this; }; break; case "flash": this.isPlaying = function () { }; this.cb_play = function () { try { this.preferred_object.SetVariable('method:play', ''); this.preferred_object.SetVariable('enabled', 'true'); } catch (e) { }; return this; }; this.cb_pause = function () { try { this.preferred_object.SetVariable('method:pause', ''); } catch (e) { }; return this; }; this.cb_stop = function () { try { this.preferred_object.SetVariable('method:stop', ''); } catch (e) { }; return this; }; this.setPosition = function (position) { try { this.preferred_object.SetVariable('method:setPosition', position); } catch (e) { }; return this; }; this.setVolume = function (volume) { try { this.preferred_object.SetVariable('method:setVolume', volume); } catch (e) { }; return this; }; break; default: this.isPlaying = function () {}; this.cb_play = function () {}; this.cb_pause = function () {}; this.cb_stop = function () {}; this.setPosition = function (position) { return this; }; this.setVolume = function (volume) { return this; }; break; }; }; this.cb_initialize = function () { if (true === this.cb_initialized) return this; if ('undefined' !== typeof config.preferred_mode) this.preferred_mode = config.preferred_mode; else this.getPreferredMode(); this.initializeMode(); this.getPreferredFunctions(); this.cb_initialized = true; return this; }; this.config = config; return this; }; <?php endif; ?> var currentFrameId = undefined; var cb_get_params = {}, cb_exit_page_get_params = {}; var pass_get_params_on_exit_page = comebacker['settings']['pass_get_params_on_exit_page']; function __getUrlParameters(url) { var result = {}; var cl = url.length ? url : window.location.search; if (1 === cl.split('?').length) return {}; var qs = cl.split('?')[1].split('&'); for (var i = 0; i < qs.length; i++) { tokens = qs[i].split('='); try { result[decodeURIComponent(tokens[0])] = decodeURIComponent(tokens[1]); } catch (e) { result[tokens[0]] = tokens[1]; } } return result; }; function __extendParameters(destination, source) { for (var property in source) destination[property] = source[property]; return destination; }; function __joinParameters(parameters) { var result = delimiter = ''; for (var property in parameters) { result = result + delimiter + property + '=' + parameters[property]; delimiter = '&'; } if (result.length) result = '?' + result; return result; } if ('undefined' !== typeof(Storage)) localStorage.removeItem('cb_worked'); if (pass_get_params_on_exit_page) { if ('undefined' !== typeof comebacker_get_params) cb_get_params = comebacker_get_params; else cb_get_params = __getUrlParameters(document.location.search); }; <?php if ('firefox' == $browser->getBrowser()): ?> var cb_iframe_styles = ('object' == typeof(Muse)) ? 'position: fixed; left: -10px; right: -10px; width: 0px; height: 0px; border: 0px; visibility: hidden;' : 'width: 100%; height: 100%; border: 0px; visibility: hidden;'; <?php else: ?> var cb_iframe_styles = 'width: 100%; height: 100%; border: 0px; visibility: hidden;'; <?php endif; ?> if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { comebacker_html['iframe'] = ''; jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item, index, data) { if (pass_get_params_on_exit_page) { cb_exit_page_get_params = __getUrlParameters(item.url); cb_exit_page_get_params = __extendParameters(cb_exit_page_get_params, cb_get_params); if (-1 < item.url.indexOf('?')) item.url = item.url.substr(0, item.url.indexOf('?')); item.url = item.url + __joinParameters(cb_exit_page_get_params); }; comebacker_html['iframe'] += '<iframe id="comebacker_iframe_' + index + '" class="comebacker_iframe" src="' + item.url + '" style="' + cb_iframe_styles + '"></iframe>'; if (undefined === currentFrameId) currentFrameId = 'comebacker_iframe_' + index; }); } else { comebacker_html['iframe'] = '<iframe id="comebacker_iframe" class="comebacker_iframe" src="' + comebacker['settings']['page_to'] + '" style="' + cb_iframe_styles + '"></iframe>'; currentFrameId = 'comebacker_iframe'; } comebacker_html['whole'] = comebacker_html['prefix'] + comebacker_html['bar'] + comebacker_html['image'] + comebacker_html['audio'] + comebacker_html['iframe'] + comebacker_html['postfix']; function disableEvents() { jQuery('a').each(function (i) { var href = jQuery(this).attr('href'); if ('undefined' != typeof(href) && '' != href && '_blank' != jQuery(this).attr('target') && '#' != href && href.substring(0, 11) !== 'javascript:' && href.substring(0, 1) !== '#' && href.substring(0, 7) !== 'mailto:') { jQuery(this).bind('click', function(){ comebacker['settings']['launch'] = false; jQuery('[id*=comebacker_iframe]').each(function() { try { if ('undefined' !== typeof this.contentWindow.comebacker) this.contentWindow.comebacker['settings']['launch'] = false; } catch (e) { console.log('comebacker cross domain'); console.log(e); } }); }); } }); jQuery('form').bind('submit', function(){ comebacker['settings']['launch'] = false; jQuery('[id*=comebacker_iframe]').each(function() { try { if ('undefined' !== typeof this.contentWindow.comebacker) this.contentWindow.comebacker['settings']['launch'] = false; } catch (e) { console.log('comebacker cross domain'); console.log(e); } }); }); } function catcherInit(callback) { var catcherLast = +new Date(), catcherDelay = 100, catcherStack = []; var onDomChange = function(f, delayNew) { if (delayNew) catcherDelay = delayNew; catcherStack.push(f); }; function catcherCallback() { var now = +new Date(); if (now - catcherLast > catcherDelay) { catcherLast = now; for (var i = 0; i < catcherStack.length; i++) catcherStack[i](); } } function catcherNothingToLose() { var last = document.getElementsByTagName('*'), lastLength = last.length; setTimeout(function examine() { var current = document.getElementsByName('*'), currentLength = current.length; if (currentLength != lastLength) last = []; for (var i = 0; i < currentLength; i++) if (current[i] !== last[i]) { catcherCallback(); last = current; lastLength = currentLength; break; } setTimeout(examine, catcherDelay); }, catcherDelay); } var catcherFunctionsSupport = {}, catcherElement = document.documentElement, catcherRemains = 3; function catcherIsSupported(event) { catcherElement.addEventListener(event, function dummy() { catcherFunctionsSupport[event] = true; catcherElement.removeEventListener(event, dummy, false); if (--catcherRemains === 0) catcherExecute(); }); } function catcherExecute() { if (catcherFunctionsSupport.DOMNodeInserted) { if (catcherFunctionsSupport.DOMSubtreeModified) catcherElement.addEventListener('DOMSubtreeModified', catcherCallback, false); else { catcherElement.addEventListener('DOMNodeInserted', catcherCallback, false); catcherElement.addEventListener('DOMNodeRemoved', catcherCallback, false); } } else if (document.onpropertychange) document.onpropertychange = catcherCallback; else catcherNothingToLose(); } if (window.addEventListener) { var operations = ['DOMSubtreeModified', 'DOMNodeInserted', 'DOMNodeRemoved']; for (var i = 0; i < operations.length; i++) catcherIsSupported(operations[i]); } catcherExecute(); window.onDomChange = onDomChange; callback(); } function getCurrentFrameId() { return currentFrameId; } function pageStepLoad(index) { comebacker['settings']['launch'] = true; currentFrameId = 'comebacker_iframe_' + index; comebacker_log(currentFrameId); comebacker_log(jQuery('#' + currentFrameId).attr('src')); } function initPreloads() { if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { multiplierSecond = 1000; multiplierMinute = 60 * multiplierSecond; jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item, index, data) { item.from = parseFloat(item.from); item.to = parseFloat(item.to); if (!isNaN(item.from)) { setTimeout(function() { comebacker_log('pageStepLoad ' + (item.from * multiplierMinute) / 1000); pageStepLoad(index); }, item.from * multiplierMinute); } if (!isNaN(item.to)) { setTimeout(function() { comebacker_log('turned off ' + (item.to * multiplierMinute) / 1000); comebacker['settings']['launch'] = false; }, item.to * multiplierMinute - 10); } }); } } function ess_gc (name) { var name = name + "="; var ca = document.cookie.split(";"); for (var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (0 == c.indexOf(name)) return c.substring(name.length, c.length); }; return ""; }; function ess_sc (name, value) { var d = new Date(); d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); document.cookie = name + "=" + value + ";expires=" + d.toGMTString() + ";path=/"; }; function comebackerLaunch() { comebacker_log('comebackerLaunch function fired'); if (true == comebacker['settings']['launch'] && ('undefined' === typeof(Storage) || 'undefined' !== typeof(Storage) && <?php echo $comebacker['settings']['id'];?> != parseInt(localStorage.getItem('cb_worked'))) <?php if ('opera' == $browser->getBrowser()): ?> && comebacker['temp']['time_activate'] <= (comebacker_time() - comebacker['settings']['working_in_opera_after'])<?php endif; ?>) { comebacker_log('comebackerLaunch function starting work...'); comebacker['temp']['launch_time'] = comebacker_time(); jQuery('body').children().not('#comebacker_main_div').remove(); jQuery('body').contents().filter(function(){ return this.nodeType === 3; }).remove(); jQuery('head link').remove(); jQuery('head style').remove(); jQuery('#comebacker_main_div').css('width', '100%').css('height', '100%'); jQuery('#' + getCurrentFrameId()).css('visibility', 'visible'); <?php if ('firefox' == $browser->getBrowser()): ?> if ('object' == typeof(Muse)) jQuery('#' + getCurrentFrameId()).css('height', '100%').css('width', '100%'); <?php endif; ?> jQuery('body').append('<style>' + comebacker_html['css'] + '</style>'); jQuery('#comebacker_bar').css('display', 'block'); jQuery('#comebacker_image_div').css('display', 'block'); <?php if (FALSE !== $comebacker['image'] && 'before_page' == $comebacker['image']['position']): ?> <?php if ('center' == $comebacker['image']['align']): ?> var test = document.getElementById('comebacker_image').offsetWidth / 2; <?php elseif ('right' == $comebacker['image']['align']): ?> var test = document.getElementById('comebacker_image').offsetWidth; <?php else: ?> var test = 0; <?php endif; ?> jQuery('#comebacker_image_div').css('margin-left', (0 - test - <?php echo (int)$comebacker['image']['margin'][1] ?> + <?php echo (int)$comebacker['image']['margin'][3] ?>) + 'px'); <?php endif; ?> <?php if (FALSE !== $comebacker['audio']): ?> if ('undefined' !== typeof window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?>) clearInterval(window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?>); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.setPosition(0).setVolume(100).cb_play(); <?php endif; ?> comebacker['settings']['launch'] = false; comebacker_create_cookie('comebacker_was_shown[<?php echo $comebacker['settings']['id'];?>]', comebacker_time(), 365); if ('undefined' != typeof(_gaq)) { _gaq.push(['_trackPageview', '/comebacker/show/<?php echo $comebacker['settings']['id'];?>']); _gaq.push(['_trackEvent', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'show']); } if ('function' == typeof(ga)) { ga('send', 'pageview', '/comebacker/show/<?php echo $comebacker['settings']['id'];?>'); ga('send', 'event', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'show'); } <?php if (FALSE !== $comebacker['alert'] && FALSE == ('firefox' == $browser->getBrowser() && 27 <= $browser->getVersion())): ?> if ('' != comebacker['alert']['text'][<?php echo $alert_variant?>]) { <?php if ('opera' == $browser->getBrowser()):?> setTimeout(function() { alert(comebacker['alert']['text'][<?php echo $alert_variant?>]); }, 1000); <?php else: ?> alert(comebacker['alert']['text'][<?php echo $alert_variant?>]); <?php endif; ?> } <?php endif; ?> var ess_cname = <?php echo $comebacker['settings']['id']; ?> + '_ess_comebacker_launch'; var ess_c = ess_gc(ess_cname); if (0 === ess_c.length) { ess_sc(ess_cname, ess_cname); jQuery.ajax('http://ess.makedreamprofits.ru/push', { dataType: 'jsonp', crossDomain: true, data: { product_name: 'comebacker', event_name: 'launch', script_id: '<?php echo $comebacker['settings']['id']; ?>' } }); } if ('undefined' !== typeof(Storage)) { setInterval(function(){ localStorage.setItem('cb_worked', <?php echo $comebacker['settings']['id'];?>); }, 1000); } comebacker_log('comebackerLaunch function finishing work...'); return comebacker['exit_text']; } } <?php if ('opera' != $browser->getBrowser()): ?> window.onbeforeunload = comebackerLaunch; comebacker_log('prepared for launch'); <?php endif; ?> function comebackerCancelClick() { if (false == comebacker['temp']['cancel_click'] && comebacker['temp']['launch_time'] < comebacker_time()-1) { jQuery('#comebacker_image_div').remove(); <?php if (FALSE !== $comebacker['audio'] && TRUE === $comebacker['audio']['stop_after_cancel']): ?> if ('undefined' !== typeof window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>) if (window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_stop instanceof Function) window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_stop(); jQuery('#comebacker_audio').remove(); <?php endif; ?> jQuery('#comebacker_main_div').unbind('mouseover', false); if ('undefined' != typeof(_gaq)) { _gaq.push(['_trackPageview', '/comebacker/cancel/<?php echo $comebacker['settings']['id'];?>']); _gaq.push(['_trackEvent', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'cancel']); } if ('function' == typeof(ga)) { ga('send', 'pageview', '/comebacker/cancel/<?php echo $comebacker['settings']['id'];?>'); ga('send', 'event', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'cancel'); } try { jQuery('#' + getCurrentFrameId()).contents().find('.comebacker_hidden').css('display', 'inline').removeClass('comebacker_hidden'); jQuery('#' + getCurrentFrameId()).contents().find('object[id=skype_plugin_object]').remove(); jQuery('#' + getCurrentFrameId()).contents().find('object').unwrap(); } catch (e) {}; try { if ('undefined' != typeof(document.getElementById(getCurrentFrameId()).contentWindow.comebacker_after_cancel)) { document.getElementById(getCurrentFrameId()).contentWindow.comebacker_after_cancel(); } } catch(e) { if ('function' == typeof(comebacker_after_cancel)) { comebacker_after_cancel(); } } var ess_cname = <?php echo $comebacker['settings']['id']; ?> + '_ess_comebacker_cancel'; var ess_c = ess_gc(ess_cname); if (0 === ess_c.length) jQuery.ajax('http://ess.makedreamprofits.ru/push', { dataType: 'jsonp', crossDomain: true, data: { product_name: 'comebacker', event_name: 'cancel', script_id: '<?php echo $comebacker['settings']['id']; ?>' }, success: function (response) { ess_sc(ess_cname, response.event_id); } }); comebacker['temp']['cancel_click'] = true; } } <?php if (FALSE !== $comebacker['audio']): ?> comebacker_log('functions for audio loaded'); var comebackerAudioListener = new Object(); comebackerAudioListener.onInit = function(){ comebackerSetVolume(0); comebackerAudioPlay(); comebacker['temp']['audio_refresher'] = window.setInterval(function(){comebackerSetPosition(0)}, 3000); comebacker_log('player initialized'); }; comebackerAudioListener.onUpdate = function(){}; function comebackerGetAudioObject() { return document.getElementById("comebacker_audio"); } function comebackerAudioPlay() { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setUrl", "<?php echo $comebacker['audio']['source']['mp3']; ?>"); comebackerGetAudioObject().SetVariable("method:play", ""); comebackerGetAudioObject().SetVariable("enabled", "true"); } } function comebackerAudioStop() { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:stop", ""); } } function comebackerSetVolume(volume) { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setVolume", volume); } } function comebackerSetPosition(position) { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setPosition", position); } } <?php endif; ?> jQuery(document).ready(function() { <?php ?> disableEvents(); catcherInit(function() { onDomChange(function() { setTimeout(disableEvents, 200); }); }); jQuery('body').append(comebacker_html['whole']); <?php if (FALSE !== $comebacker['audio']): ?> window.cbAudioInstance<?php echo $comebacker['settings']['id'];?> = cbAudioObject({ mode: 'flash', mp3: '<?php echo $comebacker['audio']['source']['mp3']; ?>', ogg: '<?php echo $comebacker['audio']['source']['ogg']; ?>' }); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_initialize(); <?php endif ?> jQuery('[id*=comebacker_iframe]').load(function (){ if (0 == comebacker['temp']['launch_time']) { <?php if ('firefox' == $browser->getBrowser()): ?> if ('object' == typeof(Muse)) jQuery(this).css('display', 'none').css('position', 'static').css('visibility', 'visible').css('width', '100%').css('height', '100%'); <?php endif; ?> try { jQuery(this).contents().find('object, audio, video, iframe').filter(':visible').css('display', 'none').addClass('comebacker_hidden'); jQuery(this).contents().find('object').wrap('<div style="display: none" />'); } catch (e) {}; } }); <?php if ('opera' == $browser->getBrowser()): ?> function comebackerGetXY(e) { comebacker['temp']['cursor_y_previous'] = comebacker['temp']['cursor_y']; comebacker['temp']['cursor_x'] = (window.Event) ? e.pageX : event.clientX; comebacker['temp']['cursor_y'] = (window.Event) ? e.pageY : event.clientY; } <?php if ('ie' == $browser->getBrowser()):?> document.attachEvent("onmousemove", comebackerGetXY); <?php else: ?> document.addEventListener("mousemove", comebackerGetXY, true); <?php endif ?> window.onmouseout = function() { if (comebacker['temp']['cursor_y'] < (20 + window.pageYOffset) && comebacker['temp']['cursor_y_previous'] > comebacker['temp']['cursor_y']) comebackerLaunch(); }; comebacker_log('prepared for launch in opera'); <?php endif ?> initPreloads(); }); function comebacker_time() { var temp = 716253; return Math.floor(new Date().getTime() / 1000); } function comebacker_log(message) { if ('undefined' != typeof(comebacker) && 'undefined' != typeof(comebacker['temp']) && 'undefined' != typeof(comebacker['temp']['log'])) { comebacker['temp']['log'].push(message); } } function comebacker_showlog() { console.log(comebacker['temp']['log']); } function comebacker_create_cookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/;domain=." + document.domain.substring(document.domain.lastIndexOf(".", document.domain.lastIndexOf(".") - 1) + 1); } <?php function normalizeBoolean($array) { foreach ($array as $key => $value) if (TRUE === is_array($value)) { $array[$key] = normalizeBoolean($value); } elseif ('true' == $value || 'TRUE' == $value) { $array[$key] = TRUE; } elseif ('false' == $value || 'false' == $value) { $array[$key] = FALSE; } return $array; } function imageExist($data) { return ('' == trim($data)) ? FALSE : TRUE; } function chooseImageVariant($browser) { switch ($browser->getBrowser()) { case 'ie': if (9 <= (int)$browser->getVersion()) { return 2; } else { return 0; } break; case 'firefox': if (4 <= (int)$browser->getVersion()) { return 1; } else { return 0; } break; case 'chrome': return 4; break; case 'safari': return 0; break; case 'opera': return 3; break; default: return 666; break; } } function chooseTextVariant($browser, $button_name_capitalization) { $text = array( 'first_upper' => array( 0 => '\u041e\u0442\u043c\u0435\u043d\u0430', 1 => '\u041e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', 2 => '\u041e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', ), 'lower' => array( 0 => '\u043e\u0442\u043c\u0435\u043d\u0430', 1 => '\u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', 2 => '\u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', ), 'upper' => array( 0 => '\u041e\u0422\u041c\u0415\u041d\u0410', 1 => '\u041e\u0421\u0422\u0410\u0422\u042c\u0421\u042f \u041d\u0410 \u0421\u0422\u0420\u0410\u041d\u0418\u0426\u0415', 2 => '\u041e\u0421\u0422\u0410\u0422\u042c\u0421\u042f \u041d\u0410 \u042d\u0422\u041e\u0419 \u0421\u0422\u0420\u0410\u041d\u0418\u0426\u0415', ), ); switch ($browser->getBrowser()) { case 'ie': if (9 <= (int)$browser->getVersion()) { return $text[$button_name_capitalization][2]; } else { return $text[$button_name_capitalization][0]; } break; case 'firefox': if (4 <= (int)$browser->getVersion()) { return $text[$button_name_capitalization][1]; } else { return $text[$button_name_capitalization][0]; } break; case 'chrome': return $text[$button_name_capitalization][2]; break; case 'safari': return $text[$button_name_capitalization][2]; break; default: return $text[$button_name_capitalization][0]; break; } } function chooseAudioVariant($browser) { switch ($browser->getBrowser()) { case 'opera': return 3; break; default: return 0; break; } } function chooseAlertVariant($browser) { switch ($browser->getBrowser()) { case 'opera': return 3; break; default: return 0; break; } } class Browser { var $_browser_name, $_version; function Browser($useragent="") { $this->_browser_name = ''; $this->_version = ''; define('BROWSER_UNKNOWN', 'unknown'); define('VERSION_UNKNOWN', 'unknown'); define('BROWSER_OPERA', 'opera'); define('BROWSER_OPERA_WEBKIT', 'opera_webkit'); define('BROWSER_IE', 'ie'); define('BROWSER_FIREFOX', 'firefox'); define('BROWSER_SAFARI', 'safari'); define('BROWSER_CHROME', 'chrome'); define('BROWSER_MSN', 'ie'); define('BROWSER_POCKET_IE', 'ie'); define('BROWSER_OPERA_MINI', 'opera'); $this->reset(); if( $useragent != "" ) { $this->setUserAgent($useragent); } else { $this->determine(); } } function reset() { $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; $this->_browser_name = BROWSER_UNKNOWN; $this->_version = VERSION_UNKNOWN; $this->_is_mobile = false; } function getBrowser() { return $this->_browser_name; } function setBrowser($browser) { return $this->_browser_name = $browser; } function getVersion() { return $this->_version; } function setVersion($version) { $this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/','',$version); } function getUserAgent() { return $this->_agent; } function setUserAgent($agent_string) { $this->reset(); $this->_agent = $agent_string; $this->determine(); } function determine() { $this->checkBrowsers(); $this->isMobile(); } function checkBrowsers() { return ( $this->checkBrowserInternetExplorer() || $this->checkBrowserOpera() || $this->checkBrowserFirefox() || $this->checkBrowserChrome() || $this->checkBrowserSafari() ); } function checkBrowserInternetExplorer() { if( stripos($this->_agent,'microsoft internet explorer') !== false ) { $this->setBrowser(BROWSER_IE); $this->setVersion('1.0'); $aresult = stristr($this->_agent, '/'); if( preg_match('/308|425|426|474|0b1/i', $aresult) ) { $this->setVersion('1.5'); } return true; } else if( stripos($this->_agent,'msie') !== false && stripos($this->_agent,'opera') === false ) { if( stripos($this->_agent,'msnb') !== false ) { $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'MSN')); $this->setBrowser( BROWSER_MSN ); $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1])); return true; } $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'msie')); $this->setBrowser( BROWSER_IE ); $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1])); return true; } else if( stripos($this->_agent,'mspie') !== false || stripos($this->_agent,'pocket') !== false ) { $aresult = explode(' ',stristr($this->_agent,'mspie')); $this->setBrowser( BROWSER_POCKET_IE ); if( stripos($this->_agent,'mspie') !== false ) { $this->setVersion($aresult[1]); } else { $aversion = explode('/',$this->_agent); $this->setVersion($aversion[1]); } return true; } return false; } function checkBrowserOpera() { if( stripos($this->_agent,'opera mini') !== false ) { $resultant = stristr($this->_agent, 'opera mini'); if( preg_match('/\//',$resultant) ) { $aresult = explode('/',$resultant); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $aversion = explode(' ',stristr($resultant,'opera mini')); $this->setVersion($aversion[1]); } $this->_browser_name = BROWSER_OPERA_MINI; return true; } else if( stripos($this->_agent,'opera') !== false ) { $resultant = stristr($this->_agent, 'opera'); if( preg_match('/Version\/(10.*)$/',$resultant,$matches) ) { $this->setVersion($matches[1]); } else if( preg_match('/\//',$resultant) ) { $aresult = explode('/',str_replace("("," ",$resultant)); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $aversion = explode(' ',stristr($resultant,'opera')); $this->setVersion(isset($aversion[1])?$aversion[1]:""); } $this->_browser_name = BROWSER_OPERA; return true; } else if (stripos($this->_agent, 'OPR') !== false) { $resultant = stristr($this->_agent, 'OPR'); if (preg_match('/OPR\/(.*)$/', $resultant, $matches)) $this->setVersion($matches[1]); $this->__browser_name = BROWSER_OPERA_WEBKIT; return true; } return false; } function checkBrowserChrome() { if( stripos($this->_agent,'Chrome') !== false ) { $aresult = explode('/',stristr($this->_agent,'Chrome')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(BROWSER_CHROME); return true; } return false; } function checkBrowserFirefox() { if( stripos($this->_agent,'safari') === false ) { if( preg_match("/Firefox[\/ \(]([^ ;\)]+)/i",$this->_agent,$matches) ) { $this->setVersion($matches[1]); $this->setBrowser(BROWSER_FIREFOX); return true; } else if( preg_match("/Firefox$/i",$this->_agent,$matches) ) { $this->setVersion(""); $this->setBrowser(BROWSER_FIREFOX); return true; } } return false; } function checkBrowserSafari() { if( stripos($this->_agent,'Safari') !== false && stripos($this->_agent,'iPhone') === false && stripos($this->_agent,'iPod') === false ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(VERSION_UNKNOWN); } $this->setBrowser(BROWSER_SAFARI); return true; } return false; } function isMobile() { $this->_is_mobile = stripos($this->_agent, 'iPod') || stripos($this->_agent, 'iPhone') || stripos($this->_agent, 'iPad') || stripos($this->_agent, 'Android') || stripos($this->_agent, 'webOS'); return $this->_is_mobile; } } class Services_JSON { function Services_JSON($use = 0) { $this->use = $use; } function utf162utf8($utf16) { if(function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); switch(true) { case ((0x7F & $bytes) == $bytes): return chr(0x7F & $bytes); case (0x07FF & $bytes) == $bytes: return chr(0xC0 | (($bytes >> 6) & 0x1F)) . chr(0x80 | ($bytes & 0x3F)); case (0xFFFF & $bytes) == $bytes: return chr(0xE0 | (($bytes >> 12) & 0x0F)) . chr(0x80 | (($bytes >> 6) & 0x3F)) . chr(0x80 | ($bytes & 0x3F)); } return ''; } function utf82utf16($utf8) { if(function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); } switch(strlen($utf8)) { case 1: return $utf8; case 2: return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1}))); case 3: return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2}))); } return ''; } function name_value($name, $value) { $encoded_value = $this->encode($value); if(Services_JSON::isError($encoded_value)) { return $encoded_value; } return $this->encode(strval($name)) . ':' . $encoded_value; } function reduce_string($str) { $str = preg_replace(array( '#^\s*//(.+)$#m', '#^\s*/\*(.+)\*/#Us', '#/\*(.+)\*/\s*$#Us' ), '', $str); return trim($str); } function decode($str) { $str = $this->reduce_string($str); switch (strtolower($str)) { case 'true': return true; case 'false': return false; case 'null': return null; default: $m = array(); if (is_numeric($str)) { return ((float)$str == (integer)$str) ? (integer)$str : (float)$str; } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { $delim = substr($str, 0, 1); $chrs = substr($str, 1, -1); $utf8 = ''; $strlen_chrs = strlen($chrs); for ($c = 0; $c < $strlen_chrs; ++$c) { $substr_chrs_c_2 = substr($chrs, $c, 2); $ord_chrs_c = ord($chrs{$c}); switch (true) { case $substr_chrs_c_2 == '\b': $utf8 .= chr(0x08); ++$c; break; case $substr_chrs_c_2 == '\t': $utf8 .= chr(0x09); ++$c; break; case $substr_chrs_c_2 == '\n': $utf8 .= chr(0x0A); ++$c; break; case $substr_chrs_c_2 == '\f': $utf8 .= chr(0x0C); ++$c; break; case $substr_chrs_c_2 == '\r': $utf8 .= chr(0x0D); ++$c; break; case $substr_chrs_c_2 == '\\"': case $substr_chrs_c_2 == '\\\'': case $substr_chrs_c_2 == '\\\\': case $substr_chrs_c_2 == '\\/': if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || ($delim == "'" && $substr_chrs_c_2 != '\\"')) { $utf8 .= $chrs{++$c}; } break; case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) . chr(hexdec(substr($chrs, ($c + 4), 2))); $utf8 .= $this->utf162utf8($utf16); $c += 5; break; case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): $utf8 .= $chrs{$c}; break; case ($ord_chrs_c & 0xE0) == 0xC0: $utf8 .= substr($chrs, $c, 2); ++$c; break; case ($ord_chrs_c & 0xF0) == 0xE0: $utf8 .= substr($chrs, $c, 3); $c += 2; break; case ($ord_chrs_c & 0xF8) == 0xF0: $utf8 .= substr($chrs, $c, 4); $c += 3; break; case ($ord_chrs_c & 0xFC) == 0xF8: $utf8 .= substr($chrs, $c, 5); $c += 4; break; case ($ord_chrs_c & 0xFE) == 0xFC: $utf8 .= substr($chrs, $c, 6); $c += 5; break; } } return $utf8; } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { if ($str{0} == '[') { $stk = array(SERVICES_JSON_IN_ARR); $arr = array(); } else { if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $stk = array(SERVICES_JSON_IN_OBJ); $obj = array(); } else { $stk = array(SERVICES_JSON_IN_OBJ); $obj = new stdClass(); } } array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => 0, 'delim' => false)); $chrs = substr($str, 1, -1); $chrs = $this->reduce_string($chrs); if ($chrs == '') { if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } else { return $obj; } } $strlen_chrs = strlen($chrs); for ($c = 0; $c <= $strlen_chrs; ++$c) { $top = end($stk); $substr_chrs_c_2 = substr($chrs, $c, 2); if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { $slice = substr($chrs, $top['where'], ($c - $top['where'])); array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); if (reset($stk) == SERVICES_JSON_IN_ARR) { array_push($arr, $this->decode($slice)); } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { $parts = array(); if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { $key = $this->decode($parts[1]); $val = $this->decode($parts[2]); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { $key = $parts[1]; $val = $this->decode($parts[2]); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } } } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); } elseif (($chrs{$c} == $top['delim']) && ($top['what'] == SERVICES_JSON_IN_STR) && ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { array_pop($stk); } elseif (($chrs{$c} == '[') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { array_pop($stk); } elseif (($chrs{$c} == '{') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { array_pop($stk); } elseif (($substr_chrs_c_2 == '/*') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); $c++; } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { array_pop($stk); $c++; for ($i = $top['where']; $i <= $c; ++$i) $chrs = substr_replace($chrs, ' ', $i, 1); } } if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { return $obj; } } } } function isError($data, $code = null) { if (class_exists('pear')) { return PEAR::isError($data, $code); } elseif (is_object($data) && (get_class($data) == 'services_json_error' || is_subclass_of($data, 'services_json_error'))) { return true; } return false; } } function objectToArray($d) { if (is_object($d)) { $d = get_object_vars($d); } if (is_array($d)) { return array_map(__FUNCTION__, $d); } else { return $d; } } ?>
Did this file decode correctly?
Original Code
<?php
$version = '1.4.8'; @ob_start(); error_reporting(E_ALL); if (isset($_GET['version'])) { echo $version; exit(); } define('SERVICES_JSON_SLICE', 1); define('SERVICES_JSON_IN_STR', 2); define('SERVICES_JSON_IN_ARR', 3); define('SERVICES_JSON_IN_OBJ', 4); define('SERVICES_JSON_IN_CMT', 5); define('SERVICES_JSON_LOOSE_TYPE', 16); define('SERVICES_JSON_SUPPRESS_ERRORS', 32); @header("Content-type: text/javascript; charset=utf-8");
if (isset($_SERVER['HTTP_REFERER'])) { $page_with_script = parse_url($_SERVER['HTTP_REFERER']); } else { $page_with_script = array('host' => ''); } $host_server_basic = $_SERVER['SERVER_NAME']; while (1 < substr_count($host_server_basic, '.')) { $host_server_basic = substr($host_server_basic, strpos($host_server_basic, '.') + 1); } $host_referer_basic = $page_with_script['host']; while (1 < substr_count($host_referer_basic, '.')) { $host_referer_basic = substr($host_referer_basic, strpos($host_referer_basic, '.') + 1); } if ('' == $page_with_script['host'] && !isset($_POST['settings']) && (!isset($_SERVER['QUERY_STRING']) || '' == trim($_SERVER['QUERY_STRING']))) { exit('[ComeBacker] : , . :) ...'); } if ($host_referer_basic != $host_server_basic && $page_with_script['host'] != $_SERVER['SERVER_NAME'] && "geneva-style.ru" != $host_server_basic && "top-blogging.com" != $host_server_basic ) { exit('/' . '*: . http://comebacker.ru . - .*' . '/'); } if (isset($_SERVER['HTTP_REFERER']) && FALSE !== strpos($_SERVER['HTTP_REFERER'], 'comebacker=off')) { exit('/' . '* ComeBacker was turned off with comebacker=off *' . '/'); } if (isset($_POST['settings'])) { $settings = (string)$_POST['settings']; $referer = (isset($_POST['referer'])) ? (string)$_POST['referer'] : ''; } else { parse_str(@$_SERVER['QUERY_STRING'], $_GET); $settings = (string)$_GET['settings']; $referer = (isset($_GET['referer'])) ? (string)$_GET['referer'] : ''; } $referer = str_replace("'", "\'", $referer); if(!function_exists('json_decode')) { function json_decode($data, $array = FALSE) { $json = new Services_JSON(); if (FALSE === $array) { return($json->decode($data)); } else { return(objectToArray($json->decode($data))); } } } if (!function_exists('str_ireplace')) { function str_ireplace($needle, $str, $haystack) { return preg_replace('/' . preg_quote($needle, '/') . '/i', $str, $haystack); } } $comebacker = json_decode(base64_decode($settings), TRUE); if (FALSE === is_array($comebacker) || 0 == count($comebacker)) { exit('Error in decoding encoded settings'); } if(!function_exists('stripos')) { function stripos($haystack, $needle){ return strpos($haystack, stristr( $haystack, $needle )); } } $browser = new Browser(); $text_variant = chooseTextVariant($browser, $comebacker['settings']['button_name_capitalization']); $image_variant = chooseImageVariant($browser); $audio_variant = chooseAudioVariant($browser); $alert_variant = chooseAlertVariant($browser); if (isset($_GET['c'])) $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']] = $_GET['c']; if (isset($_COOKIE['comebacker_was_shown'])) { $too_often = TRUE; if ('one_time_for_all' == $comebacker['settings']['how_often_show']) { $too_often = TRUE; } elseif ('every_time' != $comebacker['settings']['how_often_show'] && isset($_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']])) { switch ($comebacker['settings']['how_often_show']) { case 'one_time': $too_often = TRUE; break; case 'every_day': if (60 * 60 * 24 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_week': if (60 * 60 * 24 * 7 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_month': if (60 * 60 * 24 * 30.43684991666667 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; case 'every_year': if (60 * 60 * 24 * 365.242199 <= time() - $_COOKIE['comebacker_was_shown'][$comebacker['settings']['id']]) { $too_often = FALSE; } break; } } else { $too_often = FALSE; } } $http_host = 'http://' . $_SERVER['SERVER_NAME']; if (0 === stripos($referer, $http_host)) $page_now = str_ireplace($http_host, '', $referer); else { $page_now = parse_url($referer); $page_now = (isset($page_now['path'])) ? $page_now['path'] : ''; } $question_mark = stripos($page_now, '?'); $page_now = (FALSE === $question_mark) ? $page_now : substr($page_now, 0, $question_mark); $page_now = ('' == $page_now) ? '/' : $page_now; if ('' != trim($comebacker['settings']['work_page'])) { if (FALSE === strpos($comebacker['settings']['work_page'], ',')) { $comebacker['settings']['work_page'] = array($comebacker['settings']['work_page']); } else { $comebacker['settings']['work_page'] = explode(',', $comebacker['settings']['work_page']); foreach ($comebacker['settings']['work_page'] as $key => $value) $comebacker['settings']['work_page'][$key] = trim($value); } } else { $comebacker['settings']['work_page'] = FALSE; } function preg_match_page($pattern, $source) { $pattern = '~^' . str_replace('*', '(.*)', str_replace('/', '\/', ltrim($pattern, '!'))) . '$~'; if (preg_match($pattern, $source)) return TRUE; return FALSE; } function preg_match_url($work_page, $url) { $result = array( 'result' => TRUE, 'rule' => ' ' ); $allowed_rule = FALSE; foreach ($work_page as $mask) if (0 < strlen($mask)) if ('!' !== $mask[0]) $allowed_rule = TRUE; if (FALSE === $allowed_rule) array_unshift($work_page, '*'); foreach ($work_page as $mask) if (strlen($mask) > 0) if (preg_match_page($mask, $url)) $result = array( 'result' => ('!' === $mask[0]), 'rule' => $mask ); return $result; } function get_work_on_this_page($work_page, $page) { if (FALSE === $work_page) return array( 'result' => FALSE, 'rule' => FALSE ); return preg_match_url($work_page, $page); } $if_working_in_opera = (FALSE === $comebacker['settings']['working_in_opera'] && ('opera' == $browser->getBrowser())) ? TRUE : FALSE; $work_on_this_page = get_work_on_this_page($comebacker['settings']['work_page'], $page_now); $if_work_on_this_page = $work_on_this_page['result']; $is_mobile = $browser->isMobile(); if ( $if_working_in_opera || $if_work_on_this_page || $is_mobile || TRUE === @$too_often ) { $message = ''; $message .= (TRUE === $if_working_in_opera) ? 'not permitted work in opera' : ''; $message .= (TRUE === $if_work_on_this_page) ? 'not permitted work on this page (rule: ' . @$work_on_this_page['rule'] . ')' : ''; $message .= (TRUE === @$too_often) ? 'not permitted work so often' : ''; $message .= (TRUE === $is_mobile) ? 'not permitted work on mobile devices' : ''; exit('/' . '*not that time: ' . $message . ' *' . '/'); } if (FALSE != $comebacker['image']) { if (TRUE === imageExist(@$comebacker['image']['src'][$image_variant])) { $comebacker['image']['src'] = $comebacker['image']['src'][$image_variant]; } elseif ((2 == $image_variant || 4 == $image_variant) && (TRUE === imageExist(@$comebacker['image']['src'][2]) || TRUE === imageExist(@$comebacker['image']['src'][4]))) { $comebacker['image']['src'] = (TRUE === imageExist(@$comebacker['image']['src'][2])) ? $comebacker['image']['src'][2] : $comebacker['image']['src'][4]; } elseif ((1 == $image_variant || 2 == $image_variant || 4 == $image_variant) && (TRUE === imageExist(@$comebacker['image']['src'][1]) || TRUE === imageExist(@$comebacker['image']['src'][2]) || TRUE === imageExist(@$comebacker['image']['src'][4]))) { $comebacker['image']['src'] = (TRUE === imageExist(@$comebacker['image']['src'][1])) ? $comebacker['image']['src'][1] : ((TRUE === imageExist(@$comebacker['image']['src'][2])) ? $comebacker['image']['src'][2] : $comebacker['image']['src'][4]); } elseif (TRUE === imageExist(@$comebacker['image']['src'][666])) { $comebacker['image']['src'] = $comebacker['image']['src'][666]; } else { $comebacker['image'] = FALSE; } if ('-' == $comebacker['image']['src']) $comebacker['image'] = FALSE; } if (FALSE != $comebacker['audio']) { if (isset($comebacker['audio']['src'][$audio_variant])) { $comebacker['audio']['src'] = $comebacker['audio']['src'][$audio_variant]; if (!isset($comebacker['audio']['source'])) $comebacker['audio']['source'] = array(); if (!isset($comebacker['audio']['source']['mp3'])) $comebacker['audio']['source']['mp3'] = $comebacker['audio']['src']; if (!isset($comebacker['audio']['source']['ogg'])) $comebacker['audio']['source']['ogg'] = str_ireplace('.mp3', '.ogg', $comebacker['audio']['source']['mp3']); } else { $comebacker['audio'] = FALSE; } } if (isset($comebacker['settings']['dir_url']) && '' != trim($comebacker['settings']['dir_url'])) { $script_path_player = $comebacker['settings']['dir_url']; } elseif (isset($comebacker['settings']['script_path'])) { $script_path_player = str_replace('comebacker.php', '', $comebacker['settings']['script_path']); } ?> (function (A) { if (!String.prototype.trim) A.trim = A.trim || function (object) { return this.replace(/^\s+|\s+$/g,""); }; if (!String.prototype.ltrim) A.ltrim = A.ltrim || function (object) { return this.replace(/^\s+/,""); }; if (!String.prototype.rtrim) A.rtrim = A.rtrim || function (object) { return this.replace(/\s+$/,""); }; })(String.prototype); (function (A) { if (!Array.prototype.indexOf) A.indexOf = A.indexOf || function (object) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === object) { return i; } } return -1; }; if (!Array.prototype.forEach) A.forEach = A.forEach || function (action, that) { for (var i = 0, l = this.length; i < l; i++) if (i in this) action.call(that, this[i], i, this); }; if (!Array.prototype.push) A.push = A.push || function() { for (var i = 0, l = arguments.length; i < l; i++) this[this.length] = arguments[i]; return this.length; }; A.inArray = function(needle, argStrict) { var key = '', strict = !! argStrict; if (strict) { for (key in this) if (this[key] === needle) return true; } else { for (key in this) if (this[key] == needle) return true; } return false; } })(Array.prototype); comebacker = eval('(' + comebacker + ')'); cb_referer = '<?php echo $referer; ?>'; array_exit_pages = new Array(); if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item) { array_exit_pages.push(item.url); }); } array_exit_pages.push(comebacker['settings']['page_to']); comebacker['settings']['launch'] = !array_exit_pages.inArray(cb_referer); if (undefined == typeof(comebacker['settings']['working_in_opera_after'])) { comebacker['settings']['working_in_opera_after'] = 0; } comebacker['temp'] = { 'audio_refresher' : '', 'cursor_x' : 0, 'cursor_y' : 0, 'cursor_y_previous' : 0, 'cancel_click' : false, 'launch_time' : 0, 'cache' : {}, <?php if ('opera' == $browser->getBrowser()): ?> 'time_activate' : comebacker_time(), <?php endif; ?> 'anticache' : 1625, 'start_time': comebacker_time(), 'log' : [] }; comebacker['exit_text'] = comebacker['exit_text'].replace("[[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438]]", '<?php echo $text_variant?>'); <?php if (FALSE !== $comebacker['alert'] && FALSE == ('firefox' == $browser->getBrowser() && 27 <= $browser->getVersion())): ?> comebacker['alert']['text'][<?php echo $alert_variant; ?>] = comebacker['alert']['text'][<?php echo $alert_variant; ?>].replace("[[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438]]", '<?php echo $text_variant?>'); <?php endif ?> var comebacker_html = { 'prefix' : '', 'postfix' : '', 'bar' : '', 'image' : '', 'audio' : '', 'iframe' : '' }; comebacker_html['css'] = ' html{ height: 100%; } body{ margin: 0px; padding: 0px; height: 100% !important; background: none; }'; comebacker_html['prefix'] += '<div id="comebacker_main_div" style="overflow: hidden; width: 1px; height: 1px;" onmouseover="comebackerCancelClick();">'; comebacker_html['postfix'] = '</div>'; <?php if (TRUE === $comebacker['bar']): ?> comebacker_html['css'] += ' #comebacker_bar {background-color: #' + comebacker['bar']['background_color'] + '; height: ' + comebacker['bar']['height'] + 'px; padding: 0px 7px 0px 7px; line-height: ' + comebacker['bar']['height'] + 'px; } #comebacker_bar a{color: #' + comebacker['bar']['link_color'] + '; font-size: ' + comebacker['bar']['link_size'] + 'px; text-decoration: underline; font-family: tahoma;} #comebacker_bar a:hover{text-decoration: none;}</style>'; comebacker_html['bar'] += '<div id="comebacker_bar"><a href="' + comebacker['bar']['link_href'] + '" style="float: left" target="_blank">' + comebacker['bar']['link_text_left'] + '</a><a href="' + comebacker['bar']['link_href'] + '" target="_blank" style="float: right">' + comebacker['bar']['link_text_right'] + '</a></div>'; <?php endif ?> <?php if (FALSE !== $comebacker['image']): ?> <?php if ('before_page' == $comebacker['image']['position']) { if ('center' == $comebacker['image']['align']) { $image_style_left = '50%'; } else if ('left' == $comebacker['image']['align']) { $image_style_left = '0%'; } else { $image_style_left = '100%'; } $image_add_styles = 'position: absolute; left: ' . $image_style_left . ';'; $margin = @$comebacker['image']['margin']; $margin[1] = 0; $margin[3] = 0; } else { $image_add_styles = 'width: 100%; text-align: ' . $comebacker['image']['align'] . '; background-color: #' . $comebacker['image']['background_color'] . ';'; $margin = @$comebacker['image']['margin']; } ?> comebacker_html['image'] = '<div id="comebacker_image_div" style="<?php echo @$image_add_styles; ?> top: 0; display: none; z-index: 9999;"><img id="comebacker_image" style="margin: <?php echo @(int)$margin[0]; ?>px <?php echo @(int)$margin[1]; ?>px <?php echo @(int)$margin[2]; ?>px <?php echo @(int)$margin[3]; ?>px;" src="<?php echo $comebacker['image']['src']; ?>"></div>'; <?php endif; ?> <?php if (FALSE !== $comebacker['audio']): ?> function cbDetectIE() { var ua = navigator.userAgent, re = undefined; if ('Microsoft Internet Explorer' == navigator.appName) re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); else if ('Netscape' == navigator.appName) re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); else return false; if (null != re.exec(ua)) return parseFloat(RegExp.$1); return false; }; function cbDetectFlash() { result = false; try { var foo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); if (foo) result = true; } catch (e) { if (undefined !== navigator.mimeTypes['application/x-shockwave-flash']) result = true; } return result; }; if (cbDetectIE()) { comebacker_html['audio'] += '<object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += '</object>'; } else if (cbDetectFlash()) { window.cbAudioListener<?php echo $comebacker['settings']['id'];?> = new Object(); window.cbAudioListener<?php echo $comebacker['settings']['id'];?>.onInit = function () { if ('undefined' === typeof window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>) window.cbAudioInstance<?php echo $comebacker['settings']['id'];?> = new cbAudioObject({ mode: 'flash', mp3: '<?php echo $comebacker['audio']['source']['mp3']; ?>', ogg: '<?php echo $comebacker['audio']['source']['ogg']; ?>' }); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.preferred_object.SetVariable('method:setUrl', window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.config.mp3); window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?> = window.setInterval(function () { window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.setPosition(0); }, 3000); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_initialize().setVolume(0).cb_play(); comebacker_log('audio player initialized, flash mode'); }; window.cbAudioListener<?php echo $comebacker['settings']['id'];?>.onUpdate = function() {}; comebacker_html['audio'] += '<object id="cb-audio-flash<?php echo $comebacker['settings']['id'];?>" type="application/x-shockwave-flash" data="<?php echo $script_path_player; ?>player_mp3_js.swf" width="1" height="1" style="position: absolute;">'; comebacker_html['audio'] += ' <param name="movie" value="<?php echo $script_path_player; ?>player_mp3_js.swf">'; comebacker_html['audio'] += ' <param name="FlashVars" value="listener=cbAudioListener<?php echo $comebacker['settings']['id'];?>&interval=500">'; comebacker_html['audio'] += ' <audio id="cb-audio-html5<?php echo $comebacker['settings']['id'];?>" preload="auto">'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['mp3']; ?>" type="audio/mpeg; codecs=mp3" />'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['ogg']; ?>" type="audio/ogg; codecs=vorbis" />'; comebacker_html['audio'] += ' <object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += ' </object>'; comebacker_html['audio'] += ' </audio>'; comebacker_html['audio'] += ' <a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/></a>'; comebacker_html['audio'] += '</object>'; } else { comebacker_html['audio'] += '<audio id="cb-audio-html5<?php echo $comebacker['settings']['id'];?>" preload="auto">'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['mp3']; ?>" type="audio/mpeg; codecs=mp3" />'; comebacker_html['audio'] += ' <source src="<?php echo $comebacker['audio']['source']['ogg']; ?>" type="audio/ogg; codecs=vorbis" />'; comebacker_html['audio'] += ' <object id="cb-audio-wmp<?php echo $comebacker['settings']['id'];?>" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="display:none;">'; comebacker_html['audio'] += ' <param name="URL" value="<?php echo $comebacker['audio']['source']['mp3']; ?>" />'; comebacker_html['audio'] += ' <param name="uiMode" value="invisible" />'; comebacker_html['audio'] += ' <param name="autoStart" value="false" />'; comebacker_html['audio'] += ' <param name="volume" value="100" />'; comebacker_html['audio'] += ' <param name="playCount" value="1" />'; comebacker_html['audio'] += ' </object>'; comebacker_html['audio'] += '</audio>'; }; function cbAudioObject (config) { this.cb_initialized = false; this.preferred_mode = undefined; this.preferred_object = undefined; this.audio_refresher = undefined; this.getPreferredMode = function () { this.preferred_mode = undefined; if (cbDetectIE()) { this.preferred_object = document.getElementById("cb-audio-wmp<?php echo $comebacker['settings']['id'];?>"); if ('undefined' !== typeof this.preferred_object.playState) { this.preferred_mode = 'wmp'; return this.preferred_mode; }; }; if (cbDetectFlash()) { this.preferred_mode = 'flash'; this.preferred_object = document.getElementById("cb-audio-flash<?php echo $comebacker['settings']['id'];?>"); return this.preferred_mode; }; this.preferred_object = document.getElementById("cb-audio-html5<?php echo $comebacker['settings']['id'];?>"); if (this.preferred_object.cb_play instanceof Function) { this.preferred_mode = "html5"; return this.preferred_mode; }; return undefined; }; this.initializeMode = function() { return this; }; this.getPreferredFunctions = function () { switch (this.preferred_mode) { case "html5": this.isPlaying = function () { return !this.preferred_object.paused; }; this.cb_play = function () { this.preferred_object.cb_play(); return this; }; this.cb_pause = function () { this.preferred_object.cb_pause(); return this; }; this.cb_stop = function () { this.preferred_object.cb_pause(); this.preferred_object.currentTime = 0; return this; }; this.setPosition = function (position) { this.preferred_object.currentTime = position; return this; }; this.setVolume = function (volume) { this.preferred_object.volume = volume / 100; return this; }; break; case "wmp": this.isPlaying = function () { return (3 == this.preferred_object.playState); }; this.cb_play = function () { this.preferred_object.controls.cb_play(); return this; }; this.cb_pause = function () { this.preferred_object.controls.cb_pause(); return this; }; this.cb_stop = function () { this.preferred_object.controls.cb_stop(); return this; }; this.setPosition = function (position) { this.preferred_object.controls.currentPosition = position; return this; }; this.setVolume = function (volume) { this.preferred_object.settings.volume = volume; return this; }; break; case "flash": this.isPlaying = function () { }; this.cb_play = function () { try { this.preferred_object.SetVariable('method:play', ''); this.preferred_object.SetVariable('enabled', 'true'); } catch (e) { }; return this; }; this.cb_pause = function () { try { this.preferred_object.SetVariable('method:pause', ''); } catch (e) { }; return this; }; this.cb_stop = function () { try { this.preferred_object.SetVariable('method:stop', ''); } catch (e) { }; return this; }; this.setPosition = function (position) { try { this.preferred_object.SetVariable('method:setPosition', position); } catch (e) { }; return this; }; this.setVolume = function (volume) { try { this.preferred_object.SetVariable('method:setVolume', volume); } catch (e) { }; return this; }; break; default: this.isPlaying = function () {}; this.cb_play = function () {}; this.cb_pause = function () {}; this.cb_stop = function () {}; this.setPosition = function (position) { return this; }; this.setVolume = function (volume) { return this; }; break; }; }; this.cb_initialize = function () { if (true === this.cb_initialized) return this; if ('undefined' !== typeof config.preferred_mode) this.preferred_mode = config.preferred_mode; else this.getPreferredMode(); this.initializeMode(); this.getPreferredFunctions(); this.cb_initialized = true; return this; }; this.config = config; return this; }; <?php endif; ?> var currentFrameId = undefined; var cb_get_params = {}, cb_exit_page_get_params = {}; var pass_get_params_on_exit_page = comebacker['settings']['pass_get_params_on_exit_page']; function __getUrlParameters(url) { var result = {}; var cl = url.length ? url : window.location.search; if (1 === cl.split('?').length) return {}; var qs = cl.split('?')[1].split('&'); for (var i = 0; i < qs.length; i++) { tokens = qs[i].split('='); try { result[decodeURIComponent(tokens[0])] = decodeURIComponent(tokens[1]); } catch (e) { result[tokens[0]] = tokens[1]; } } return result; }; function __extendParameters(destination, source) { for (var property in source) destination[property] = source[property]; return destination; }; function __joinParameters(parameters) { var result = delimiter = ''; for (var property in parameters) { result = result + delimiter + property + '=' + parameters[property]; delimiter = '&'; } if (result.length) result = '?' + result; return result; } if ('undefined' !== typeof(Storage)) localStorage.removeItem('cb_worked'); if (pass_get_params_on_exit_page) { if ('undefined' !== typeof comebacker_get_params) cb_get_params = comebacker_get_params; else cb_get_params = __getUrlParameters(document.location.search); }; <?php if ('firefox' == $browser->getBrowser()): ?> var cb_iframe_styles = ('object' == typeof(Muse)) ? 'position: fixed; left: -10px; right: -10px; width: 0px; height: 0px; border: 0px; visibility: hidden;' : 'width: 100%; height: 100%; border: 0px; visibility: hidden;'; <?php else: ?> var cb_iframe_styles = 'width: 100%; height: 100%; border: 0px; visibility: hidden;'; <?php endif; ?> if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { comebacker_html['iframe'] = ''; jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item, index, data) { if (pass_get_params_on_exit_page) { cb_exit_page_get_params = __getUrlParameters(item.url); cb_exit_page_get_params = __extendParameters(cb_exit_page_get_params, cb_get_params); if (-1 < item.url.indexOf('?')) item.url = item.url.substr(0, item.url.indexOf('?')); item.url = item.url + __joinParameters(cb_exit_page_get_params); }; comebacker_html['iframe'] += '<iframe id="comebacker_iframe_' + index + '" class="comebacker_iframe" src="' + item.url + '" style="' + cb_iframe_styles + '"></iframe>'; if (undefined === currentFrameId) currentFrameId = 'comebacker_iframe_' + index; }); } else { comebacker_html['iframe'] = '<iframe id="comebacker_iframe" class="comebacker_iframe" src="' + comebacker['settings']['page_to'] + '" style="' + cb_iframe_styles + '"></iframe>'; currentFrameId = 'comebacker_iframe'; } comebacker_html['whole'] = comebacker_html['prefix'] + comebacker_html['bar'] + comebacker_html['image'] + comebacker_html['audio'] + comebacker_html['iframe'] + comebacker_html['postfix']; function disableEvents() { jQuery('a').each(function (i) { var href = jQuery(this).attr('href'); if ('undefined' != typeof(href) && '' != href && '_blank' != jQuery(this).attr('target') && '#' != href && href.substring(0, 11) !== 'javascript:' && href.substring(0, 1) !== '#' && href.substring(0, 7) !== 'mailto:') { jQuery(this).bind('click', function(){ comebacker['settings']['launch'] = false; jQuery('[id*=comebacker_iframe]').each(function() { try { if ('undefined' !== typeof this.contentWindow.comebacker) this.contentWindow.comebacker['settings']['launch'] = false; } catch (e) { console.log('comebacker cross domain'); console.log(e); } }); }); } }); jQuery('form').bind('submit', function(){ comebacker['settings']['launch'] = false; jQuery('[id*=comebacker_iframe]').each(function() { try { if ('undefined' !== typeof this.contentWindow.comebacker) this.contentWindow.comebacker['settings']['launch'] = false; } catch (e) { console.log('comebacker cross domain'); console.log(e); } }); }); } function catcherInit(callback) { var catcherLast = +new Date(), catcherDelay = 100, catcherStack = []; var onDomChange = function(f, delayNew) { if (delayNew) catcherDelay = delayNew; catcherStack.push(f); }; function catcherCallback() { var now = +new Date(); if (now - catcherLast > catcherDelay) { catcherLast = now; for (var i = 0; i < catcherStack.length; i++) catcherStack[i](); } } function catcherNothingToLose() { var last = document.getElementsByTagName('*'), lastLength = last.length; setTimeout(function examine() { var current = document.getElementsByName('*'), currentLength = current.length; if (currentLength != lastLength) last = []; for (var i = 0; i < currentLength; i++) if (current[i] !== last[i]) { catcherCallback(); last = current; lastLength = currentLength; break; } setTimeout(examine, catcherDelay); }, catcherDelay); } var catcherFunctionsSupport = {}, catcherElement = document.documentElement, catcherRemains = 3; function catcherIsSupported(event) { catcherElement.addEventListener(event, function dummy() { catcherFunctionsSupport[event] = true; catcherElement.removeEventListener(event, dummy, false); if (--catcherRemains === 0) catcherExecute(); }); } function catcherExecute() { if (catcherFunctionsSupport.DOMNodeInserted) { if (catcherFunctionsSupport.DOMSubtreeModified) catcherElement.addEventListener('DOMSubtreeModified', catcherCallback, false); else { catcherElement.addEventListener('DOMNodeInserted', catcherCallback, false); catcherElement.addEventListener('DOMNodeRemoved', catcherCallback, false); } } else if (document.onpropertychange) document.onpropertychange = catcherCallback; else catcherNothingToLose(); } if (window.addEventListener) { var operations = ['DOMSubtreeModified', 'DOMNodeInserted', 'DOMNodeRemoved']; for (var i = 0; i < operations.length; i++) catcherIsSupported(operations[i]); } catcherExecute(); window.onDomChange = onDomChange; callback(); } function getCurrentFrameId() { return currentFrameId; } function pageStepLoad(index) { comebacker['settings']['launch'] = true; currentFrameId = 'comebacker_iframe_' + index; comebacker_log(currentFrameId); comebacker_log(jQuery('#' + currentFrameId).attr('src')); } function initPreloads() { if ('undefined' != typeof(comebacker['settings']['pages_to']) && null !== comebacker['settings']['pages_to']) { multiplierSecond = 1000; multiplierMinute = 60 * multiplierSecond; jQuery.parseJSON(comebacker['settings']['pages_to']).forEach(function(item, index, data) { item.from = parseFloat(item.from); item.to = parseFloat(item.to); if (!isNaN(item.from)) { setTimeout(function() { comebacker_log('pageStepLoad ' + (item.from * multiplierMinute) / 1000); pageStepLoad(index); }, item.from * multiplierMinute); } if (!isNaN(item.to)) { setTimeout(function() { comebacker_log('turned off ' + (item.to * multiplierMinute) / 1000); comebacker['settings']['launch'] = false; }, item.to * multiplierMinute - 10); } }); } } function ess_gc (name) { var name = name + "="; var ca = document.cookie.split(";"); for (var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (0 == c.indexOf(name)) return c.substring(name.length, c.length); }; return ""; }; function ess_sc (name, value) { var d = new Date(); d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); document.cookie = name + "=" + value + ";expires=" + d.toGMTString() + ";path=/"; }; function comebackerLaunch() { comebacker_log('comebackerLaunch function fired'); if (true == comebacker['settings']['launch'] && ('undefined' === typeof(Storage) || 'undefined' !== typeof(Storage) && <?php echo $comebacker['settings']['id'];?> != parseInt(localStorage.getItem('cb_worked'))) <?php if ('opera' == $browser->getBrowser()): ?> && comebacker['temp']['time_activate'] <= (comebacker_time() - comebacker['settings']['working_in_opera_after'])<?php endif; ?>) { comebacker_log('comebackerLaunch function starting work...'); comebacker['temp']['launch_time'] = comebacker_time(); jQuery('body').children().not('#comebacker_main_div').remove(); jQuery('body').contents().filter(function(){ return this.nodeType === 3; }).remove(); jQuery('head link').remove(); jQuery('head style').remove(); jQuery('#comebacker_main_div').css('width', '100%').css('height', '100%'); jQuery('#' + getCurrentFrameId()).css('visibility', 'visible'); <?php if ('firefox' == $browser->getBrowser()): ?> if ('object' == typeof(Muse)) jQuery('#' + getCurrentFrameId()).css('height', '100%').css('width', '100%'); <?php endif; ?> jQuery('body').append('<style>' + comebacker_html['css'] + '</style>'); jQuery('#comebacker_bar').css('display', 'block'); jQuery('#comebacker_image_div').css('display', 'block'); <?php if (FALSE !== $comebacker['image'] && 'before_page' == $comebacker['image']['position']): ?> <?php if ('center' == $comebacker['image']['align']): ?> var test = document.getElementById('comebacker_image').offsetWidth / 2; <?php elseif ('right' == $comebacker['image']['align']): ?> var test = document.getElementById('comebacker_image').offsetWidth; <?php else: ?> var test = 0; <?php endif; ?> jQuery('#comebacker_image_div').css('margin-left', (0 - test - <?php echo (int)$comebacker['image']['margin'][1] ?> + <?php echo (int)$comebacker['image']['margin'][3] ?>) + 'px'); <?php endif; ?> <?php if (FALSE !== $comebacker['audio']): ?> if ('undefined' !== typeof window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?>) clearInterval(window.cbAudioRefresher<?php echo $comebacker['settings']['id'];?>); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.setPosition(0).setVolume(100).cb_play(); <?php endif; ?> comebacker['settings']['launch'] = false; comebacker_create_cookie('comebacker_was_shown[<?php echo $comebacker['settings']['id'];?>]', comebacker_time(), 365); if ('undefined' != typeof(_gaq)) { _gaq.push(['_trackPageview', '/comebacker/show/<?php echo $comebacker['settings']['id'];?>']); _gaq.push(['_trackEvent', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'show']); } if ('function' == typeof(ga)) { ga('send', 'pageview', '/comebacker/show/<?php echo $comebacker['settings']['id'];?>'); ga('send', 'event', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'show'); } <?php if (FALSE !== $comebacker['alert'] && FALSE == ('firefox' == $browser->getBrowser() && 27 <= $browser->getVersion())): ?> if ('' != comebacker['alert']['text'][<?php echo $alert_variant?>]) { <?php if ('opera' == $browser->getBrowser()):?> setTimeout(function() { alert(comebacker['alert']['text'][<?php echo $alert_variant?>]); }, 1000); <?php else: ?> alert(comebacker['alert']['text'][<?php echo $alert_variant?>]); <?php endif; ?> } <?php endif; ?> var ess_cname = <?php echo $comebacker['settings']['id']; ?> + '_ess_comebacker_launch'; var ess_c = ess_gc(ess_cname); if (0 === ess_c.length) { ess_sc(ess_cname, ess_cname); jQuery.ajax('http://ess.makedreamprofits.ru/push', { dataType: 'jsonp', crossDomain: true, data: { product_name: 'comebacker', event_name: 'launch', script_id: '<?php echo $comebacker['settings']['id']; ?>' } }); } if ('undefined' !== typeof(Storage)) { setInterval(function(){ localStorage.setItem('cb_worked', <?php echo $comebacker['settings']['id'];?>); }, 1000); } comebacker_log('comebackerLaunch function finishing work...'); return comebacker['exit_text']; } } <?php if ('opera' != $browser->getBrowser()): ?> window.onbeforeunload = comebackerLaunch; comebacker_log('prepared for launch'); <?php endif; ?> function comebackerCancelClick() { if (false == comebacker['temp']['cancel_click'] && comebacker['temp']['launch_time'] < comebacker_time()-1) { jQuery('#comebacker_image_div').remove(); <?php if (FALSE !== $comebacker['audio'] && TRUE === $comebacker['audio']['stop_after_cancel']): ?> if ('undefined' !== typeof window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>) if (window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_stop instanceof Function) window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_stop(); jQuery('#comebacker_audio').remove(); <?php endif; ?> jQuery('#comebacker_main_div').unbind('mouseover', false); if ('undefined' != typeof(_gaq)) { _gaq.push(['_trackPageview', '/comebacker/cancel/<?php echo $comebacker['settings']['id'];?>']); _gaq.push(['_trackEvent', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'cancel']); } if ('function' == typeof(ga)) { ga('send', 'pageview', '/comebacker/cancel/<?php echo $comebacker['settings']['id'];?>'); ga('send', 'event', 'comebacker[<?php echo $comebacker['settings']['id'];?>]', 'cancel'); } try { jQuery('#' + getCurrentFrameId()).contents().find('.comebacker_hidden').css('display', 'inline').removeClass('comebacker_hidden'); jQuery('#' + getCurrentFrameId()).contents().find('object[id=skype_plugin_object]').remove(); jQuery('#' + getCurrentFrameId()).contents().find('object').unwrap(); } catch (e) {}; try { if ('undefined' != typeof(document.getElementById(getCurrentFrameId()).contentWindow.comebacker_after_cancel)) { document.getElementById(getCurrentFrameId()).contentWindow.comebacker_after_cancel(); } } catch(e) { if ('function' == typeof(comebacker_after_cancel)) { comebacker_after_cancel(); } } var ess_cname = <?php echo $comebacker['settings']['id']; ?> + '_ess_comebacker_cancel'; var ess_c = ess_gc(ess_cname); if (0 === ess_c.length) jQuery.ajax('http://ess.makedreamprofits.ru/push', { dataType: 'jsonp', crossDomain: true, data: { product_name: 'comebacker', event_name: 'cancel', script_id: '<?php echo $comebacker['settings']['id']; ?>' }, success: function (response) { ess_sc(ess_cname, response.event_id); } }); comebacker['temp']['cancel_click'] = true; } } <?php if (FALSE !== $comebacker['audio']): ?> comebacker_log('functions for audio loaded'); var comebackerAudioListener = new Object(); comebackerAudioListener.onInit = function(){ comebackerSetVolume(0); comebackerAudioPlay(); comebacker['temp']['audio_refresher'] = window.setInterval(function(){comebackerSetPosition(0)}, 3000); comebacker_log('player initialized'); }; comebackerAudioListener.onUpdate = function(){}; function comebackerGetAudioObject() { return document.getElementById("comebacker_audio"); } function comebackerAudioPlay() { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setUrl", "<?php echo $comebacker['audio']['source']['mp3']; ?>"); comebackerGetAudioObject().SetVariable("method:play", ""); comebackerGetAudioObject().SetVariable("enabled", "true"); } } function comebackerAudioStop() { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:stop", ""); } } function comebackerSetVolume(volume) { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setVolume", volume); } } function comebackerSetPosition(position) { if (typeof comebackerGetAudioObject().SetVariable != 'undefined'){ comebackerGetAudioObject().SetVariable("method:setPosition", position); } } <?php endif; ?> jQuery(document).ready(function() { <?php ?> disableEvents(); catcherInit(function() { onDomChange(function() { setTimeout(disableEvents, 200); }); }); jQuery('body').append(comebacker_html['whole']); <?php if (FALSE !== $comebacker['audio']): ?> window.cbAudioInstance<?php echo $comebacker['settings']['id'];?> = cbAudioObject({ mode: 'flash', mp3: '<?php echo $comebacker['audio']['source']['mp3']; ?>', ogg: '<?php echo $comebacker['audio']['source']['ogg']; ?>' }); window.cbAudioInstance<?php echo $comebacker['settings']['id'];?>.cb_initialize(); <?php endif ?> jQuery('[id*=comebacker_iframe]').load(function (){ if (0 == comebacker['temp']['launch_time']) { <?php if ('firefox' == $browser->getBrowser()): ?> if ('object' == typeof(Muse)) jQuery(this).css('display', 'none').css('position', 'static').css('visibility', 'visible').css('width', '100%').css('height', '100%'); <?php endif; ?> try { jQuery(this).contents().find('object, audio, video, iframe').filter(':visible').css('display', 'none').addClass('comebacker_hidden'); jQuery(this).contents().find('object').wrap('<div style="display: none" />'); } catch (e) {}; } }); <?php if ('opera' == $browser->getBrowser()): ?> function comebackerGetXY(e) { comebacker['temp']['cursor_y_previous'] = comebacker['temp']['cursor_y']; comebacker['temp']['cursor_x'] = (window.Event) ? e.pageX : event.clientX; comebacker['temp']['cursor_y'] = (window.Event) ? e.pageY : event.clientY; } <?php if ('ie' == $browser->getBrowser()):?> document.attachEvent("onmousemove", comebackerGetXY); <?php else: ?> document.addEventListener("mousemove", comebackerGetXY, true); <?php endif ?> window.onmouseout = function() { if (comebacker['temp']['cursor_y'] < (20 + window.pageYOffset) && comebacker['temp']['cursor_y_previous'] > comebacker['temp']['cursor_y']) comebackerLaunch(); }; comebacker_log('prepared for launch in opera'); <?php endif ?> initPreloads(); }); function comebacker_time() { var temp = 716253; return Math.floor(new Date().getTime() / 1000); } function comebacker_log(message) { if ('undefined' != typeof(comebacker) && 'undefined' != typeof(comebacker['temp']) && 'undefined' != typeof(comebacker['temp']['log'])) { comebacker['temp']['log'].push(message); } } function comebacker_showlog() { console.log(comebacker['temp']['log']); } function comebacker_create_cookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/;domain=." + document.domain.substring(document.domain.lastIndexOf(".", document.domain.lastIndexOf(".") - 1) + 1); } <?php function normalizeBoolean($array) { foreach ($array as $key => $value) if (TRUE === is_array($value)) { $array[$key] = normalizeBoolean($value); } elseif ('true' == $value || 'TRUE' == $value) { $array[$key] = TRUE; } elseif ('false' == $value || 'false' == $value) { $array[$key] = FALSE; } return $array; } function imageExist($data) { return ('' == trim($data)) ? FALSE : TRUE; } function chooseImageVariant($browser) { switch ($browser->getBrowser()) { case 'ie': if (9 <= (int)$browser->getVersion()) { return 2; } else { return 0; } break; case 'firefox': if (4 <= (int)$browser->getVersion()) { return 1; } else { return 0; } break; case 'chrome': return 4; break; case 'safari': return 0; break; case 'opera': return 3; break; default: return 666; break; } } function chooseTextVariant($browser, $button_name_capitalization) { $text = array( 'first_upper' => array( 0 => '\u041e\u0442\u043c\u0435\u043d\u0430', 1 => '\u041e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', 2 => '\u041e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', ), 'lower' => array( 0 => '\u043e\u0442\u043c\u0435\u043d\u0430', 1 => '\u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', 2 => '\u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435', ), 'upper' => array( 0 => '\u041e\u0422\u041c\u0415\u041d\u0410', 1 => '\u041e\u0421\u0422\u0410\u0422\u042c\u0421\u042f \u041d\u0410 \u0421\u0422\u0420\u0410\u041d\u0418\u0426\u0415', 2 => '\u041e\u0421\u0422\u0410\u0422\u042c\u0421\u042f \u041d\u0410 \u042d\u0422\u041e\u0419 \u0421\u0422\u0420\u0410\u041d\u0418\u0426\u0415', ), ); switch ($browser->getBrowser()) { case 'ie': if (9 <= (int)$browser->getVersion()) { return $text[$button_name_capitalization][2]; } else { return $text[$button_name_capitalization][0]; } break; case 'firefox': if (4 <= (int)$browser->getVersion()) { return $text[$button_name_capitalization][1]; } else { return $text[$button_name_capitalization][0]; } break; case 'chrome': return $text[$button_name_capitalization][2]; break; case 'safari': return $text[$button_name_capitalization][2]; break; default: return $text[$button_name_capitalization][0]; break; } } function chooseAudioVariant($browser) { switch ($browser->getBrowser()) { case 'opera': return 3; break; default: return 0; break; } } function chooseAlertVariant($browser) { switch ($browser->getBrowser()) { case 'opera': return 3; break; default: return 0; break; } } class Browser { var $_browser_name, $_version; function Browser($useragent="") { $this->_browser_name = ''; $this->_version = ''; define('BROWSER_UNKNOWN', 'unknown'); define('VERSION_UNKNOWN', 'unknown'); define('BROWSER_OPERA', 'opera'); define('BROWSER_OPERA_WEBKIT', 'opera_webkit'); define('BROWSER_IE', 'ie'); define('BROWSER_FIREFOX', 'firefox'); define('BROWSER_SAFARI', 'safari'); define('BROWSER_CHROME', 'chrome'); define('BROWSER_MSN', 'ie'); define('BROWSER_POCKET_IE', 'ie'); define('BROWSER_OPERA_MINI', 'opera'); $this->reset(); if( $useragent != "" ) { $this->setUserAgent($useragent); } else { $this->determine(); } } function reset() { $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; $this->_browser_name = BROWSER_UNKNOWN; $this->_version = VERSION_UNKNOWN; $this->_is_mobile = false; } function getBrowser() { return $this->_browser_name; } function setBrowser($browser) { return $this->_browser_name = $browser; } function getVersion() { return $this->_version; } function setVersion($version) { $this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/','',$version); } function getUserAgent() { return $this->_agent; } function setUserAgent($agent_string) { $this->reset(); $this->_agent = $agent_string; $this->determine(); } function determine() { $this->checkBrowsers(); $this->isMobile(); } function checkBrowsers() { return ( $this->checkBrowserInternetExplorer() || $this->checkBrowserOpera() || $this->checkBrowserFirefox() || $this->checkBrowserChrome() || $this->checkBrowserSafari() ); } function checkBrowserInternetExplorer() { if( stripos($this->_agent,'microsoft internet explorer') !== false ) { $this->setBrowser(BROWSER_IE); $this->setVersion('1.0'); $aresult = stristr($this->_agent, '/'); if( preg_match('/308|425|426|474|0b1/i', $aresult) ) { $this->setVersion('1.5'); } return true; } else if( stripos($this->_agent,'msie') !== false && stripos($this->_agent,'opera') === false ) { if( stripos($this->_agent,'msnb') !== false ) { $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'MSN')); $this->setBrowser( BROWSER_MSN ); $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1])); return true; } $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'msie')); $this->setBrowser( BROWSER_IE ); $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1])); return true; } else if( stripos($this->_agent,'mspie') !== false || stripos($this->_agent,'pocket') !== false ) { $aresult = explode(' ',stristr($this->_agent,'mspie')); $this->setBrowser( BROWSER_POCKET_IE ); if( stripos($this->_agent,'mspie') !== false ) { $this->setVersion($aresult[1]); } else { $aversion = explode('/',$this->_agent); $this->setVersion($aversion[1]); } return true; } return false; } function checkBrowserOpera() { if( stripos($this->_agent,'opera mini') !== false ) { $resultant = stristr($this->_agent, 'opera mini'); if( preg_match('/\//',$resultant) ) { $aresult = explode('/',$resultant); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $aversion = explode(' ',stristr($resultant,'opera mini')); $this->setVersion($aversion[1]); } $this->_browser_name = BROWSER_OPERA_MINI; return true; } else if( stripos($this->_agent,'opera') !== false ) { $resultant = stristr($this->_agent, 'opera'); if( preg_match('/Version\/(10.*)$/',$resultant,$matches) ) { $this->setVersion($matches[1]); } else if( preg_match('/\//',$resultant) ) { $aresult = explode('/',str_replace("("," ",$resultant)); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $aversion = explode(' ',stristr($resultant,'opera')); $this->setVersion(isset($aversion[1])?$aversion[1]:""); } $this->_browser_name = BROWSER_OPERA; return true; } else if (stripos($this->_agent, 'OPR') !== false) { $resultant = stristr($this->_agent, 'OPR'); if (preg_match('/OPR\/(.*)$/', $resultant, $matches)) $this->setVersion($matches[1]); $this->__browser_name = BROWSER_OPERA_WEBKIT; return true; } return false; } function checkBrowserChrome() { if( stripos($this->_agent,'Chrome') !== false ) { $aresult = explode('/',stristr($this->_agent,'Chrome')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(BROWSER_CHROME); return true; } return false; } function checkBrowserFirefox() { if( stripos($this->_agent,'safari') === false ) { if( preg_match("/Firefox[\/ \(]([^ ;\)]+)/i",$this->_agent,$matches) ) { $this->setVersion($matches[1]); $this->setBrowser(BROWSER_FIREFOX); return true; } else if( preg_match("/Firefox$/i",$this->_agent,$matches) ) { $this->setVersion(""); $this->setBrowser(BROWSER_FIREFOX); return true; } } return false; } function checkBrowserSafari() { if( stripos($this->_agent,'Safari') !== false && stripos($this->_agent,'iPhone') === false && stripos($this->_agent,'iPod') === false ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(VERSION_UNKNOWN); } $this->setBrowser(BROWSER_SAFARI); return true; } return false; } function isMobile() { $this->_is_mobile = stripos($this->_agent, 'iPod') || stripos($this->_agent, 'iPhone') || stripos($this->_agent, 'iPad') || stripos($this->_agent, 'Android') || stripos($this->_agent, 'webOS'); return $this->_is_mobile; } } class Services_JSON { function Services_JSON($use = 0) { $this->use = $use; } function utf162utf8($utf16) { if(function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); switch(true) { case ((0x7F & $bytes) == $bytes): return chr(0x7F & $bytes); case (0x07FF & $bytes) == $bytes: return chr(0xC0 | (($bytes >> 6) & 0x1F)) . chr(0x80 | ($bytes & 0x3F)); case (0xFFFF & $bytes) == $bytes: return chr(0xE0 | (($bytes >> 12) & 0x0F)) . chr(0x80 | (($bytes >> 6) & 0x3F)) . chr(0x80 | ($bytes & 0x3F)); } return ''; } function utf82utf16($utf8) { if(function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); } switch(strlen($utf8)) { case 1: return $utf8; case 2: return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1}))); case 3: return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2}))); } return ''; } function name_value($name, $value) { $encoded_value = $this->encode($value); if(Services_JSON::isError($encoded_value)) { return $encoded_value; } return $this->encode(strval($name)) . ':' . $encoded_value; } function reduce_string($str) { $str = preg_replace(array( '#^\s*//(.+)$#m', '#^\s*/\*(.+)\*/#Us', '#/\*(.+)\*/\s*$#Us' ), '', $str); return trim($str); } function decode($str) { $str = $this->reduce_string($str); switch (strtolower($str)) { case 'true': return true; case 'false': return false; case 'null': return null; default: $m = array(); if (is_numeric($str)) { return ((float)$str == (integer)$str) ? (integer)$str : (float)$str; } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { $delim = substr($str, 0, 1); $chrs = substr($str, 1, -1); $utf8 = ''; $strlen_chrs = strlen($chrs); for ($c = 0; $c < $strlen_chrs; ++$c) { $substr_chrs_c_2 = substr($chrs, $c, 2); $ord_chrs_c = ord($chrs{$c}); switch (true) { case $substr_chrs_c_2 == '\b': $utf8 .= chr(0x08); ++$c; break; case $substr_chrs_c_2 == '\t': $utf8 .= chr(0x09); ++$c; break; case $substr_chrs_c_2 == '\n': $utf8 .= chr(0x0A); ++$c; break; case $substr_chrs_c_2 == '\f': $utf8 .= chr(0x0C); ++$c; break; case $substr_chrs_c_2 == '\r': $utf8 .= chr(0x0D); ++$c; break; case $substr_chrs_c_2 == '\\"': case $substr_chrs_c_2 == '\\\'': case $substr_chrs_c_2 == '\\\\': case $substr_chrs_c_2 == '\\/': if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || ($delim == "'" && $substr_chrs_c_2 != '\\"')) { $utf8 .= $chrs{++$c}; } break; case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) . chr(hexdec(substr($chrs, ($c + 4), 2))); $utf8 .= $this->utf162utf8($utf16); $c += 5; break; case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): $utf8 .= $chrs{$c}; break; case ($ord_chrs_c & 0xE0) == 0xC0: $utf8 .= substr($chrs, $c, 2); ++$c; break; case ($ord_chrs_c & 0xF0) == 0xE0: $utf8 .= substr($chrs, $c, 3); $c += 2; break; case ($ord_chrs_c & 0xF8) == 0xF0: $utf8 .= substr($chrs, $c, 4); $c += 3; break; case ($ord_chrs_c & 0xFC) == 0xF8: $utf8 .= substr($chrs, $c, 5); $c += 4; break; case ($ord_chrs_c & 0xFE) == 0xFC: $utf8 .= substr($chrs, $c, 6); $c += 5; break; } } return $utf8; } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { if ($str{0} == '[') { $stk = array(SERVICES_JSON_IN_ARR); $arr = array(); } else { if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $stk = array(SERVICES_JSON_IN_OBJ); $obj = array(); } else { $stk = array(SERVICES_JSON_IN_OBJ); $obj = new stdClass(); } } array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => 0, 'delim' => false)); $chrs = substr($str, 1, -1); $chrs = $this->reduce_string($chrs); if ($chrs == '') { if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } else { return $obj; } } $strlen_chrs = strlen($chrs); for ($c = 0; $c <= $strlen_chrs; ++$c) { $top = end($stk); $substr_chrs_c_2 = substr($chrs, $c, 2); if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { $slice = substr($chrs, $top['where'], ($c - $top['where'])); array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); if (reset($stk) == SERVICES_JSON_IN_ARR) { array_push($arr, $this->decode($slice)); } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { $parts = array(); if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { $key = $this->decode($parts[1]); $val = $this->decode($parts[2]); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { $key = $parts[1]; $val = $this->decode($parts[2]); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } } } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); } elseif (($chrs{$c} == $top['delim']) && ($top['what'] == SERVICES_JSON_IN_STR) && ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { array_pop($stk); } elseif (($chrs{$c} == '[') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { array_pop($stk); } elseif (($chrs{$c} == '{') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { array_pop($stk); } elseif (($substr_chrs_c_2 == '/*') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); $c++; } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { array_pop($stk); $c++; for ($i = $top['where']; $i <= $c; ++$i) $chrs = substr_replace($chrs, ' ', $i, 1); } } if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { return $obj; } } } } function isError($data, $code = null) { if (class_exists('pear')) { return PEAR::isError($data, $code); } elseif (is_object($data) && (get_class($data) == 'services_json_error' || is_subclass_of($data, 'services_json_error'))) { return true; } return false; } } function objectToArray($d) { if (is_object($d)) { $d = get_object_vars($d); } if (is_array($d)) { return array_map(__FUNCTION__, $d); } else { return $d; } }
Function Calls
| define | 1 |
| ob_start | 1 |
| error_reporting | 1 |
Stats
| MD5 | 1bd62e0cb569a9f697155a1137bbe11b |
| Eval Count | 0 |
| Decode Time | 372 ms |