How to wrap a PHPBB3 forum post content around Google Adsense Ad? - phpbb3

I am injecting this code
<!-- IF postrow.S_FIRST_ROW -->
<div style="float: left;">
<script type="text/javascript"><!--'
google_ad_client = "pub-X";
google_ad_slot = "X";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><!-- ENDIF -->
in viewtopic_body.html just before,
<div class="content">{postrow.MESSAGE}</div>
However, the post content wraps on the right side of the Google Ad but not below the Ad. I have tried many variations of float but the bottom part of the Ad is always blank.
I want to know how this wrapping issue can be fixed WITHOUT touching any other file in the PHPBB3 forum software except viewtopic_body.html. (PHBB3 Ver. 3.0.7-PL1)
You can the see the described problem at http://www.aawartan.org/viewtopic.php?f=14&t=2

for the first ad for the ins use
display: block; border: medium none; height: 200px; margin: 0pt; padding: 0pt; position: relative; visibility: visible; width: 200px;
for the second ad use for the ins tag..
style="display: block; float: left; clear: left; border: medium none; height: 200px; margin: 0pt; padding: 0pt; position: relative; visibility: visible; width: 200px;"
Example: http://img686.imageshack.us/img686/6889/screenshot1bu.jpg

Related

Buildfire: Image is not displaying after placing working code in source code for some reason

