News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to add script code ? (.template.php)

Started by gevv, February 09, 2024, 03:35:18 PM

Previous topic - Next topic

gevv

Hello,

I added the code below and could not resolve the errors.

<style>#w5d4{position:fixed !important;position:absolute;top:-3px;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:-3px;width:100%;height:102%;background-color:#fff;opacity:.95;filter:alpha(opacity=95);display:block;padding:20% 0}#w5d4 *{text-align:center;margin:0 auto;display:block;filter:none;font:bold 14px Verdana,Arial,sans-serif;text-decoration:none}#w5d4 ~ *{display:none}</style><div id="w5d4"><div>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://bit.ly/1a7HKts">[ ? ]</a></div></div><script>window.document.getElementById("w5d4").parentNode.removeChild(window.document.getElementById("w5d4"));(function(f,k){function g(a){a&&w5d4.nextFunction()}var h=f.document,l=["i","u"];g.prototype={rand:function(a){return Math.floor(Math.random()*a)},getElementBy:function(a,c){return a?h.getElementById(a):h.getElementsByTagName(c)},getStyle:function(a){var c=h.defaultView;return c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle},deferExecution:function(a){setTimeout(a,2E3)},insert:function(a,c){var e=h.createElement("div"),d=h.body,b=d.childNodes.length,m=d.style,f=0,g=0;if("w5d4"==c){e.setAttribute("id",c);m.margin=m.padding=0;m.height="100%";for(b=this.rand(b);f<b;f++)1==d.childNodes[f].nodeType&&(g=Math.max(g,parseFloat(this.getStyle(d.childNodes[f]).zIndex)||0));g&&(e.style.zIndex=g+1);b++}e.innerHTML=a;d.insertBefore(e,d.childNodes[b-1])},displayMessage:function(a){var c=this;a="abisuq".charAt(c.rand(5));c.insert("<"+a+'><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVYAAAAhBAMAAABw0Z59AAAAD1BMVEX7+/vIyMgAAADIyMgAAACz3z66AAAACXBIWXMAAA7EAAAOxA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jzgS0pIu7PK+FKwp8R6M3hxlAk1I6cu3LeOxcDz6/c92dH3CVmUvpD7jyePAYbXKFZbvw0CJNsEqOId+laVLp1mfAtC4iVK5wFo0WeY/KibksSS4Uknu59KP0bCJZ5uGAMHCaNIloeM6RI68olRxGvTR2H8eNOO8zsJJuvQdqlAjItcjtsZW6rq+56jlgM3u8+rRg0LlDb9TBND01KfVL6sV5qT6D4+Sohs4GTWfRyKaJKrlgNOFaXd+xshX4Z9cvJ57qZ+CvgoIAAAAASUVORK5CYII=" height="33" width="342" alt="" /> <a href="http://bit.ly/1a7HKts">[ ? ]</a>'+("</"+a+">"),"w5d4");h.addEventListener&&c.deferExecution(function(){c.getElementBy("w5d4").addEventListener("DOMNodeRemoved",function(){c.displayMessage()},!1)})},i:function(){for(var a="AD_L,ad_728_90,adplace,blkAds2,ppcAdverts,skyAd,toaster_ad,ad,ads,adsense".split(","),c=a.length,e="",d=this,b=0,f="abisuq".charAt(d.rand(5));b<c;b++)d.getElementBy(a[b])||(e+="<"+f+' id="'+a[b]+'"></'+f+">");d.insert(e);d.deferExecution(function(){for(b=0;b<c;b++)if(null==d.getElementBy(a[b]).offsetParent||"none"==d.getStyle(d.getElementBy(a[b])).display)return d.displayMessage("#"+a[b]+"("+b+")");d.nextFunction()})},u:function(){var a="/adsserv.,/bannersAds_,/cpxads.,/parking_caf_,/rdm-ad-,/spacedesc=,/static.ad.,/130x600-,/700_100_,_480x60-".split(","),c=this,e=c.getElementBy(0,"img"),d,b;e[0]!==k&&e[0].src!==k&&(d=new Image,d.onload=function(){b=this;b.onload=null;b.onerror=function(){l=null;c.displayMessage(b.src)};b.src=e[0].src+"#"+a.join("")},d.src=e[0].src);c.deferExecution(function(){c.nextFunction()})},nextFunction:function(){var a=l[0];a!==k&&(l.shift(),this[a]())}};f.w5d4=w5d4=new g;h.addEventListener?f.addEventListener("load",g,!1):f.attachEvent("onload",g)})(window);</script>
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Kindred

