freehost44u Posted December 5, 2021 Share Posted December 5, 2021 I already add one in the lower right side (through Your Adverts -> Control Panel Advert Control), does anyone know how to add an ad unit on the top right? Like the screenshot I provide? I used the following insertAdjacentHTML in the "advert" section <script type="text/javascript"> var d1 = document.getElementById('one'); d1.insertAdjacentHTML('afterend', '<div id="two">two</div>'); </script> But it won't function, only show its text form. Quote Link to comment Share on other sites More sharing options...
freehost44u Posted February 17, 2022 Author Share Posted February 17, 2022 Thank you. Can you please be so kind to tell me, which part to add to the Panel advert display? if I need the advertise to be on the top right, like the screenshot of my first post, what shall I put in the "Right advert for mysite.com"? I tried many times, and I don't know how to do it. On 12/6/2021 at 12:23 PM, BastelPichi2 said: Hey, Heres the best method to just steal from InfinityFree. Heres modified version of hans' code, i just copy-pasted the needed part, you have to change it to your needs of course: function buildAdSenseAdPanel(e) { let t = document.createElement("div"); return ( t.setAttribute("class", "panel panel-widget"), (t.innerHTML = '<div class="panel-heading widget-heading">Advertisement</div><div class="panel-body"><div class="col-xs-12 col-md-12 text-center"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-7281184434591176" data-ad-slot="3301284143" data-ad-format="auto"></ins></div></div>'), t ); } function insertStatsPanelAds() { let e = document.getElementById("stats"), t = buildAdSenseAdPanel(3855191122); e.insertBefore(t, e.firstChild), (adsbygoogle = window.adsbygoogle || []).push({}); let n = buildAdSenseAdPanel(3472047746); e.appendChild(n), (adsbygoogle = window.adsbygoogle || []).push({}); } document.addEventListener("DOMContentLoaded", function () { insertStatsPanelAds() }); Quote Link to comment Share on other sites More sharing options...
TinkerMan Posted February 17, 2022 Share Posted February 17, 2022 FYI, its illegal under copyright law to use that code Quote Link to comment Share on other sites More sharing options...
RoshanOp Posted August 27, 2022 Share Posted August 27, 2022 On 12/6/2021 at 10:53 PM, BastelPichi said: Hey, Heres the best method to just steal from InfinityFree. Heres modified version of hans' code, i just copy-pasted the needed part, you have to change it to your needs of course: function buildAdSenseAdPanel(e) { let t = document.createElement("div"); return ( t.setAttribute("class", "panel panel-widget"), (t.innerHTML = '<div class="panel-heading widget-heading">Advertisement</div><div class="panel-body"><div class="col-xs-12 col-md-12 text-center"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-7281184434591176" data-ad-slot="3301284143" data-ad-format="auto"></ins></div></div>'), t ); } function insertStatsPanelAds() { let e = document.getElementById("stats"), t = buildAdSenseAdPanel(3855191122); e.insertBefore(t, e.firstChild), (adsbygoogle = window.adsbygoogle || []).push({}); let n = buildAdSenseAdPanel(3472047746); e.appendChild(n), (adsbygoogle = window.adsbygoogle || []).push({}); } document.addEventListener("DOMContentLoaded", function () { insertStatsPanelAds() }); Bro i added this code and edited data-ad-client. But it just sends text on cpanel Quote Link to comment Share on other sites More sharing options...
Wizacr Posted August 27, 2022 Share Posted August 27, 2022 5 minutes ago, RoshanOp said: Bro i added this code and edited data-ad-client. But it just sends text on cpanel This is JavaScript. You need to place this code between <script> tags. Example: <script> //JavaScript code here. </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.