vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   [IMG] tag -- align? (https://vborg.vbsupport.ru/showthread.php?t=32510)

bigmattyh 11-19-2001 05:54 AM

I've been working in php for quite some time now, but I admit that I'm a little new to some of the more advanced regular expressions, like vB uses.

Is there any way to have the vB bbcode parser turn this:
Code:

[IMG align="left"]http://image.com/image.gif[/IMG]
into this:
Code:

<img align="left" src="http://image.com/image.gif">
I'm sure there is -- I regret that I don't yet have the skills to make sense of the 30+ character strings vB uses in preg_replace.

Thanks!

Admin 11-19-2001 06:03 AM

Just add it as a custom vB code, from the Admin CP.
You'll see an option to use a {param}.
Only you won't be able to do this:
[img align="left"]
but rather this:
[img=left]

[QUOTE]Originally posted by bigmattyh
I'm sure there is -- I regret that I don't yet have the skills to make sense of the 30+ character strings vB uses in preg_replace.

yulee 12-18-2001 10:39 PM

ok, I'm trying it but without success :(

Check please what I'm doing wrong:

Code:

vB code tag: img align
vB code replacement: <p><img src={param} align="{option}"></p>
vB code example: https://vborg.vbsupport.ru/
use options: yes.

I'm receiving this in hte definitons:

It seems it's not changing [ for <

I have vBulletin 2.2.1. Aggh :( What I'm doing wrong!

Thank you very much

Reeve of shinra 12-18-2001 11:15 PM

You named the new BBCode img ... where one already exists.
Rename it something else, like img align as shown in Firefly's example above.

Alternately, you could just add the align code and memers can just use that....

[align=center][img]www.shinraonline.com [/img ][ /align]

amykhar 12-18-2001 11:23 PM

It should be:

vb code tag img
vb code replacement <img src="{param}" align="{option}">

vb code example [img=right]http://www.mysite.com/logo.gif[/img]

Hope that helps.

Amy

amykhar 12-18-2001 11:25 PM

Mine is working even with using the img tag, but a new tag is probably best as they suggested.

Amy

yulee 12-18-2001 11:36 PM

No success:

vB Code tag: imgalign
vB Code replacement: <img src="{param}" align="{option}">
vB Code example: https://vborg.vbsupport.ru/
Use option: Yes.

I think I'm doing what you mean, but it's not running. No hack done in my forum yet.

yulee 12-18-2001 11:40 PM

Quote:

Originally posted by Reeve of shinra
You named the new BBCode img ... where one already exists.
Rename it something else, like img align as shown in Firefly's example above.

Alternately, you could just add the align code and memers can just use that....

[align=center][img]www.shinraonline.com [/img ][ /align]

If you do that you don't receive a real align left. I need to have the real img align.

Please, I know it sould be very easy, but I can't manage it.

Thank you very much!

yulee 12-19-2001 04:40 PM

Should I use any replacement or only add the vbcode? I can't manage it :(

Please, help me to have success with img align

yulee 12-19-2001 09:21 PM

Any idea?

Thank you!

yulee 12-19-2001 10:26 PM

DONE!!! It was necessary to set the same name of the vbcode as in the replacement!!! Look I set the name as imgalign but no img!!! So if you set img as name it runs:

Code:

vB Code tag: imgalign
vB Code replacement: <img src="{param}" align="{option}">
vB Code example: [img=right]http://www.mywebsite.com/images/image.jpg[/img]
Use option: Yes.

See you!

Martin CX 12-20-2001 01:49 AM

I haven't tested this but I suppose the greatest flexibility would come from using 'style="{option]' then the world would be your oyster (or something...):

[img=align:left;valign:top;border:12px]image[/img]

Or am I wrong?


All times are GMT. The time now is 05:02 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.01079 seconds
  • Memory Usage 1,737KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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