Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************/
- // Welcome to BlackHat CodeBreaker, Version 4.0
- // This script copyright 2009-2010, BlackHatCodeBreaker.com
- // For Personal Use Only:
- // You MAY install it on ALL of your sites and webpages - number is unlimited.
- // You MAY NOT install it on pages not owned by you, or pass it to others for their use.
- // Unauthorized duplication, distribution or use are STRICTLY FORBIDDEN.
- //
- // Join our Affiliate Program on
- // http://www.blackhatcodebreaker.com/affiliates.html
- //
- // Enjoy, prosper and profit!
- // Brad
- // BlackHatCodeBreaker.com
- /*****************************************************/
- /*USER CUSTOMIZABLE FIELDS */
- // 1. TEXT FIELDS (see section 3.3.1 in the manual)
- // HEADLINE
- var blocker_headline = 'Content Locked';
- // INSTRUCTIONAL TEXT ABOVE THE LINKS
- var blocker_instructionalText = 'To unlock and to access Premium Content on this page, just complete one of the following offers below. Once you have completed an offer, come back to this page to view the unlocked content.';
- // FOOTER TEXT BELOW THE LINKS
- var blocker_footerText = 'This page will automatically unlock after you fill out one of the above offers. This security measure is taken to avoid Bots and Leechers. Thank you for understanding!';
- // 2. TIMERS (see section 3.3.2 in the manual)
- // UNLOCKING TIMER, in Seconds
- var timeout_in_seconds_from_click = 45;
- // TEASE TIMER, in Seconds
- var tease_timer = 0;
- // COOKIE DURATION, in Days, Hours and Minutes
- var cookie_duration_days = 1000;
- var cookie_duration_hours = 0;
- var cookie_duration_minutes = 0;
- // 3. BASIC CONFIGURATION (see section 3.3.3 in the manual)
- // BHCB FILES PATH
- // The path to the directory holding all Blackhat Codebreaker files (lock.js, links.txt, goto.php, goto2.php, lock.png etc.)
- // The path must not have more than 90 characters
- // If the files are at the same place as the locked page, use:
- // var bhcb_files_path = '';
- // If they are at another directory, provide its path
- // For WordPress blogs I recommend using:
- // var bhcb_files_path = '/wp-content/plugins/bhcb/';
- var bhcb_files_path = '';
- // HIDE REFERRER ('YES' Hides Referrer, 'NO' Does not hide the referrer)
- var hide_referrer = 'NO';
- // UNLOCK ENTIRE SITE ('YES') OR JUST THIS DIRECTORY ('NO')
- var unlock_entire_site = 'NO';
- // RANDOMIZE CPA OFFERS ('YES'), and how many offer links to display when randomizing
- var random_link_rotation = 'YES';
- var number_of_links_to_display = 3;
- // TEST MODE ('NO' for operational pages, 'YES' when testing your setup, always return to 'NO' when you finish testing)
- var test_mode = 'NO';
- // BLOCK RIGHT CLICK MENU ('YES' disables right-click menu, 'NO' doesn't disable)
- var block_rightclick_menu = 'NO';
- // 4. LOOK AND FEEL (see section 3.3.4 in the manual)
- // POSITION AND WIDTH OF LOCK PANEL, in Pixels
- var panel_vertical_position = 100;
- var panel_width = 500;
- // BACKGROUND COLOR AND IMAGE
- // * background_color controls the background color of the lock panel. Value is given in Hex RGB.
- // For example, background_color = '#FFFF00' Will result in a Yellow background. Default is '#FFFFFF' (White)
- // * border_color controls the color of the lock panel's border. Value is given in Hex RGB. Default is '#CCCCCC' (Light Gray)
- // * background_image is the name of the background image to use in the lock panel. Default is 'lock.png' (the green padlock image)
- // * background_image_repeat specifies (images smaller than the lock panel) whether to repeat the image ('YES') or show it only once ('NO'). Default is 'NO'.
- var background_color = '#FFFFFF';
- var border_color = '#CCCCCC';
- var background_image = 'lock.png';
- var background_image_repeat = 'NO';
- // HAZE COLOR AND OPACITY
- // haze_color controls the haze covering your page content, in Hex RGB. Default is '#000000' (Black)
- // haze_opacity controls the opacity of the haze.
- // 0 is completely transparent, 100 is completely opaque. Default is 50
- var haze_color = '#000000';
- var haze_opacity = 50;
- // TEXT COLORS, in Hex RGB.
- // Defaults are: headline_color = '#466805' (GREENISH), instructionalText_color = '#000000' (BLACK),
- // footerText_color = '#000000' (BLACK) and links_color = '#0000FF' (BLUE)
- var headline_color = '#466805';
- var instructionalText_color = '#000000';
- var footerText_color = '#000000';
- var links_color = '#0000FF';
- /*END OF USER CUSTOMIZABLE FIELDS*/
- /******************************************************/
- function getFile(file) {
- oxmlhttp = null;
- try {
- oxmlhttp = new XMLHttpRequest();
- oxmlhttp['overrideMimeType']('text/xml');
- } catch (e) {
- try {
- oxmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
- } catch (e) {
- return null;
- };
- };
- if (!oxmlhttp) {
- return null;
- };
- try {
- oxmlhttp['open']('GET', file, false);
- oxmlhttp['send'](null);
- } catch (e) {
- return null;
- };
- return oxmlhttp['responseText'];
- };
- function randomizer(_0x3f24x4, _0x3f24x5) {
- var _0x3f24x6 = new Array();
- for (var i = 0; i < _0x3f24x5; i++) {
- _0x3f24x6[i] = i;
- };
- _0x3f24x6['sort'](function () {
- return (Math['round'](Math['random']()) - 0.5);
- });
- return _0x3f24x6;
- };
- if (block_rightclick_menu == 'YES') {
- var tenth = '';
- function ninth() {
- if (document['all']) {
- (tenth);
- return false;
- };
- };
- function twelfth(_0x3f24xb) {
- if (document['layers'] || (document['getElementById'] && !document['all'])) {
- if (_0x3f24xb['which'] == 2 || _0x3f24xb['which'] == 3) {
- (tenth);
- return false;
- };
- };
- };
- if (document['layers']) {
- document['captureEvents'](Event.MOUSEDOWN);
- document['onmousedown'] = twelfth;
- } else {
- document['onmouseup'] = twelfth;
- document['oncontextmenu'] = ninth;
- };
- document['oncontextmenu'] = new Function('return false');
- };
- var cpa_offer_links_file = 'links.txt';
- var first_goto_file = 'goto.php';
- var cookie_duration = cookie_duration_days + cookie_duration_hours / 24. + cookie_duration_minutes / 24. / 60.;
- var blocker_originalHtmlOverflow;
- var blocker_originalBodyOverflow;
- function blocker_addLoadEvent(func) {
- var oldonload = window['onload'];
- if (typeof window['onload'] != 'function') {
- window['onload'] = func;
- } else {
- window['onload'] = function () {
- oldonload();
- func();
- };
- };
- };
- blocker_addLoadEvent(blocker_pre_init);
- function blocker_pre_init() {
- if ((blocker_getCookie('content_unlocked') == '1') && (test_mode != 'YES')) {
- return;
- };
- var teaser = setTimeout('blocker_init()', tease_timer * 1000);
- };
- function blocker_init() {
- if (bhcb_files_path != '') {
- if (bhcb_files_path['charAt'](bhcb_files_path['length'] - 1) != '/') {
- bhcb_files_path = bhcb_files_path + '/';
- };
- cpa_offer_links_file = bhcb_files_path + cpa_offer_links_file;
- first_goto_file = bhcb_files_path + first_goto_file + '?fp=' + bhcb_files_path;
- if (!(background_image['match']('http://')) && !(background_image['match']('https://')) && !(background_image['match'](bhcb_files_path))) {
- background_image = bhcb_files_path + background_image;
- };
- };
- var cpa_links = getFile(cpa_offer_links_file);
- var cpa_link = cpa_links['split']('\x0A');
- var _0x3f24x19 = [];
- var counter;
- var i;
- if (hide_referrer != 'NO') {
- for (i = 0; i < (cpa_link['length'] - 3) / 2; i++) {
- counter = i * 2;
- if (bhcb_files_path == '') {
- _0x3f24x19[i] = {
- text: cpa_link[counter],
- url: first_goto_file + '?ln=' + (i + 1).toString()
- };
- } else {
- _0x3f24x19[i] = {
- text: cpa_link[counter],
- url: first_goto_file + '&ln=' + (i + 1).toString()
- };
- };
- };
- } else {
- for (i = 0; i < (cpa_link['length'] - 3) / 2; i++) {
- counter = i * 2;
- _0x3f24x19[i] = {
- text: cpa_link[counter],
- url: cpa_link[counter + 1]
- };
- };
- };
- var _0x3f24x1c;
- if (random_link_rotation == 'YES') {
- if (number_of_links_to_display > i) {
- number_of_links_to_display = i;
- };
- _0x3f24x1c = randomizer(number_of_links_to_display, i);
- } else {
- number_of_links_to_display = i;
- var _0x3f24x1d = new Array();
- for (var _0x3f24x1e = 0; _0x3f24x1e < i; _0x3f24x1e++) {
- _0x3f24x1d[_0x3f24x1e] = _0x3f24x1e;
- };
- _0x3f24x1c = _0x3f24x1d;
- };
- if (test_mode == 'YES') {
- if (i == 0) {
- alert('ERROR: You have no links! Check your links.txt file!');
- } else {
- var messages = '_______________ TEST MODE _______________ \x0A Welcome to BlackHat CodeBreaker\'s Test Mode!\x0A\x0ASTAGE 1: Checking Links Text and URLs...\x0A\x0AYou have ' + (i).toString() + ' links:';
- var _0x3f24x20 = 5;
- for (var _0x3f24x21 = 0; _0x3f24x21 < Math['ceil'](i / _0x3f24x20); _0x3f24x21++) {
- for (var _0x3f24x22 = _0x3f24x21 * _0x3f24x20;
- (_0x3f24x22 < i) && (_0x3f24x22 < (_0x3f24x21 + 1) * _0x3f24x20); _0x3f24x22++) {
- counter = _0x3f24x22 * 2;
- messages = messages + '\x0A\x0AText ' + (_0x3f24x22 + 1).toString() + ' - ' + cpa_link[counter] + '\x0AURL ' + (_0x3f24x22 + 1).toString() + ' - ' + cpa_link[counter + 1];
- };
- if (_0x3f24x22 < i) {
- messages = messages + '\x0A\x0A(Continued on next Screen - Click OK)';
- } else {
- if (hide_referrer != 'NO') {
- messages = messages + '\x0A\x0AYour Default Link When Referrer Cannot Be Blocked is:\x0A' + cpa_link[i * 2 + 1];
- };
- messages = messages + '\x0A\x0A(End of Stage 1 - Click OK)';
- };
- alert(messages + '\x0A ');
- messages = '_______________ TEST MODE _______________ \x0A\x0ASTAGE 1: Checking Links Text and URLs... (Continued)';
- };
- messages = '_______________ TEST MODE _______________ \x0A\x0ASTAGE 2: Timing Parameters...';
- messages = messages + '\x0A\x0ALocker appears ' + tease_timer + ' Seconds after page loads\x0A(Parameter: tease_timer)';
- messages = messages + '\x0A\x0APages Unlock ' + timeout_in_seconds_from_click + ' Seconds after link is clicked\x0A(Parameter: timeout_in_seconds_from_click)';
- messages = messages + '\x0A\x0APages Stay Unlocked for\x0A ' + cookie_duration_days + ' Days, ' + cookie_duration_hours + ' Hours and ' + cookie_duration_minutes + ' Minutes\x0A(Parameters:\x0A cookie_duration_days,\x0A cookie_duration_hours,\x0A cookie_duration_minutes)';
- alert(messages + '\x0A ');
- messages = '_______________ TEST MODE _______________ \x0A\x0ASTAGE 3: Basic Setup Parameters...';
- if (hide_referrer != 'NO') {
- messages = messages + '\x0A\x0AReferrer Hiding is: ON\x0A(Parameter: hide_referrer)';
- } else {
- messages = messages + '\x0A\x0AReferrer Hiding is: OFF\x0A(Parameter: hide_referrer)';
- };
- if (unlock_entire_site == 'YES') {
- messages = messages + '\x0A\x0AClicking Links Unlocks Entire Site\x0A(Parameter: unlock_entire_site)';
- } else {
- messages = messages + '\x0A\x0AClicking Links Unlocks Current Directory\x0A(Parameter: unlock_entire_site)';
- };
- if (random_link_rotation == 'YES') {
- messages = messages + '\x0A\x0ARandom Link Rotation is ON\x0A(Parameter: random_link_rotation)';
- messages = messages + '\x0A\x0ADisplaying only ' + number_of_links_to_display + ' links\x0A(Parameter: number_of_links_to_display)';
- } else {
- messages = messages + '\x0A\x0ARandom Link Rotation is OFF\x0A(Parameter: random_link_rotation)';
- };
- if (block_rightclick_menu == 'YES') {
- messages = messages + '\x0A\x0ARight-Click Menu is Blocked\x0A(Parameter: block_rightclick_menu)';
- };
- alert(messages + '\x0A ');
- messages = '_______________ TEST MODE _______________ \x0A\x0ASTAGE 4: Look and Feel Parameters...';
- messages = messages + '\x0A\x0ALock Panel Position is ' + panel_vertical_position + ' pixels Beneath Top Of Page\x0A(Parameter: panel_vertical_position)';
- messages = messages + '\x0A\x0ALock Panel Width is ' + panel_width + ' pixels\x0A(Parameter: panel_width)';
- messages = messages + '\x0A\x0APanel Background Color is ' + background_color + ' \x0A(Parameter: background_color)';
- messages = messages + '\x0A\x0APanel Border Color is ' + border_color + ' \x0A(Parameter: border_color)';
- messages = messages + '\x0A\x0APanel Background Image is ' + background_image + ' \x0A(Parameter: background_image)';
- messages = messages + '\x0A\x0AHaze Color is ' + haze_color + ' \x0A(Parameter: haze_color)';
- messages = messages + '\x0A\x0AHaze Opacity is ' + haze_opacity + ' (0=Transparent, 100=Opaque)\x0A(Parameter: haze_opacity)';
- alert(messages + '\x0A ');
- messages = '_______________ TEST MODE _______________ \x0A\x0ASTAGE 5: Testing Page...\x0A\x0AYou will now proceed to your webpage.\x0AIt should appear locked.\x0ACheck that colors and sizes are as you want them.';
- if (random_link_rotation == 'YES') {
- messages = messages + '\x0A\x0ALinks should appear in Randomly Rotated Order \x0A(If not - try reloading page to get a new order)';
- };
- messages = messages + '\x0AClick all links to test that they open as intended.\x0A\x0ANote that while in Test Mode clicking links WILL redirect you\x0Abut WILL NOT unlock the page.\x0AThis was set so that you will not have to clear cookies\x0Aevery time you want to check the links.\x0A\x0A**** DO NOT FORGET TO CANCEL TEST MODE\x0A**** BEFORE SENDING TRAFFIC TO YOUR PAGE!\x0A**** (Parameter: test_mode = \'NO\')';
- alert(messages + '\x0A ');
- };
- };
- window['scroll'](0, 0);
- blocker_originalHtmlOverflow = document['getElementsByTagName']('body')[0]['style']['overflow'];
- blocker_originalBodyOverflow = document['getElementsByTagName']('html')[0]['style']['overflow'];
- document['getElementsByTagName']('body')[0]['style']['overflow'] = 'hidden';
- document['getElementsByTagName']('html')[0]['style']['overflow'] = 'hidden';
- if (haze_opacity > 100) {
- haze_opacity = 100;
- } else {
- if (haze_opacity < 0) {
- haze_opacity = 0;
- };
- };
- var haze = document['createElement']('div');
- haze['id'] = 'blocker_haze';
- haze['style']['filter'] = 'alpha(opacity=' + haze_opacity + ')';
- haze['style']['opacity'] = haze_opacity / 100.;
- haze['style']['height'] = '100%';
- haze['style']['width'] = '100%';
- haze['style']['backgroundColor'] = haze_color;
- haze['style']['position'] = 'absolute';
- haze['style']['top'] = '0px';
- haze['style']['left'] = '0px';
- haze['style']['zIndex'] = 1000000;
- var centerPane = document['createElement']('centerPane');
- centerPane['id'] = 'blocker_centerPane';
- centerPane['style']['width'] = panel_width + 'px';
- centerPane['style']['border'] = '5px solid ' + border_color;
- centerPane['style']['width'] = panel_width + 'px';
- centerPane['style']['position'] = 'absolute';
- centerPane['style']['left'] = '50%';
- centerPane['style']['marginLeft'] = '-' + panel_width / 2 + 'px';
- centerPane['style']['top'] = panel_vertical_position + 'px';
- centerPane['style']['backgroundColor'] = background_color;
- centerPane['style']['zIndex'] = 1000001;
- centerPane['style']['backgroundImage'] = 'url(' + background_image + ')';
- centerPane['style']['backgroundRepeat'] = (background_image_repeat == 'YES') ? 'repeat-yes' : 'no-repeat';
- centerPane['style']['backgroundPosition'] = '0px 0px';
- centerPane['style']['padding'] = '0px';
- var h1 = document['createElement']('h1');
- h1['style']['color'] = headline_color;
- h1['style']['textAlign'] = 'center';
- h1['style']['fontSize'] = '38px';
- h1['style']['margin'] = '0 0 10px 0';
- h1['style']['padding'] = '38px 0 0 0px';
- h1['style']['fontFamily'] = 'arial';
- h1['style']['textDecoration'] = 'underline';
- h1['style']['lineHeight'] = '38px';
- h1['innerHTML'] = blocker_headline;
- centerPane['appendChild'](h1);
- var p1 = document['createElement']('p');
- p1['innerHTML'] = blocker_instructionalText;
- p1['style']['textAlign'] = 'center';
- p1['style']['padding'] = '20px 0 20px 0';
- p1['style']['margin'] = '0';
- p1['style']['fontSize'] = '18px';
- p1['style']['lineHeight'] = '18px';
- p1['style']['color'] = instructionalText_color;
- p1['style']['fontFamily'] = 'arial';
- centerPane['appendChild'](p1);
- var ul = document['createElement']('ul');
- ul['style']['textAlign'] = 'center';
- ul['style']['margin'] = '0 0 10px 0';
- ul['style']['padding'] = '0';
- ul['style']['listStyleType'] = 'none';
- for (var i = 0; i < number_of_links_to_display; i++) {
- var li = document['createElement']('li');
- var a = document['createElement']('a');
- a['style']['display'] = 'block';
- a['style']['fontSize'] = '14px';
- a['style']['lineHeight'] = '22px';
- a['style']['color'] = links_color;
- a['style']['fontFamily'] = 'arial';
- a['style']['textDecoration'] = 'underline';
- a['target'] = '_blank';
- a['innerHTML'] = _0x3f24x19[_0x3f24x1c[i]]['text'];
- a['href'] = _0x3f24x19[_0x3f24x1c[i]]['url'];
- a['onmouseover'] = function () {
- window['status'] = ' ';
- return true;
- };
- a['onclick'] = function () {
- if (test_mode != 'YES') {
- window['setTimeout'](unblockContent, timeout_in_seconds_from_click * 1000);
- };
- };
- li['appendChild'](a);
- ul['appendChild'](li);
- };
- centerPane['appendChild'](ul);
- var p2 = document['createElement']('p');
- p2['style']['textAlign'] = 'center';
- p2['innerHTML'] = blocker_footerText;
- p2['style']['padding'] = '20px 0 0 0';
- p2['style']['margin'] = '0';
- p2['style']['color'] = footerText_color;
- p2['style']['fontFamily'] = 'arial';
- p2['style']['fontSize'] = '14px';
- p2['style']['lineHeight'] = '14px';
- centerPane['appendChild'](p2);
- var p3 = document['createElement']('p');
- p3['style']['textAlign'] = 'center';
- p3['innerHTML'] = ' ';
- p3['style']['padding'] = '40px 0 0 0';
- p3['style']['margin'] = '0';
- p3['style']['color'] = footerText_color;
- p3['style']['fontFamily'] = 'arial';
- p3['style']['fontSize'] = '40px';
- p3['style']['lineHeight'] = '40px';
- centerPane['appendChild'](p3);
- document['getElementsByTagName']('body')[0]['appendChild'](haze);
- document['getElementsByTagName']('body')[0]['appendChild'](centerPane);
- };
- function unblockContent() {
- document['getElementsByTagName']('body')[0]['style']['overflow'] = blocker_originalBodyOverflow;
- document['getElementsByTagName']('html')[0]['style']['overflow'] = blocker_originalHtmlOverflow;
- document['getElementById']('blocker_haze')['style']['display'] = 'none';
- document['getElementById']('blocker_centerPane')['style']['display'] = 'none';
- blocker_setCookie('content_unlocked', 1, cookie_duration);
- };
- function blocker_setCookie(name, value, expires) {
- var today = new Date();
- today['setDate'](today['getDate']() + expires);
- if (unlock_entire_site != 'YES') {
- document['cookie'] = name + '=' + escape(value) + ((expires == null) ? '' : ';expires=' + today['toGMTString']());
- } else {
- document['cookie'] = name + '=' + escape(value) + ((expires == null) ? '' : ';expires=' + today['toGMTString']()) + '; path=/';
- };
- };
- function blocker_getCookie(name) {
- if (document['cookie']['length'] > 0) {
- c_start = document['cookie']['indexOf'](name + '=');
- if (c_start != -1) {
- c_start = c_start + name['length'] + 1;
- c_end = document['cookie']['indexOf'](';', c_start);
- if (c_end == -1) {
- c_end = document['cookie']['length'];
- };
- return unescape(document['cookie']['substring'](c_start, c_end));
- };
- };
- return '';
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement