Text wrap around images in articles?
mishima 144
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Text wrap around images in articles?
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
Yes
1 Re: Text wrap around images in articles?
mishima
OP
144
From: -
From: -
So the text that has the image on the same line has to have this BB code around it?
1 Re: Text wrap around images in articles?
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
Open /classes/class_system.php in an editor and add after:
the following line:
Then add the following CSS to your stylesheet:
You can use now the following two new BBCODE:
$var = preg_replace( "/\[facebook=([a-zA-Z0-9-_]+)\]|\[FACEBOOK=([a-zA-Z0-9-_]+)\]/", "<object type=\"application/x-shockwave-flash\" width=\"576\" height=\"432\" data=\" http://www.facebook.com/v/\\1\"><param name=\"movie\" value=\" http://www.facebook.com/v/\\1\" /><param name=\"wmode\" value=\"transparent\" /></object>", $var );
the following line:
$var = preg_replace( array( "/\[lefttext=(.*?)\](.*?)\[\/lefttext\]/", "/\[righttext=(.*?)\](.*?)\[\/righttext\]/" ), array( "<div class=\"lefttext\"><img src=\"\\1\" alt=\"\" /><br />\\2</div>", "<div class=\"righttext\"><img src=\"\\1\" alt=\"\" /><br />\\2</div>" ), $var );
Then add the following CSS to your stylesheet:
.lefttext
{
float: left;
margin: 10px;
}
.righttext
{
float: right;
margin: 10px;
}
You can use now the following two new BBCODE:
[lefttext=imageurl]imagetext[/lefttext]
[righttext=imageurl]imagetext[/righttext]
Just a quick question, is it possible to get the text in an article to wrap around an image if its on the same line using the BBCODE format and not HTML?
A bit like this: http://www.bbc.co.uk/news/world-middle-east-12331520
Images positioned on right or left have text that wraps to it etc.