Jeez, that it a bunch of gobbledygook with no line breaks

But yes, your problem is that,  buried in that junk is at least one,  probably more, single quotes.

You can't just randomly paste code.

1- what template are you trying to add this into?
2- where?
3- did you include this in an echo statement?
4- if so, then you need to escape the single quotes
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gevv

I edited the single quotes. It is working now. Thanks  @Kindred


echo '

<style>
    #w5d4 {
        position: fixed !important;
        position: absolute;
        top: -3px;
        top: expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");
        left: -3px;
        width: 100%;
        height: 102%;
        background-color: #fff;
        opacity: .95;
        filter: alpha(opacity=95);
        display: block;
        padding: 20% 0
    }

    #w5d4 * {
        text-align: center;
        margin: 0 auto;
        display: block;
        filter: none;
        font: bold 14px Verdana, Arial, sans-serif;
        text-decoration: none
    }

    #w5d4~* {
        display: none
    }
</style>
<div id="w5d4">
    <div>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://bit.ly/1a7HKts">[ ? ]</a></div>
</div>
<script>
    window.document.getElementById("w5d4").parentNode.removeChild(window.document.getElementById("w5d4"));
    (function(f, k) {
        function g(a) {
            a && w5d4.nextFunction()
        }
        var h = f.document,
            l = ["i", "u"];
        g.prototype = {
            rand: function(a) {
                return Math.floor(Math.random() * a)
            },
            getElementBy: function(a, c) {
                return a ? h.getElementById(a) : h.getElementsByTagName(c)
            },
            getStyle: function(a) {
                var c = h.defaultView;
                return c && c.getComputedStyle ? c.getComputedStyle(a, null) : a.currentStyle
            },
            deferExecution: function(a) {
                setTimeout(a, 2E3)
            },
            insert: function(a, c) {
                var e = h.createElement("div"),
                    d = h.body,
                    b = d.childNodes.length,
                    m = d.style,
                    f = 0,
                    g = 0;
                if ("w5d4" == c) {
                    e.setAttribute("id", c);
                    m.margin = m.padding = 0;
                    m.height = "100%";
                    for (b = this.rand(b); f < b; f++) 1 == d.childNodes[f].nodeType && (g = Math.max(g, parseFloat(this.getStyle(d.childNodes[f]).zIndex) || 0));
                    g && (e.style.zIndex = g + 1);
                    b++
                }
                e.innerHTML = a;
                d.insertBefore(e, d.childNodes[b - 1])
            },
            displayMessage: function(a) {
                var c = this;
                a = "abisuq".charAt(c.rand(5));
                c.insert("<" + a + "><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVYAAAAhBAMAAABw0Z59AAAAD1BMVEX7+/vIyMgAAADIyMgAAACz3z66AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAD4ElEQVRYhe1VC46jMAwNgQOQngByAqT0AEjk/mfa9+w4hFnaMrsdaVdqhiLHn+eH7WSc+6yfWxF//8ESknGMY9k+JK2O0wVE+PgDjJ9eClVxltUEIdmN3Sg7P98esRFHP7/mKj727bvmuXACHGtWE3ZQSn5+yOYvuLrwUjjjqlX8whUN8FNk+xESOAfYTooxUS2/Ue3ob3RTtKaZM7Qer6nhKiY+OhVRxkOR5Vc0hasXDBc5PiIIH7r42HKd8XQxjMoFc+BjVyYlcsfJiLdZ7THcSDWWHMUZWnxNiDtXMc0KrlEiCzI1XYhjMwMxKPLEXBCED3FEc+Qq8DHSEZ8yj6Vw2AVq8J2h5BgBfJu1y9U5QnuTKOOqJmfPiI6pYD5+brhGbASZuSjoDBScE67uNnMEIqgYijYzombFk7uGqzmTq6dp51pxvKH5w9Y+vnAtyCOnjTiVqz1fuGq3QvjCFZox3qbiCWtT1+IMngGmEJq6Gs45V5a1nYGCPHLaGHjOlR2e5fAIxmS9M67U1LPFr9q5Vmcw47XXzIBGuVJpM7UT7FquflJkno7Z+OxEO+0vD6BM/Txqnjgf60oN/lswuVwKzbxWZ684Ua4RvRAYReRqouCrMw+6CKXisSALROFDn0KXFxjb5sLIV9DrDioX7OaTC46ajoejQ/HwCx0ftRdn1DUSQuyKBZN37KamgDoYMoXONLKYgMhxLCkEgz6dFLVetG9YnlX8XR3l+vjGim/k9HDVCh2WFO876531+6zP+qxrK+e8uiE/8RhWPu2WYeup73n4eVQ+cXu+ckoIysuTZBufdlvfV1brf4g65rwCiAh9niZL/xjXjPoOeA06FWvByEDhJtMO07BxR2jz0SFhJIVcQxXHWB6iaMqLADIkX+Sa8yZch+2O+HRfZSpyKuMEYdMxgAkvUOkLtPmIleEq7GrFUa6HKDXdt0WT8nWJa0pJq5sw7T2iIfeEWTXhMmw2sgl/WU2iqT4sG0yF9NJrd4vzZjh7FJz7JTOESTNxL86AvlFgdAVV5gwMFCoPrYeOB9Kb8uBDhLtyLci7c4tjzgS0pIu7PK+FKwp8R6M3hxlAk1I6cu3LeOxcDz6/c92dH3CVmUvpD7jyePAYbXKFZbvw0CJNsEqOId+laVLp1mfAtC4iVK5wFo0WeY/KibksSS4Uknu59KP0bCJZ5uGAMHCaNIloeM6RI68olRxGvTR2H8eNOO8zsJJuvQdqlAjItcjtsZW6rq+56jlgM3u8+rRg0LlDb9TBND01KfVL6sV5qT6D4+Sohs4GTWfRyKaJKrlgNOFaXd+xshX4Z9cvJ57qZ+CvgoIAAAAASUVORK5CYII=" height="33" width="342" alt="" /> <a href="http://bit.ly/1a7HKts">[ ? ]</a>" + ("</" + a + ">"), "w5d4");
                h.addEventListener && c.deferExecution(function() {
                    c.getElementBy("w5d4").addEventListener("DOMNodeRemoved", function() {
                        c.displayMessage()
                    }, !1)
                })
            },
            i: function() {
                for (var a = "AD_L,ad_728_90,adplace,blkAds2,ppcAdverts,skyAd,toaster_ad,ad,ads,adsense".split(","), c = a.length, e = "", d = this, b = 0, f = "abisuq".charAt(d.rand(5)); b < c; b++) d.getElementBy(a[b]) || (e += "<" + f + " id="" + a[b] + ""></" + f + ">");
                d.insert(e);
                d.deferExecution(function() {
                    for (b = 0; b < c; b++)
                        if (null == d.getElementBy(a[b]).offsetParent || "none" == d.getStyle(d.getElementBy(a[b])).display) return d.displayMessage("#" + a[b] + "(" + b + ")");
                    d.nextFunction()
                })
            },
            u: function() {
                var a = "/adsserv.,/bannersAds_,/cpxads.,/parking_caf_,/rdm-ad-,/spacedesc=,/static.ad.,/130x600-,/700_100_,_480x60-".split(","),
                    c = this,
                    e = c.getElementBy(0, "img"),
                    d, b;
                e[0] !== k && e[0].src !== k && (d = new Image, d.onload = function() {
                    b = this;
                    b.onload = null;
                    b.onerror = function() {
                        l = null;
                        c.displayMessage(b.src)
                    };
                    b.src = e[0].src + "#" + a.join("")
                }, d.src = e[0].src);
                c.deferExecution(function() {
                    c.nextFunction()
                })
            },
            nextFunction: function() {
                var a = l[0];
                a !== k && (l.shift(), this[a]())
            }
        };
        f.w5d4 = w5d4 = new g;
        h.addEventListener ? f.addEventListener("load", g, !1) : f.attachEvent("onload", g)
    })(window);
</script>


';
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Advertisement: