A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: Balance To Real Life Money Converter - Stikked
From Obese Crane, 6 Years ago, written in JavaScript.
This paste is a reply to Balance To Real Life Money Converter from TEKNO - go back
Embed
// ==UserScript==
// @name         Balance to Real Life Money Converter
// @version      7.0
// @description  This script shows your how much would your Gamdom balance cost in real life.
// @author       TEKNO and Johannes Joestar
// @match        https://gamdom.com/*
// @grant        none
// ==/UserScript==

(function() {
    var currency;
    var customRateVal = 1100;
    var added = false;
    var newBalance = 0;
    var cur;

    if (window.top != window.self){
        return;
    }

    if(localStorage.getItem("currency") === null) {
        localStorage.setItem("currency", prompt("Please enter your currency's international currency code."));
    }
    else {
        currency = localStorage.getItem("currency");
    }

    function getCurrency() {
        var HttpClient = function() {
            this.get = function(aUrl, aCallback) {
                var anHttpRequest = new XMLHttpRequest();
                anHttpRequest.onreadystatechange = function() {
                    if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)
                        aCallback(anHttpRequest.responseText);
                };
                anHttpRequest.open( "GET", aUrl, true );
                anHttpRequest.send( null );
            };
        };

        var client = new HttpClient();
        client.get('https://free.currencyconverterapi.com/api/v5/convert?q=USD_'+currency+'&compact=y', function(response) {
            var val = response.indexOf("\"val\"")+6;
            var par = response.indexOf("}}");
            cur = response.substring(
                response.lastIndexOf("\"val\"")+6,
                response.lastIndexOf("}}")
            );
            if (cur == "{}") {
                var wrongcur = prompt("The currency you have entered couldn't be found. Please enter your currency's international currency code.");
                if(wrongcur === "" || wrongcur === null || wrongcur === undefined) {
                    alert("You can't set your new currency to blank. Please try again.");
                    getCurrency();
                }
                else{
                    localStorage.setItem("currency", wrongcur);
                    currency = wrongcur;
                    getCurrency();
                }
            }
            console.log("Current USD to "+currency+" = "+cur);
            if(document.getElementById("main_money")) {
                balanceUpdate();
            }
        });
    }

    function addDiv() {
        if(document.cookie.includes("use_design=old")) {
            if(document.getElementsByClassName("balance").length > 0) {
                clearTimeout(addDiv);
                var mainul = document.getElementsByClassName("nav navbar-nav navbar-right")[0];
                var mainli = document.createElement("li");
                var maina = document.createElement("a");
                var maindiv = document.createElement("div");
                var mainspan = document.createElement("span");
                var mainbalspan = document.createElement("span");
                mainli.setAttribute("class", "balance-bits");
                maina.setAttribute("title", "Change your currency.");
                maina.addEventListener("click", function() {
                    var newcur = prompt("Please enter your new currency.");
                    if(newcur === "" || newcur === null || newcur === undefined) {
                        alert("You can't set your new currency to blank. Please try again.");
                    }
                    else{
                        localStorage.setItem("currency", newcur);
                        currency = newcur;
                        getCurrency();
                        setTimeout(function() { balanceUpdate(); }, 1000);
                    }
                });
                maina.setAttribute("style", "padding-left: 5px;padding-right: 5px;");
                document.getElementsByClassName("balance-bits")[0].firstChild.setAttribute("style", "padding-left: 5px;padding-right: 5px;");
                document.getElementsByClassName("logout")[0].setAttribute("style", "padding-left: 5px;padding-right: 5px;");
                maindiv.setAttribute("class", "balanceDiv");
                mainspan.setAttribute("class", "balance");
                mainbalspan.setAttribute("id", "main_money");
                mainbalspan.setAttribute("style", "transition: background-color 1s ease-in-out, color, opacity;");
                mainspan.appendChild(mainbalspan);
                maindiv.appendChild(mainspan);
                maina.appendChild(maindiv);
                mainli.appendChild(maina);
                mainul.insertBefore(mainli, mainul.childNodes[2]);
                var mobileul = document.getElementsByClassName("navbar-header")[0];
                var mobilediv = document.createElement("div");
                var mobilespan = document.createElement("span");
                var mobilebalspan = document.createElement("span");
                mobilediv.setAttribute("class", "mob-balance-bits");
                mobilespan.setAttribute("class", "balance");
                mobilebalspan.setAttribute("id", "mobile_money");
                mobilebalspan.addEventListener("click", function() {
                    var newcur = prompt("Please enter your new currency.");
                    if(newcur === "" || newcur === null || newcur === undefined) {
                        alert("You can't set your new currency to blank. Please try again.");
                    }
                    else{
                        localStorage.setItem("currency", newcur);
                        currency = newcur;
                        getCurrency();
                        setTimeout(function() { balanceUpdate(); }, 1000);
                    }
                });
                mobilebalspan.setAttribute("style", "transition: background-color 1s ease-in-out, color, opacity;");
                mobilespan.appendChild(mobilebalspan);
                mobilediv.appendChild(mobilespan);
                mobileul.insertBefore(mobilediv, mobileul.childNodes[2]);
                var balance = document.getElementById("balance").lastChild.innerText;
                balance = balance.replace(/\s/g, '');
                if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
                else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
                document.getElementById("main_money").innerText = "~"+newBalance+" "+currency;
                document.getElementById("mobile_money").innerText = "~"+newBalance+" "+currency;
            }
            else{
                setTimeout(addDiv, 500);
            }
        } else{
            if(document.querySelector(".menu_item_deposit")) {
                clearTimeout(addDiv);
                var mainlist = document.querySelector(".menus");
                var bala = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.parentNode.cloneNode(true);
                bala.lastChild.innerText = "Change Currency";
                bala.firstChild.firstChild.remove();
                bala.firstChild.firstChild.firstChild.innerText = "~0 " + currency;
                bala.setAttribute("title", "Change your currency.");
                bala.addEventListener("click", function() {
                    var newcur = prompt("Please enter your new currency.");
                    if(newcur === "" || newcur === null || newcur === undefined) {
                        alert("You can't set your new currency to blank. Please try again.");
                    }
                    else{
                        localStorage.setItem("currency", newcur);
                        currency = newcur;
                        getCurrency();
                        setTimeout(function() { balanceUpdate(); }, 1000);
                    }
                });
                bala.firstChild.firstChild.firstChild.setAttribute("id", "main_money");
                bala.removeAttribute("href");
                mainlist.insertBefore(bala, document.querySelector(".icon-marketplace").parentNode);
                var mobilelist = document.querySelector(".menu_links");
                var mobilebala = document.querySelector(".mob_deposit").cloneNode(true);
                mobilebala.lastChild.innerText = "Change Currency";
                mobilebala.firstChild.firstChild.remove();
                mobilebala.firstChild.firstChild.firstChild.innerText = "~0 " + currency;
                mobilebala.setAttribute("title", "Change your currency.");
                mobilebala.addEventListener("click", function() {
                    var newcur = prompt("Please enter your new currency.");
                    if(newcur === "" || newcur === null || newcur === undefined) {
                        alert("You can't set your new currency to blank. Please try again.");
                    }
                    else{
                        localStorage.setItem("currency", newcur);
                        currency = newcur;
                        getCurrency();
                        setTimeout(function() { balanceUpdate(); }, 1000);
                    }
                });
                mobilebala.firstChild.firstChild.firstChild.setAttribute("id", "mobile_money");
                mobilebala.removeAttribute("href");
                mobilelist.insertBefore(mobilebala, mobilelist.querySelector(".menus"));
                var balance = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.innerText;
                balance = balance.replace(/\s/g, '');
                if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
                else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
                document.getElementById("main_money").innerText = "~"+newBalance+" "+currency;
                document.getElementById("mobile_money").innerText = "~"+newBalance+" "+currency;
            }
            else{
                setTimeout(addDiv, 500);
            }
        }
    }

    function balanceUpdate() {
        var mainmoney = document.getElementById("main_money");
        var mobilemoney = document.getElementById("mobile_money");
        if(document.cookie.includes("use_design=old")) {
            var balance = document.getElementById("balance").lastChild.innerText;
        } else{
            var balance = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.innerText;
        }
        balance = balance.replace(/\s/g, '');
        if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
        else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
        mainmoney.innerText = "~"+newBalance+" "+currency;
        mobilemoney.innerText = "~"+newBalance+" "+currency;
    }

    function balanceCheck() {
        if(document.cookie.includes("use_design=old")) {
            if(document.querySelectorAll('span.balance').length > 0) {
                clearTimeout(balanceCheck);
                function mutate(mutations) {
                    mutations.forEach(function(mutation) {
                        balanceUpdate();
                    });
                }

                var target = document.querySelectorAll('span.balance')[2].lastChild;
                var observer = new MutationObserver( mutate );
                var config = { characterData: true, attributes: true, childList: true, subtree: true };

                observer.observe(target, config);
            }
            else {
                setTimeout(balanceCheck,500);
            }
        } else{
            if(document.querySelector(".menu_item_deposit")) {
                clearTimeout(balanceCheck);
                function mutate(mutations) {
                    mutations.forEach(function(mutation) {
                        balanceUpdate();
                    });
                }

                var target = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.firstChild;
                var observer = new MutationObserver( mutate );
                var config = { characterData: true, attributes: true, childList: true, subtree: true };

                observer.observe(target, config);
            }
            else {
                setTimeout(balanceCheck,500);
            }
        }
    }

    getCurrency();
    addDiv();
    balanceCheck();
})();