vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 11-02-2004, 07:51 AM
ZnARk ZnARk is offline
Junior Member
 
Join Date: Sep 2004
Posts: 2
Default How to add BB code that wraps text around an image

This prolly have been done before but here is how I added a custom BB code that will wrap text around a picture.
Might be useful in news forum etc
Also made a little image/button to go with it
Just save the wrap.gif and upload it to your forum/images/editor folder.

Go to forum/admincp/bbcode.php? and add the new BB code...

Title:
Code:
Wrap text around image
Tag:
Code:
wrap
Replacement:
Code:
<table border="0" align="left"  valign="top"> 
<tr> 
<td><img src="{param}" border="0" align="left"></td> 
</tr> 
</table>
Example:
Code:
[wrap]imgurl[/wrap]
Description:
Code:
This will wrap text around a picture of your choice. Just add the url to the img you wish to use.
Use {option}:
Code:
No
Button Image (Optional):
Code:
images/editor/wrap.gif
Added some screens of it to...
Attached Images
File Type: jpg button.jpg (12.6 KB, 327 views)
File Type: jpg howto.jpg (38.3 KB, 301 views)
File Type: jpg preview.jpg (75.2 KB, 440 views)

Last edited by ZnARk; 11-02-2004 at 08:08 AM.
  #2  
Old 11-02-2004, 08:08 AM
ZnARk ZnARk is offline
Junior Member
 
Join Date: Sep 2004
Posts: 2
Default Re: How to add BB code that wraps text around an image

Button
Attached Images
File Type: gif wrap.gif (357 Bytes, 1491 views)
  #3  
Old 11-13-2004, 03:04 AM
Amavisca Amavisca is offline
Junior Member
 
Join Date: Mar 2004
Posts: 11
Default Re: How to add BB code that wraps text around an image

Thanks , man this is exactly what I need. Awsome.
  #4  
Old 01-04-2005, 12:29 AM
mindbuster mindbuster is offline
Member
 
Join Date: Dec 2004
Posts: 58
Default Re: How to add BB code that wraps text around an image

Cool, thnx, needed this
  #5  
Old 01-04-2005, 06:12 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How to add BB code that wraps text around an image

Easier way of doing this...

Go into ACP --> Custom BB Codes --> Add New BB Code
  • Title = Image with alignment
  • Tag = img2
  • Replacement =
    Code:
    <img src="{param}" align="{option}" border="0" hspace="6" vspace="3" alt=""/>
  • Example = [img2=right]URL of image[/img2]
  • Description = This tag allows you to align an image to the right of left of your text.
  • Use {option} = Yes
  • Button Image (optional) = {your choice....}
This method requires no code changes and allows you to specify the alignment (left, right, top, or bottom).

Last edited by KW802; 04-21-2005 at 04:27 PM.
  #6  
Old 01-05-2005, 09:43 AM
wintermute's Avatar
wintermute wintermute is offline
Junior Member
 
Join Date: Jul 2004
Posts: 24
Default Re: How to add BB code that wraps text around an image

Thanks to you both, very much
  #7  
Old 01-25-2005, 02:49 PM
coolegg coolegg is offline
Junior Member
 
Join Date: Nov 2004
Posts: 14
Default Re: How to add BB code that wraps text around an image

I think there may be a bit of a security issue with the methods suggested so far...

I discovered one drawback to creating a custom <img> BBCode, and that is that the security option that allows the admin to filter out any image urls with dynamic elements does not work on custom BB codes that use <img src=""> (that security option is under Admin Panel > vBulletin Options > Message Posting and Editing Options) Even when enabled, that security setting does not work on any custom BB codes that are based on the <img> tag.

I am a security nut (paranoid), so what I came up with was two custom BBcodes that will float any block-level element, image or otherwise. These BB codes can then be nested AROUND the [IMG][/IMG] BB code so that the image floats but the security setting still works.

So my BB code useage looks something like this:

Code:
[FLOATLEFT][IMG]imageurl[/IMG][/FLOATLEFT]
My two custom BB codes look like this:

Code:
Title: FLOATLEFT
Usage: [FLOATLEFT]{param}[/FLOATLEFT]
Replacement: <div style="float: left">{param}</div>
and
Code:
Title: FLOATRIGHT
Usage: [FLOATRIGHT]{param}[/FLOATRIGHT]
Replacement: <div style="float: right">{param}</div>
Edit: fixed typos

Last edited by coolegg; 01-25-2005 at 02:57 PM.
  #8  
Old 01-25-2005, 03:02 PM
mholtum's Avatar
mholtum mholtum is offline
I ******* single moms.
 
Join Date: May 2004
Location: Tempe, Arizona
Posts: 1,938
Default Re: How to add BB code that wraps text around an image

sweet, I used KW802's way. Quick and Easy!
  #9  
Old 03-04-2005, 06:25 AM
hoangminh hoangminh is offline
Junior Member
 
Join Date: Feb 2005
Posts: 8
Default Re: How to add BB code that wraps text around an image

Quote:
Originally Posted by ZnARk
This prolly have been done before but here is how I added a custom BB code that will wrap text around a picture.
Might be useful in news forum etc
Also made a little image/button to go with it
Just save the wrap.gif and upload it to your forum/images/editor folder.

Go to forum/admincp/bbcode.php? and add the new BB code...

