PDA

View Full Version : BB Code Enhancements - Simple [img] word wrap bbcode


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.

erel34
08-11-2009, 12:44 AM
thanks

Tilly
08-27-2009, 01:40 AM
doesn't work just replaces image with " />

smokey
08-30-2009, 07:07 PM
doesn't work just replaces image with " />

That's odd. Did you copy all the code and follow the directions 100%? What version of vb?

KrU$ty
10-05-2009, 11:33 PM
doesn't work just replaces image with " />

I'm getting the same issue. VB 3.8.4

ricardoNJ
10-09-2009, 02:16 PM
Example?

Trana
10-20-2009, 02:21 AM
Does this work?

segwayon
10-20-2009, 03:50 AM
Nice mod! Is there one which aligns an image as yours does, but also allows for a caption underneath?

mbc100
10-20-2009, 11:24 AM
Example?

Trana
10-21-2009, 12:33 AM
Nice mod! Is there one which aligns an image as yours does, but also allows for a caption underneath?

Good mod, working on my 3.8.4 board, but can anyone help with the question above? We really need this.

segwayon
10-21-2009, 05:11 AM
Good mod, working on my 3.8.4 board, but can anyone help with the question above? We really need this.

This mod linked below ("Advanced BB Codes Toolbar") has some neat features, (but still not the image+caption alignment):

https://vborg.vbsupport.ru/showthread.php?t=220257

ricardoNJ
10-22-2009, 03:49 PM
Anyone could be say, what's the 'example' in this BBcode, please???

fta2k
10-23-2009, 04:53 PM
Anyone could be say, what's the 'example' in this BBcode, please???


I just put ALIGNLEFT and ALIGNRIGHT and it all worked fine.


The mod works great. Copied a random news article and added images. Here's a PrtSc:

http://www.fhqhosting.com/ui/20untitled.PNG

ricardoNJ
10-23-2009, 07:03 PM
I can not do that. :(

fta2k
10-25-2009, 03:30 PM
I can not do that. :(

Are you typing something in wrong?

Works great here... Here's a PrtSc of the settings

http://www.fhqhosting.com/ui/left.PNG

ricardoNJ
10-28-2009, 12:14 AM
Are you typing something in wrong?

Works great here... Here's a PrtSc of the settings

http://www.fhqhosting.com/ui/left.PNG
Nothing happened:

http://img229.imageshack.us/img229/8859/left1l.jpg

http://img12.imageshack.us/img12/652/left2p.jpg

Drocr
10-31-2009, 06:20 PM
^ I believe in needs to just be around the image code not text as well.

ricardoNJ
10-31-2009, 06:32 PM
^ I believe in needs to just be around the image code not text as well.

Same thing. I don't know how to do that ! :confused:

Drocr
10-31-2009, 06:41 PM
with that code he used try
URLHERE

ricardoNJ
11-01-2009, 01:58 PM
with that code he used try
URLHERE

I was using the icon [https://vborg.vbsupport.ru/images/editor/insertimage.gif]to place the image. It was only in the URL in the middle of the code. My bad!!!!! Thanks!! :p:up:

Gear-Monkey
11-12-2010, 05:32 PM
This works without doing the postbit template edits. What are the postpit template edits for?

smokey
11-12-2010, 08:16 PM
This works without doing the postbit template edits. What are the postpit template edits for?

You know I don't remember why to be quite honest. I am using a custom design on my site and I think it was not working correctly so I tabled it up. Does it work 100% on the default template? If so, I'll remove it if it's not needed.

Gear-Monkey
11-13-2010, 12:30 AM
Yeah, it works in the default theme without the postbit template hack. Version 3.8.6

MagicThemeParks
05-14-2011, 03:57 PM
Worked without the postbit template portion on version 3.8.7 :up:

Here's a demo: State of Florida History (http://www.unitedstateshistoryforum.com/showthread.php?p=505)