I wanted to know why my image isn't showing up in the Buildfire platform when i place the code into the source area.....I've tested it on everything else and it works perfectly...dreamweaver and everything.... Need help to help get the image to show up in buildfire. The code i am using is below:
<p class="bf-wysiwyg-hide-app bf-wysiwyg-top"><img src="blob:https://pluginserver.buildfire.com/890db794-346d-4428-be1f-aa8dd5f5efdc" style="display: none;" onload="typeof buildfire !== 'undefined' && buildfire.dynamicBlocks.execute(this);" data-type="dynamic-expression" /></p>
<div id="bf_mce_layout_2" class="bf-wysiwyg-top bf-wysiwyg-hide-app" data-bf-layout="%7B%22id%22%3A%22bf_mce_layout_2%22%2C%22cssUrl%22%3A%22layouts/bf_mce_layout2.css%22%2C%22htmlUrl%22%3A%22layouts/template_a.html%22%7D" data-layout-name="bf_mce_layout_2"><!-- This template should not be changed once is live -->
<div class="bf_mce_img-container"><img src="https://dallasexaminer.com/wp-content/uploads/2023/01/Preparing-for-Legislative-Session.jpg" onclick="buildfire.actionItems.execute(JSON.parse(unescape(this.getAttribute("data-execute"))), ()=>{})" data-bf-image="%7B%22originalSrc%22%3A%22https%3A//s3-us-west-2.amazonaws.com/imageserver.prod/71e97b33-4374-11ec-9fe6-12a56cc33887/karen-bass.jpg%22%7D" data-execute="%7B%22action%22%3A%22linkToApp%22%2C%22instanceId%22%3A%22665ce2b8-7ce6-4cb5-bbfc-282dc22cdd6c-1651251310477%22%2C%22title%22%3A%22Current%20News%22%2C%22iconUrl%22%3A%22https%3A//pluginserver.buildfire.com/plugins/60/resources/icon.png%22%2C%22queryString%22%3Anull%2C%22deeplinkId%22%3Anull%7D" /></div>
<div class="bf_mce_copy">
<h1>Current News</h1>
<p class="bf_mce_caption">Check out the current news from The Dallas Examiner today by clicking the button below</p>
</div>
<button class="bf-btn bf-btn-primary" onclick="buildfire.actionItems.execute(JSON.parse(unescape(this.getAttribute('data-execute'))), ()=>{})" data-execute="%7B%22title%22%3A%22Current%20News%22%2C%22iconUrl%22%3A%22https%3A//pluginserver.buildfire.com/plugins/60/resources/icon.png%22%2C%22action%22%3A%22linkToApp%22%2C%22instanceId%22%3A%22665ce2b8-7ce6-4cb5-bbfc-282dc22cdd6c-1651251310477%22%2C%22queryString%22%3Anull%2C%22deeplinkId%22%3Anull%7D">Current News</button></div>
<p class="bf-wysiwyg-top bf-wysiwyg-hide-app"> </p>
<style class="bf-wysiwyg-top bf-wysiwyg-hide-app" data-layout-name="bf_mce_layout_2">
#bf_mce_layout_2 * > span{
color: currentColor;
}
#bf_mce_layout_2{
font-size: 16px;
margin: 1rem;
border-radius: 1rem;
overflow: hidden;
position: relative;
text-align: center;
box-shadow: 0 .5rem 1rem rgba(77, 77, 77, 0.5);
}
#bf_mce_layout_2 .bf_mce_img-container{
position: relative;
left: 0;
top: 0;
height: 200px;
width: 100%;
}
#bf_mce_layout_2 .bf_mce_img-container img{
width: 100%;
height: 100%;
object-fit: cover;
}
#bf_mce_layout_2 .bf_mce_copy{
padding: 1rem;
}
#bf_mce_layout_2 .bf_mce_copy h1{
margin-top: 0;
margin-bottom: .5rem;
}
#bf_mce_layout_2 .bf_mce_copy .bf_mce_caption{
font-size: .75rem !important;
margin-bottom: 2rem;
}
#bf_mce_layout_2 .bf_mce_copy p{
line-height: 1.5;
}
#bf_mce_layout_2 button{
position: relative;
margin-bottom: 2rem;
min-width: 150px;
z-index: 1;
}</style>
[[[enter image description here](https://i.stack.imgur.com/MAJs2.jpg)](https://i.stack.imgur.com/kIJKs.jpg)](https://i.stack.imgur.com/hM7uY.jpg)
I placed in a code that works perfectly in dreamweaver into the source code area of Buildfire and for some reason the image is not showing up. I need help with this The code is below:
Your code seems to run just fine, screenshot below:
Maybe a problem retrieving the image? I'd check the network traffic in Safari or Google Chrome and see if the image being requested or not.
If it is being requested then check if you're getting any status code errors. If it is not being requested try adding more information.

Trouble using BEM with SASS

I am trying to integrate BEM into my sass. I am also using Gulp. When I don't use BEM my code works fine. When I include BEM, the code no longer works.
Here is my HTML with out BEM.
<div class="wrapper">
<ul class="stage">
<li class="scene">
<div class="movie">
<div class="poster"></div>
</div>
</li>
</ul>
</div>
Here is my SASS
.wrapper{
margin: 100px auto;
max-width: 960px;
.stage{
list-style: none;
padding: 0;
.scene {
width: 260px;
height: 400px;
margin: 30px;
float: left;
perspective: 1000px;
}
}
}
Here is my HTML using BEM
<div class="wrapper">
<ul class="stage">
<li class="stage__scene">
<div class="movie">
<div class="poster"></div>
</div>
</li>
</ul>
</div>
Here is my SASS with BEM
.wrapper{
margin: 100px auto;
max-width: 960px;
.stage{
list-style: none;
padding: 0;
&__scene {
width: 260px;
height: 400px;
margin: 30px;
float: left;
perspective: 1000px;
}
}
}
I am new to BEM so I am pretty sure I am missing something obvious. Please let me know.
I'm unsure what "no longer works". But your CSS / SASS code doesn't conform to BEM. BEM deliberately limits the use of cascading. Because blocks are independent, a block (.stage) shouldn't be styled as a descendant of another block (.wrapper).
Here is a BEM-compliant SASS code:
.wrapper{
margin: 100px auto;
max-width: 960px;
}
.stage{
list-style: none;
padding: 0;
&__scene {
width: 260px;
height: 400px;
margin: 30px;
float: left;
perspective: 1000px;
}
}
See also: the official BEM methodology.
I don't think this is a BEM issue, but an "issue" with SASS compiler. I don't know that you can do class concatenation like that. The way you have the sass written is looking for a div with 2 separate classes, stage and __scene on the same element, not a single class called stage__scene on a nested element.
Your sass should look like this:
.wrapper{
margin: 100px auto;
max-width: 960px;
.stage{
list-style: none;
padding: 0;
.stage__scene {
width: 260px;
height: 400px;
margin: 30px;
float: left;
perspective: 1000px;
}
}
}

Flex section broken in Firefox

I have a section with 2 rectangles inside a flex container. One of the rectangles simply has a margin-top: - 17%, which is ignored by Firefox. Is there any way to assign a percentage margin in Firefox? (the rectangle slides nicely when the window is resized vs doing nothing if I use pixels as a margin).
Here is a Codepen Example: https://codepen.io/SergiOca/pen/wdQYad
<div class="import-flex">
<div class="export-rectangle">
<h1> Asesoramiento. </h1>
<p>
Test
</p>
</div>
<div class="import-rectangle">
<h1> <span> Oportunidad. </span></h1>
<p>
Test
</p>
</div>
<img src="http://www.gettyimages.com/gi-resources/images/Embed/new/embed2.jpg" alt="" class="import-footer-image img-responsive">
</div>
.import-rectangle {
transition: ease-in-out 1s;
position: relative;
width: 471.7px;
height: 409px;
background-color: #454044;
box-shadow: 0 0 20px 20px rgba(44, 42, 44, 0.1);
z-index: 5;
color: white;
padding: 40px 50px;
margin-top: -17%;
}
.export-rectangle {
position: relative;
width: 471.7px;
height: 407px;
margin-right: 5%;
background-color: #c97c60;
z-index: 5;
color: #454044;
padding: 40px 50px;
}
.import-flex {
display: flex;
position: relative;
}
.import-footer-image {
width: 430px;
height: auto;
margin: 0 auto;
position: absolute;
top: 93%;
left: 30%;
z-index: 100;
}
Firefox has struggled with a bug when using percent for some time, bugzilla bug, so may I suggest you use viewport units instead.
margin-top: -17vw;
Updated codepen
If you need to adjust towards a parent element, CSS Calc might come to rescue if the parents size/position is somewhat fixed.

Alternate to background-size property to use in IE8

I have to resize the buttons on the screen initial size of button 157*70px and required size on screen is 100*50px. It has to be compatible with IE8 where the background-size property is not working although this property works fine in FF.
HTML:
<div id="return_button">
<a class="new_return_button" name="PREVIOUS">Previous</a>
</div>
CSS:(Firfox)
.new_return_button{
background: url("images/previous.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
backgound-size: 100px 50px;
color: #FFFFFF;
cursor: pointer;
display: block;
height: 70px;
line-height: 70px;
width: 157px;
}
#return_button{
color: #FFFFFF;
font-weight: bold;
height: 70px;
left: 10px;
line-height: 70px;
margin: 0;
position: absolute;
text-align: center;
width: 157px;
}
This css works fine in Firefox with background-size property and shrinks the image of 157*70px to area of 100*50px but doesn't work in IE8.
Please suggest a solution to this issue
One way to solve this is to use another element. You probably need to tweak the margins of the <span> to have it working as desired. Also note that this does not guarantee a specific height, instead it will give you the correct aspect ratio for the scaled graphic.
<style>
#return_button {
position: relative;
width: 100px;
}
#return_button img {
max-width: 100%;
height: auto;
}
#return_button span {
position: absolute;
top: 50%;
margin-top: -5px;
left: 10px;
right: 10px;
text-align: center;
}
</style>
<div id="return_button">
<img src="images/previous.png" alt="Button graphic">
<span>Button label</span>
</div>

