smokey
08-10-2009, 10:00 PM
I saw a few threads in the modification graveyard where you can add a bbcode to align an image left or right, did not see any newer threads that accomplish this correctly and without messing up the signature and other things.
This is what I've done:
First lets add some CSS entries to each style.
In admin cp, go to Styles & Templates -> Style Manager -> Main CSS Options
Scroll down to the Additional CSS Definitions and add the following at the bottom:
img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}
img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}
.alignright {
float: right;
}
.alignleft {
float: left
}
Second lets add the bbcodes:
Title: Image Align Left
BB Code Tag Name: IMGLEFT
Replacement:<img class="alignleft" border="0" alt="" src="{param}" />
Description: Simple left image alignment with text wrap
Use {option}: no
Title: Image Align Right
BB Code Tag Name: IMGRIGHT
Replacement:<img class="alignright" border="0" alt="" src="{param}" />
Description: Simple right image alignment with text wrap
Use {option}: no
Lastly, lets edit the postbit templates for each style:
Find:
$template_hook[postbit_signature_start]
Right below it add:
<TABLE width="100%" style="border-collapse: collapse; border: none;">
<tr>
<td class="alt1">
Find:
$template_hook[postbit_controls]
<!-- / controls -->
</div>
Right below it add:
</td>
</tr>
</table>
Thats it! You're done. I'll attach some buttons I made which you can use when adding your new bbcode if you wish.
This is what I've done:
First lets add some CSS entries to each style.
In admin cp, go to Styles & Templates -> Style Manager -> Main CSS Options
Scroll down to the Additional CSS Definitions and add the following at the bottom:
img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}
img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}
.alignright {
float: right;
}
.alignleft {
float: left
}
Second lets add the bbcodes:
Title: Image Align Left
BB Code Tag Name: IMGLEFT
Replacement:<img class="alignleft" border="0" alt="" src="{param}" />
Description: Simple left image alignment with text wrap
Use {option}: no
Title: Image Align Right
BB Code Tag Name: IMGRIGHT
Replacement:<img class="alignright" border="0" alt="" src="{param}" />
Description: Simple right image alignment with text wrap
Use {option}: no
Lastly, lets edit the postbit templates for each style:
Find:
$template_hook[postbit_signature_start]
Right below it add:
<TABLE width="100%" style="border-collapse: collapse; border: none;">
<tr>
<td class="alt1">
Find:
$template_hook[postbit_controls]
<!-- / controls -->
</div>
Right below it add:
</td>
</tr>
</table>
Thats it! You're done. I'll attach some buttons I made which you can use when adding your new bbcode if you wish.