Community Forum

User info

Welcome, Guest! Please login or register.


You are here » Community Forum » New Forum Features » Requests for Scripts


Requests for Scripts

Posts 31 to 40 of 40

31

All Working, thank you

0

32

kami
You can get the exact selectors via developer tools (right-click on a page element and select Inspect element), for example:
http://sm.uploads.im/lDBj0.png
(Click to view the full-size image)

0

33

I want to display some ad script in the footer of all pages, except in the Register.php and Login.Php.
is there  html / js code that i can use to implement ..?

Last edited by kami (2017-12-28 23:21:19)

0

34

kami
Hello  :flag:
Do you still need it? I can try to make it.

0

35

C3La-NS wrote:

Do you still need it? I can try to make it.

YES, I do,,, i still need it.... Thank You Very Much

0

36

kami
rough but working

<script>
    (function() {
        var countup = this;
        var ads = document.createElement('div');
        ads.className = 'my_ads';
        ads.innerHTML = 'YourAdsGoHere';
        document.getElementById('html-footer').appendChild(ads);

        if (document.URL.indexOf("register.php") >= 0) {
            ads.style.display = "none";
        }
        if (document.URL.indexOf("login.php") >= 0) {
            ads.style.display = "none";
        }
    })();
</script>

To HTML-bottom

Use .my_ads class in case you need to customize CSS.
YourAdsGoHere -- here go your ads. (!) use double quotes à la " " inside to avoid any breaks.

Spoiler

It were better if I could make this part not repeating twice.
"
        if (document.URL.indexOf("register.php") >= 0) {
            ads.style.display = "none";
        }
        if (document.URL.indexOf("login.php") >= 0) {
            ads.style.display = "none";
        }
"

If I have any idea, I'll notify you.

+1

37

I tried like this:

Spoiler

<script>
        (function() {
            var countup = this;
            var ads = document.createElement('div');
            ads.className = 'my_ads';
            ads.innerHTML = '<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-24426533458390521"
     data-ad-slot="1499301319"
     data-ad-format="auto"></ins>
';
            document.getElementById('html-footer').appendChild(ads);

            if (document.URL.indexOf("register.php") >= 0) {
                ads.style.display = "none";
            }
            if (document.URL.indexOf("login.php") >= 0) {
                ads.style.display = "none";
            }
        })();
    </script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

ad does not appear

Original Code:

Spoiler

<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-client="ca-pub-24426533458390521"
     data-ad-slot="1499301319"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Last edited by kami (2018-02-20 04:09:39)

0

38

kami
Seems like you need to write the code inline

<script>
        (function() {
            var countup = this;
            var ads = document.createElement('div');
            ads.className = 'my_ads';
            ads.innerHTML = '<ins class="adsbygoogle" data-ad-client="ca-pub-24426533458390521" data-ad-format="auto" data-ad-slot="1499301319" style="display:block"></ins>';
            document.getElementById('html-footer').appendChild(ads);

            if (document.URL.indexOf("register.php") >= 0) {
                ads.style.display = "none";
            }
            if (document.URL.indexOf("login.php") >= 0) {
                ads.style.display = "none";
            }
        })();
    </script>

now the appended "my_ads" div appears in footer but I cannot check if google ads work. Some time's needed before the advertisement starts to display for users.

Added after 4 minutes 41 second:

you can check if the div is appended properly by adding some css styling to it.
In example

<style>
.my_ads {
width: 100%;
height: 60px;
background: yellow;
}
</style>

0

39

C3La-NS
Thats work well thank you

0

40

is there any script that can be used to display topic description ?
http://sk.uploads.im/t/in7VP.png

0


You are here » Community Forum » New Forum Features » Requests for Scripts