Align image center in floated div

I have a loop to loaded logo image in floated div block, I been tried few tips from stackoverflow but have no luck to make the logo align center and middle within the div, all logo height are not fixed and might have different height for each:
<div style="float:left; width:80px; height:80px; padding:8px; border:1px solid #ccc;">
<img width="78px" align="left" src="images/logo/logo1.jpg">
</div>
Please help, thanks.
Use positioning. The following worked for me...
With zoom to the center of the image (image fills the div):
div{
float:left;
display:block;
overflow:hidden;
width: 70px;
height: 70px;
position: relative;
}
div img{
min-width: 70px;
min-height: 70px;
max-width: 250%;
max-height: 250%;
top: -50%;
left: -50%;
bottom: -50%;
right: -50%;
position: absolute;
}
Without zoom to the center of the image (image does not fill the div):
div{
float:left;
display:block;
overflow:hidden;
width: 100px;
height: 100px;
position: relative;
}
div img{
width: 70px;
height: 70px;
top: 50%;
left: 50%;
bottom: 50%;
right: 50%;
position: absolute;
}
You really should move your CSS out of the style attribute and into a file like style.css if you have not done so. But if you really have to you can place the code below into inline styles like you have now.
Remove the align="left" attribute from your image tag and set the image's display to block. This will allow margin: 0 auto; to center your image for you inside the containing DIV.
Looks like you'll have to replicate a <table> with CSS to get the vertical centering you desire. Table cells allow vertical centering. To do this I've added and additional DIV with a class of .container. The .container DIV has it's display set to table and the .image-container DIV, which is acting like a table cell, has it's display set to table-cell.
CSS
.container {
float: left;
width: 80px;
height: 80px;
padding: 8px;
border: 1px solid #ccc;
display: table;
}
.image-container {
display: table-cell;
vertical-align: middle;
}
.image-container img {
display: block;
margin: 0 auto;
}
HTML
<div class="container">
<div class="image-container">
<img src="images/logo/logo1.jpg">
</div>
</div>
JSFiddle: http://jsfiddle.net/MJ5j4/
just create a class "centerImgWrapper", and wrap all your "center" Images anywhere in the Code with divs.
Thats pure CSS
.centerImgWrapper {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;}
.centerImgWrapper img {
left: 0;
right:0;
top: 0;
bottom:0;
max-height: 100%;
max-width: 100%;
margin:auto;
position:absolute;
}
Just Check out the Fiddle.
MyFiddle
Dave
If you are trying to get it in the middle inside the div, have you tried:
<div style="width:800px; height:800px; padding:8px; border:1px solid #ccc;">
<img width="78px" src="mobiIconGreenGray.gif" style="margin-left:50%; margin-top:50%;">
</div>
I used "margin-left:50%; margin-top:50%;" INSIDE the IMG tag and got rid of the "align" and "float" attribute. I probably wouldn't want to use "align" in this case.
Either way, I hope it helps.
Images are more or less displayed as inline-blocks. So you can just set text-align: center; on the styles of the container div.
Getting something to be vertically aligned in the middle is complicated with css. If you're going to be dynamically placing the logo with JavaScript anyway, you can save yourself trouble and just center it vertically by specifying the margins with JavaScript.
Check out this demo: http://jsfiddle.net/jyvFN/1/
HTML
<div id="container">
<img id="logo" src="http://placekitten.com/100/100" />
</div>
CSS:
#container {
float: left;
background-color: blue;
width: 200px;
height: 150px;
text-align: center;
border: 1px solid red;
}
JavaScript
var logo = document.getElementById('logo');
var container = document.getElementById('container');
var margin = (container.clientHeight - logo.clientHeight) / 2;
logo.style.marginTop = margin + "px";
logo.style.marginBottom = margin + "px";
Why didn't you set align of the image center?
Then your code should be:
<div style="float:left; width:80px; height:80px; padding:8px; border:1px solid #ccc;">
<img width="78px" align="center" src="images/logo/logo1.jpg">
And I think it's also problem of the ratio of the image width vs the div block + it's padding and border.
Try to set it balance.

Resources