Title:
Code:
Wrap text around image
Tag:
Code:
wrap
Replacement:
Code:
<table border="0" align="left"  valign="top"> 
<tr> 
<td><img src="{param}" border="0" align="left"></td> 
</tr> 
</table>
Example:
Code:
[wrap]imgurl[/wrap]
Description:
Code:
This will wrap text around a picture of your choice. Just add the url to the img you wish to use.
Use {option}:
Code:
No
Button Image (Optional):
Code:
images/editor/wrap.gif
Added some screens of it to...
If you use this way to wrap text around images, it will get problem when this post are show on the vbcmps index page, all the news will be displayed incorrect positions.

I have use the KW802 way before I read this thread, it is simple and good way to implement
  #10  
Old 04-15-2005, 11:39 AM
mholtum's Avatar
mholtum mholtum is offline
I ******* single moms.
 
Join Date: May 2004
Location: Tempe, Arizona
Posts: 1,938
Default Re: How to add BB code that wraps text around an image

Quote:
Originally Posted by KW802
Easier way of doing this...

Go into ACP --> Custom BB Codes --> Add New BB Code
  • Title = Image with alignment
  • Tag = img2
  • Replacement =
    Code:
    <img src="{param}" align="{option}" border="0" hspace="6" vspace="3" alt=""/>
  • Example = [img2=right]URL of image[/img]
  • Description = This tag allows you to align an image to the right of left of your text.
  • Use {option} = Yes
  • Button Image (optional) = {your choice....}
This method requires no code changes and allows you to specify the alignment (left, right, top, or bottom).
I added this code (see attatchment) yet the image does not appear.. Any ideas? When I click the button I place the path to the image. I am thinking I am placing the wrong info in the popup.

Ok, Huge Duh to me.. You place "left" or "right" in the popup... DUH DUH DUH
Attached Images
File Type: gif hmmmm.gif (10.8 KB, 66 views)

Last edited by mholtum; 04-15-2005 at 11:50 AM.
  #11  
Old 04-19-2005, 06:45 PM
Milk Man Milk Man is offline
tgimm.com Webmaster
 
Join Date: Feb 2005
Location: New Zealand
Posts: 239
Default Re: How to add BB code that wraps text around an image

for some reason when i use the wrap and then view the post, my text dissapears
__________________
tgimm.com- A fun community that you can discuss anything you want.
  #12  
Old 04-19-2005, 06:46 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How to add BB code that wraps text around an image

Quote:
Originally Posted by Milk Man
for some reason when i use the wrap and then view the post, my text dissapears
Which version of the code are you using?
  #13  
Old 04-21-2005, 03:20 PM
emtee emtee is offline
Junior Member
 
Join Date: Aug 2004
Posts: 11
Question Re: How to add BB code that wraps text around an image

KW802, I'm using your code and when I type [img2=left]http://www.....gif[/img], the image doesn't show up, it just display the text [img2=left]http://www.....gif[/img]. I wonder why???

mholtum: Ok, Huge Duh to me.. You place "left" or "right" in the popup... DUH DUH DUH <<< I'm still confused. What do you mean by "the popup" ?
  #14  
Old 04-21-2005, 03:22 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How to add BB code that wraps text around an image

Because it needs to be closed with an "[/img2]" tag instead of a "[/img]" tag.
  #15  
Old 04-21-2005, 04:11 PM
emtee emtee is offline
Junior Member
 
Join Date: Aug 2004
Posts: 11
Default Re: How to add BB code that wraps text around an image

Oh ok got it, thanks KW802. By the way, you need to edit your instructions so people don't get errors like I did. Thanks for the quick reply!
  #16  
Old 04-21-2005, 04:12 PM
mholtum's Avatar
mholtum mholtum is offline
I ******* single moms.
 
Join Date: May 2004
Location: Tempe, Arizona
Posts: 1,938
Default Re: How to add BB code that wraps text around an image

Quote:
Originally Posted by emtee
Oh ok got it, thanks KW802. By the way, you need to edit your instructions so people don't get errors like I did. Thanks for the quick reply!
The instructions worked for me..
  #17  
Old 04-21-2005, 04:28 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How to add BB code that wraps text around an image

Quote:
Originally Posted by emtee
Oh ok got it, thanks KW802. By the way, you need to edit your instructions so people don't get errors like I did. Thanks for the quick reply!
Whoops! I fixed the post.
  #18  
Old 04-22-2005, 04:32 AM
Milk Man Milk Man is offline
tgimm.com Webmaster
 
Join Date: Feb 2005
Location: New Zealand
Posts: 239
Default Re: How to add BB code that wraps text around an image

i'm using the first code...
__________________
tgimm.com- A fun community that you can discuss anything you want.
  #19  
Old 05-17-2005, 04:09 AM
MP3 MP3 is offline
MP3
 
Join Date: Feb 2005
Posts: 19
Default Re: How to add BB code that wraps text around an image

thanks
  #20  
Old 05-21-2005, 02:33 AM
aggiefan aggiefan is offline
Junior Member
 
Join Date: May 2005
Posts: 23
Default Re: How to add BB code that wraps text around an image

If you want a resize parameter (like an 80X80 picture that you want posted at width="40")...

Could you set that up in the setup?

That'd be easier than resizing all the pictures I want to use.

***EDIT***

I figured out how to do it to a fixed size (like if I wanted all pics 150 width..(you just put width="150" in the code box. But how can I make it to where for each individual post I can put width=?? and it works?

Last edited by aggiefan; 05-21-2005 at 02:39 AM.
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Uber Friendly Front Page News Displaying Template Alex@i-Club Add-On Modules & Modifications 103 08-02-2006 11:23 PM
How do I add the following 'Display Random Image' Code? baptizer Add-On Modules & Modifications 5 07-14-2004 03:37 PM


All times are GMT -4. The time now is 06:15 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.