vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   BB Code Enhancements - Simple [img] word wrap bbcode (https://vborg.vbsupport.ru/showthread.php?t=220610)

smokey 08-10-2009 10:00 PM

Simple [img] word wrap bbcode
 
1 Attachment(s)
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:
Code:

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:
Code:

<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:
Code:

<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:
Code:

$template_hook[postbit_signature_start]
Right below it add:
Code:

<TABLE width="100%" style="border-collapse: collapse; border: none;">
        <tr>
        <td class="alt1">

Find:
Code:

            $template_hook[postbit_controls]
                        <!-- / controls -->
                </div>

Right below it add:
Code:

            </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

Quote:

Originally Posted by Tilly (Post 1875119)
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

Quote:

Originally Posted by Tilly (Post 1875119)
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

Quote:

Originally Posted by segwayon (Post 1902449)
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

Quote:

Originally Posted by Trana (Post 1902949)
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

Quote:

Originally Posted by ricardoNJ (Post 1903773)
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

Quote:

Originally Posted by ricardoNJ (Post 1904684)
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

Quote:

Originally Posted by fta2k (Post 1905961)
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

Quote:

Originally Posted by Drocr (Post 1908744)
^ 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
[IMGLEFT]URLHERE[/IMGLEFT]

ricardoNJ 11-01-2009 01:58 PM

Quote:

Originally Posted by Drocr (Post 1908748)
with that code he used try
[IMGLEFT]URLHERE[/IMGLEFT]

I was using the icon [https://vborg.vbsupport.ru/images/ed...nsertimage.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

Quote:

Originally Posted by Gear-Monkey (Post 2121037)
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


All times are GMT. The time now is 03:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01090 seconds
  • Memory Usage 1,767KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete