-3

I have a site (forum.tdp4teambattle.com) and recently, I started getting ads in the footer. I looked in the footer and there is no code for the ad. I'm thinking they put it in another file and specified it to a certain div ID. What code in HTML or JavaScript can I use to hide the ad so others don't see it?

Here is the ad image: http://is.mixmarket.biz/images/um/95480.gif it is 468x60 (maybe you can give me a code to block images of that specific size from showing up).

Edit, solved: if anybody was using "listbb.ru" or "getbb.ru", here is the solution. You'll need to view source on your index page and do CTRL+F. Search for "mix", or "market" or similar. You will see something along the lines of "mix_block_{identifier}". To remove it, you'll need to navigate to ACP>Styles>Templates>{Theme}>Overall_header.html> find

</head>

and before, enter:

<style>
#mix_block_1294937123 {
display: none;
}
</style>
halfer
  • 19,824
  • 17
  • 99
  • 186
MichaelMav
  • 80
  • 1
  • 1
  • 10

3 Answers3

3

The answer above is wrong. For solving the ad's youself the chunk of code doing it is:

    <table border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td>

<div id="mix_block_1294937123"><div id="mix_block_1294937123_1016" style="width:468px;height:60px;position: relative;"><a href="http://ucl.mixmarket.biz/uni/clk.php?id=1294878201&amp;zid=1294937123&amp;s=9019&amp;tt=08310735" target="blank"><img src="http://is.mixmarket.biz/images/um/95480.gif" width="468" height="60" border="0" alt=""></a></div><script type="text/javascript" src="http://udata.mixmarket.biz/uss/stat/?mid=1294887383&amp;id=1294937123&amp;tt=1472614515"></script><img src="http://mixmarket.biz/t.php?uid=1294929468&amp;r=http%3A//stackoverflow.com/questions/39240278/block-ads-with-html-js&amp;t=1472614515" width="1" height="1"></div>
<script type="text/javascript">
document.write('<scr' + 'ipt language="javascript" type="text/javascript" src="http://1294937123.us.mixmarket.biz/uni/us/1294937123/?div=mix_block_1294937123&r=' + escape(document.referrer) + '&rnd=' + Math.round(Math.random() * 100000) + '" charset="windows-1251"><' + '/scr' + 'ipt>');
</script><script language="javascript" type="text/javascript" src="http://1294937123.us.mixmarket.biz/uni/us/1294937123/?div=mix_block_1294937123&amp;r=http%3A//stackoverflow.com/questions/39240278/block-ads-with-html-js&amp;rnd=39740" charset="windows-1251"></script>
</td></tr></tbody></table>

So if you have access to the css pick a div and do

Display: none;
Lulceltech
  • 1,662
  • 11
  • 22
0

following code removes ads with undesired pictures and blocking elements that appear above the web page

(function removeAdvertisementAndBlockingElements () {
    $('.inRek').remove();
    $('.mgbox').remove();
    
    Array.from(document.getElementsByTagName("img")).forEach(function (e) {
        if (!e.src.includes(window.location.host)) {
            e.remove()
        }
    });    
    
    Array.from(document.getElementsByTagName("div")).forEach(function (e) {
        var currentZIndex = parseInt(document.defaultView.getComputedStyle(e, null).zIndex);
        if (currentZIndex > 999) {
            console.log(parseInt(currentZIndex));
            e.remove()
        }
    });
})();
Zhenia
  • 1
  • 2
-2

Most of the ads are from google ad word. So there are inserted into a page by javascript. If you want to remove all ads only by inspecting it manually and remove it.

The other thing what you can do is, to do an inspect element on the ad block by right-click and select the option inspect element in chrome that opens a small panel in the bottom section of your browser and set the block's CSS property (on right-hand side) as display:none;

  • Inspect element isn't going to fix anything? That's a very temporary and local fix. He's/She's talking about server side – Andrew Li Aug 31 '16 at 03:37
  • Andrew is correct, and also this is a russia-based host so the ads are being run by another company. It's only local and i need it to be fixed for all users. – MichaelMav Aug 31 '16 at 03:39