miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual | miniBB Mobile
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Tag_floating text

Author astass
Registered
#1 | Posted: 11 Feb 2010 08:33 | Edited by: astass 
This tag makes it possible to draw up the text with illustrations, so that the text filled the space around the illustrations.

1) View file: bb_codes.php

enCodeBB() function:

/* Tag_floating text */
$pattern[]='#\[float=(left|right)\](.*?)\[/float\]#is';
$replacement[]='<div style="float: \\1;">\\2</div>';

2) deCodeBB() function:

$pattern[]="/<div class=\"float:left\"><img src=\"([^<> \n\r\[\]&]+?)\" alt=\"\" (title=\"\" )?style=\"float:left\" \/>/i";
$replacement[]="[float=left]\\1[/float]";

3) We are looking for a line with text:

$pattern[]="/<div style=\"text-align:(left|right|center)\">(.+?)<\/div>/is";
$replacement[]='[align\\1]\\2[/align]';

Somewhere below the insert code:

$pattern[] = '`<div style="float: (right|left);">(.*?)</div>`is';
$replacement[] = "[float=\\1]\\2[/float]\r\n";

Add Button
4) Edit /templates/main_post_form.html
paste the button code:

<a href="JavaScript:paste_strinL(selektion,3,'[float=right]','[/float]','')" onmouseover="window.status='Insert float text'; return true" onmouseout="window.status=''; return true" onmousemove="pasteSel()"><img src="{$main_url}/img/float_right.gif" style="width:23px;height:22px" alt="Insert float text" /></a>
<a href="JavaScript:paste_strinL(selektion,3,'[float=left]','[/float]','')" onmouseover="window.status='Insert float text'; return true" onmouseout="window.status=''; return true" onmousemove="pasteSel()"><img src="{$main_url}/img/float_left.gif" style="width:23px;height:22px" alt="Insert float text" /></a>

Add to folder /img/
rename:float_left.gif and float_right.gif

screenshot
Author astass
Registered
#2 | Posted: 11 Feb 2010 08:47 
Lack! There is no gap between images and text. :-(. I was so incorrigible and this deficiency.
Of course you can make this tag is even better, but it probably will in the future.
Author tom322
Registered
#3 | Posted: 11 Feb 2010 11:13 
It looks interesting, I'll give it a try and if I have problems I'll report it here for your support, thanks ;).
Author tom322
Registered
#4 | Posted: 11 Feb 2010 11:16 
astass:
Of course you can make this tag is even better, but it probably will in the future.

Right, I guess some style like:

style="padding:10px"

would be needed. Have you figured it out how to do it yet? Gap is needed here indeed so that it looks nice :)
Author astass
Registered
#5 | Posted: 11 Feb 2010 11:24 | Edited by: astass 
tom322:
Have you figured it out how to do it yet?

Not yet :-(, but I continue to look for.
Author astass
Registered
#6 | Posted: 17 Feb 2010 07:49 | Edited by: astass 
Today my friend helped with indentation. Subject to correction.
1) View file: bb_codes.php

enCodeBB() function:

/* Tag_floating text */
$pattern[]='#\[float=(left|right)\](.*?)\[/float\]#is';
$replacement[]='<div style="float: \\1; padding: 3px;">\\2</div>';

--------------------------------

3) We are looking for a line with text:

$pattern[]="/<div style=\"text-align:(left|right|center)\">(.+?)<\/div>/is";
$replacement[]='[align\\1]\\2[/align]';

Somewhere below the insert code:

$pattern[] = '`<div style="float: (right|left); padding: 3px;">(.*?)</div>`is';
$replacement[] = "[float=\\1]\\2[/float]\r\n";

Correction, changing the taste: padding: 3px

P.S. Perhaps the tag should be one button to implement. With the possibility of choice.
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Tag_floating text Top
Your Reply Click this icon to move up to the quoted message
 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
  Organize opinions on miniBB-forums,
collecting them with the Polls & Surveys add-on!
Polls addon for miniBB