All Working, thank you
Requests for Scripts
Posts 31 to 46 of 46
Share332017-12-28 23:19:15
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)
Share342018-02-19 18:29:56
kami
Hello
Do you still need it? I can try to make it.
Share352018-02-19 22:07:30
Do you still need it? I can try to make it.
YES, I do,,, i still need it.... Thank You Very Much
Share362018-02-20 01:33:59
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.
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.
Share372018-02-20 03:41:00
I tried like this:
<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:
<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)
Share382018-02-21 01:14:20
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>
Share392018-03-15 02:25:43
C3La-NS
Thats work well thank you
Share412018-07-07 20:29:43
Hi ho!
I've enabled the "HTML in posts" option in my forum to allow video embeds.
However, that script wraps whatever is added between the [html] bbcode tags in an <iframe> that does not have the "allowfullscreen" attribute. Result is embedded videos cannot be viewed fullscreen.
Can that script please be modified so that the iframe wrapper includes the allowfullscreen attribute?
Last edited by Buzzer (2018-07-20 20:27:14)
Share422018-07-09 02:51:49
Buzzer
Hello.
I tried to set allowfullscreen data to the current script with jquery, but no luck.
This is a messy a little bit, but you may use different script, probably disabling current.
<script>
hArr = ['Admin', 'User2', 'User3'];
$('.post-content p:not(.post-sig p, .quote-box p)').each(function() {
if($.inArray($(this).parents('.post').find('.pa-author a').text(), hArr)!=-1) {
$(this).html($(this).html().replace(/(<)(.*?)(>)/g,'<$2>')
.replace(/( )/gm,' ')
.replace(/(>)/gm,'>'));
$(this).find('style, div').each(function() {
$(this).html($(this).html().replace(/(<br>)/gm,'\n'));
});
}
});
</script>
You must specify allowed usernames to prevent major security issues.
Then you do not need to use any tags, add html code like you do it on admin-options page.
That is:
<iframe src="SOME URL" frameborder="0" width="640" height="360" scrolling="no" allowfullscreen></iframe>
Note. This script works poorly with new lines for HTML, if you make some it is likely to break your html.
Prob any html-compressor may be useful.
Share432018-07-09 18:25:11
C3La-NS
Excellent, thanks, that alternate script works just fine! 
Oh, and thanks for wrapping the preview images I had posted in a spoiler; totally neglected NSFW, sorry. 
Last edited by Buzzer (2018-07-09 18:26:04)
Share442018-09-18 11:35:14
When I use this code
[video]Youtube URL[/video]
then I just want to display youtube videos without including the recommended videos. Because I don't want to recommend videos from other youtube users
Code:<iframe width="480" height="284" src="http://www.youtube.com/embed/_oM0ROPgVq0" frameborder="0" allowfullscreen></iframe>
Code:<iframe width="100%" height="315" src="https://www.youtube.com/embed/_oM0ROPgVq0?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
or if possible you are willing to change the appearance of youtube videos without including the recommended videos (NEWSetting on mybbforum)
From the example:
http://www.youtube.com/embed/_oM0ROPgVq0
to the example:
https://www.youtube.com/embed/_oM0ROPgVq0?rel=0
Share452018-11-11 00:53:58
kami
I think it's easier to use HTML in posts for this purpose and then insert the code you need.
Because global changes for the whole service are very unlikely.
Share462019-02-18 13:54:20
@C3LaNS and @Alex_63 is it possible to change the default URL for creating topics
if possible to use AJAX to create topics from admin panel
Thanks in advanced

